xref: /arch/loongarch/lib/tishift.S
  • Home
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • current directory
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <asm/asmmacro.h>
4#include <linux/export.h>
5#include <linux/linkage.h>
6
7SYM_FUNC_START(__ashlti3)
8	srli.d	t2, a0, 1
9	nor	t3, zero, a2
10	sll.d	t1, a1, a2
11	srl.d	t2, t2, t3
12	andi	t0, a2, 64
13	sll.d	a0, a0, a2
14	or	t1, t2, t1
15	maskeqz	a1, a0, t0
16	masknez	a0, a0, t0
17	masknez	t0, t1, t0
18	or	a1, t0, a1
19	jr	ra
20SYM_FUNC_END(__ashlti3)
21EXPORT_SYMBOL(__ashlti3)
22
23SYM_FUNC_START(__ashrti3)
24	nor	t3, zero, a2
25	slli.d	t2, a1, 1
26	srl.d	t1, a0, a2
27	sll.d	t2, t2, t3
28	andi	t0, a2, 64
29	or	t1, t2, t1
30	sra.d	a2, a1, a2
31	srai.d	a1, a1, 63
32	maskeqz	a0, a2, t0
33	maskeqz	a1, a1, t0
34	masknez	a2, a2, t0
35	masknez	t0, t1, t0
36	or	a1, a1, a2
37	or	a0, t0, a0
38	jr	ra
39SYM_FUNC_END(__ashrti3)
40EXPORT_SYMBOL(__ashrti3)
41
42SYM_FUNC_START(__lshrti3)
43	slli.d	t2, a1, 1
44	nor	t3, zero, a2
45	srl.d	t1, a0, a2
46	sll.d	t2, t2, t3
47	andi	t0, a2, 64
48	srl.d	a1, a1, a2
49	or	t1, t2, t1
50	maskeqz	a0, a1, t0
51	masknez	a1, a1, t0
52	masknez	t0, t1, t0
53	or	a0, t0, a0
54	jr	ra
55SYM_FUNC_END(__lshrti3)
56EXPORT_SYMBOL(__lshrti3)
57

Last Index update Fri Aug 22 10:33:58 CST 2025