Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
0002  *
0003  * Copyright (C) 2017-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
0004  */
0005 
0006 #include <linux/linkage.h>
0007 
0008 #include <asm/assembler.h>
0009 
0010 SYM_FUNC_START(__ashlti3)
0011     cbz x2, 1f
0012     mov x3, #64
0013     sub x3, x3, x2
0014     cmp x3, #0
0015     b.le    2f
0016     lsl x1, x1, x2
0017     lsr x3, x0, x3
0018     lsl x2, x0, x2
0019     orr x1, x1, x3
0020     mov x0, x2
0021 1:
0022     ret
0023 2:
0024     neg w1, w3
0025     mov x2, #0
0026     lsl x1, x0, x1
0027     mov x0, x2
0028     ret
0029 SYM_FUNC_END(__ashlti3)
0030 EXPORT_SYMBOL(__ashlti3)
0031 
0032 SYM_FUNC_START(__ashrti3)
0033     cbz x2, 1f
0034     mov x3, #64
0035     sub x3, x3, x2
0036     cmp x3, #0
0037     b.le    2f
0038     lsr x0, x0, x2
0039     lsl x3, x1, x3
0040     asr x2, x1, x2
0041     orr x0, x0, x3
0042     mov x1, x2
0043 1:
0044     ret
0045 2:
0046     neg w0, w3
0047     asr x2, x1, #63
0048     asr x0, x1, x0
0049     mov x1, x2
0050     ret
0051 SYM_FUNC_END(__ashrti3)
0052 EXPORT_SYMBOL(__ashrti3)
0053 
0054 SYM_FUNC_START(__lshrti3)
0055     cbz x2, 1f
0056     mov x3, #64
0057     sub x3, x3, x2
0058     cmp x3, #0
0059     b.le    2f
0060     lsr x0, x0, x2
0061     lsl x3, x1, x3
0062     lsr x2, x1, x2
0063     orr x0, x0, x3
0064     mov x1, x2
0065 1:
0066     ret
0067 2:
0068     neg w0, w3
0069     mov x2, #0
0070     lsr x0, x1, x0
0071     mov x1, x2
0072     ret
0073 SYM_FUNC_END(__lshrti3)
0074 EXPORT_SYMBOL(__lshrti3)