David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018 Free Software Foundation, Inc. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 5 | |
| 6 | #include <linux/linkage.h> |
| 7 | |
| 8 | ENTRY(__lshrti3) |
| 9 | beqz a2, .L1 |
| 10 | li a5,64 |
| 11 | sub a5,a5,a2 |
| 12 | addi sp,sp,-16 |
| 13 | sext.w a4,a5 |
| 14 | blez a5, .L2 |
| 15 | sext.w a2,a2 |
| 16 | sll a4,a1,a4 |
| 17 | srl a0,a0,a2 |
| 18 | srl a1,a1,a2 |
| 19 | or a0,a0,a4 |
| 20 | sd a1,8(sp) |
| 21 | sd a0,0(sp) |
| 22 | ld a0,0(sp) |
| 23 | ld a1,8(sp) |
| 24 | addi sp,sp,16 |
| 25 | ret |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 26 | .L1: |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 27 | ret |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 28 | .L2: |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 29 | negw a4,a4 |
| 30 | srl a1,a1,a4 |
| 31 | sd a1,0(sp) |
| 32 | sd zero,8(sp) |
| 33 | ld a0,0(sp) |
| 34 | ld a1,8(sp) |
| 35 | addi sp,sp,16 |
| 36 | ret |
| 37 | ENDPROC(__lshrti3) |