Jason A. Donenfeld | 255845f | 2018-04-28 00:42:52 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 2 | * |
Jason A. Donenfeld | 255845f | 2018-04-28 00:42:52 +0200 | [diff] [blame] | 3 | * Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <linux/linkage.h> |
| 7 | |
Mark Rutland | abb77f3 | 2018-12-07 18:08:17 +0000 | [diff] [blame] | 8 | #include <asm/assembler.h> |
| 9 | |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 10 | SYM_FUNC_START(__ashlti3) |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 11 | cbz x2, 1f |
| 12 | mov x3, #64 |
| 13 | sub x3, x3, x2 |
| 14 | cmp x3, #0 |
| 15 | b.le 2f |
| 16 | lsl x1, x1, x2 |
| 17 | lsr x3, x0, x3 |
| 18 | lsl x2, x0, x2 |
| 19 | orr x1, x1, x3 |
| 20 | mov x0, x2 |
| 21 | 1: |
| 22 | ret |
| 23 | 2: |
| 24 | neg w1, w3 |
| 25 | mov x2, #0 |
| 26 | lsl x1, x0, x1 |
| 27 | mov x0, x2 |
| 28 | ret |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 29 | SYM_FUNC_END(__ashlti3) |
Mark Rutland | abb77f3 | 2018-12-07 18:08:17 +0000 | [diff] [blame] | 30 | EXPORT_SYMBOL(__ashlti3) |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 31 | |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 32 | SYM_FUNC_START(__ashrti3) |
Jason A. Donenfeld | f5ed22e | 2017-11-07 11:24:04 +0900 | [diff] [blame] | 33 | cbz x2, 1f |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 34 | mov x3, #64 |
| 35 | sub x3, x3, x2 |
| 36 | cmp x3, #0 |
Jason A. Donenfeld | f5ed22e | 2017-11-07 11:24:04 +0900 | [diff] [blame] | 37 | b.le 2f |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 38 | lsr x0, x0, x2 |
| 39 | lsl x3, x1, x3 |
| 40 | asr x2, x1, x2 |
| 41 | orr x0, x0, x3 |
| 42 | mov x1, x2 |
Jason A. Donenfeld | f5ed22e | 2017-11-07 11:24:04 +0900 | [diff] [blame] | 43 | 1: |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 44 | ret |
Jason A. Donenfeld | f5ed22e | 2017-11-07 11:24:04 +0900 | [diff] [blame] | 45 | 2: |
Jason A. Donenfeld | fb87227 | 2017-11-03 15:18:58 +0100 | [diff] [blame] | 46 | neg w0, w3 |
| 47 | asr x2, x1, #63 |
| 48 | asr x0, x1, x0 |
| 49 | mov x1, x2 |
| 50 | ret |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 51 | SYM_FUNC_END(__ashrti3) |
Mark Rutland | abb77f3 | 2018-12-07 18:08:17 +0000 | [diff] [blame] | 52 | EXPORT_SYMBOL(__ashrti3) |
Jason A. Donenfeld | 9bfe755 | 2017-11-07 01:49:54 +0000 | [diff] [blame] | 53 | |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 54 | SYM_FUNC_START(__lshrti3) |
Jason A. Donenfeld | 9bfe755 | 2017-11-07 01:49:54 +0000 | [diff] [blame] | 55 | cbz x2, 1f |
| 56 | mov x3, #64 |
| 57 | sub x3, x3, x2 |
| 58 | cmp x3, #0 |
| 59 | b.le 2f |
| 60 | lsr x0, x0, x2 |
| 61 | lsl x3, x1, x3 |
| 62 | lsr x2, x1, x2 |
| 63 | orr x0, x0, x3 |
| 64 | mov x1, x2 |
| 65 | 1: |
| 66 | ret |
| 67 | 2: |
| 68 | neg w0, w3 |
| 69 | mov x2, #0 |
| 70 | lsr x0, x1, x0 |
| 71 | mov x1, x2 |
| 72 | ret |
Mark Brown | 3ac0f45 | 2020-01-06 19:58:17 +0000 | [diff] [blame] | 73 | SYM_FUNC_END(__lshrti3) |
Mark Rutland | abb77f3 | 2018-12-07 18:08:17 +0000 | [diff] [blame] | 74 | EXPORT_SYMBOL(__lshrti3) |