David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | ;; SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | ;; Copyright (C) 2010 Texas Instruments Incorporated |
| 3 | ;; Contributed by Mark Salter <msalter@redhat.com>. |
| 4 | ;; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 5 | |
| 6 | ;; uint64_t __c6xabi_llshr(uint64_t val, uint shift) |
| 7 | |
| 8 | #include <linux/linkage.h> |
| 9 | |
| 10 | .text |
| 11 | ENTRY(__c6xabi_llshr) |
| 12 | mv .l1x B4,A1 |
| 13 | [!A1] b .s2 B3 ; return if zero shift count |
| 14 | mvk .s1 32,A0 |
| 15 | sub .d1 A0,A1,A0 |
| 16 | cmplt .l1 0,A0,A2 |
| 17 | [A2] shl .s1 A5,A0,A0 |
| 18 | nop |
| 19 | [!A2] neg .l1 A0,A4 |
| 20 | || [A2] shru .s1 A4,A1,A4 |
| 21 | [!A2] shr .s1 A5,A4,A4 |
| 22 | || [A2] or .d1 A4,A0,A4 |
| 23 | [!A2] shr .s1 A5,0x1f,A5 |
| 24 | [A2] shr .s1 A5,A1,A5 |
| 25 | bnop .s2 B3,5 |
| 26 | ENDPROC(__c6xabi_llshr) |