1 # RUN: llvm-mc %s -triple=riscv64 -mattr=+zba -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
3 # RUN: llvm-mc %s -triple=riscv64 -mattr=+zba \
4 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
5 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zba < %s \
6 # RUN: | llvm-objdump -d -r -M no-aliases --mattr=+zba - \
7 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ-NOALIAS %s
8 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zba < %s \
9 # RUN: | llvm-objdump -d -r --mattr=+zba - \
10 # RUN: | FileCheck -check-prefixes=CHECK-S-OBJ %s
12 # The following check prefixes are used in this test:
13 # CHECK-S-OBJ Match both the .s and objdumped object output with
15 # CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
18 # CHECK-S-OBJ-NOALIAS: add.uw t0, t1, zero
19 # CHECK-S-OBJ: zext.w t0, t1
22 # CHECK-S-OBJ-NOALIAS: addi t1, zero, -2
23 # CHECK-S-OBJ-NOALIAS-NEXT: add.uw t1, t1, zero
24 # CHECK-S-OBJ: li t1, -2
25 # CHECK-S-OBJ-NEXT: zext.w t1, t1
28 # CHECK-S-OBJ-NOALIAS: lui t0, 768955
29 # CHECK-S-OBJ-NOALIAS-NEXT: slli.uw t0, t0, 12
30 # CHECK-S-OBJ-NOALIAS-NEXT: addi t0, t0, 1979
31 # CHECK-S-OBJ: lui t0, 768955
32 # CHECK-S-OBJ-NEXT: slli.uw t0, t0, 12
33 # CHECK-S-OBJ-NEXT: addi t0, t0, 1979
36 # CHECK-S-OBJ-NOALIAS: lui t0, 768955
37 # CHECK-S-OBJ-NOALIAS-NEXT: slli.uw t0, t0, 4
38 # CHECK-S-OBJ: lui t0, 768955
39 # CHECK-S-OBJ-NEXT: slli.uw t0, t0, 4
42 # CHECK-S-OBJ-NOALIAS: lui t1, 611378
43 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, 265
44 # CHECK-S-OBJ-NOALIAS-NEXT: sh1add t1, t1, t1
45 # CHECK-S-OBJ: lui t1, 611378
46 # CHECK-S-OBJ-NEXT: addiw t1, t1, 265
47 # CHECK-S-OBJ-NEXT: sh1add t1, t1, t1
50 # CHECK-S-OBJ-NOALIAS: lui t1, 437198
51 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, -265
52 # CHECK-S-OBJ-NOALIAS-NEXT: sh2add t1, t1, t1
53 # CHECK-S-OBJ: lui t1, 437198
54 # CHECK-S-OBJ-NEXT: addiw t1, t1, -265
55 # CHECK-S-OBJ-NEXT: sh2add t1, t1, t1
58 # CHECK-S-OBJ-NOALIAS: lui t1, 611378
59 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, 265
60 # CHECK-S-OBJ-NOALIAS-NEXT: sh2add t1, t1, t1
61 # CHECK-S-OBJ: lui t1, 611378
62 # CHECK-S-OBJ-NEXT: addiw t1, t1, 265
63 # CHECK-S-OBJ-NEXT: sh2add t1, t1, t1
66 # CHECK-S-OBJ-NOALIAS: lui t1, 437198
67 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, -265
68 # CHECK-S-OBJ-NOALIAS-NEXT: sh3add t1, t1, t1
69 # CHECK-S-OBJ: lui t1, 437198
70 # CHECK-S-OBJ-NEXT: addiw t1, t1, -265
71 # CHECK-S-OBJ-NEXT: sh3add t1, t1, t1
74 # CHECK-S-OBJ-NOALIAS: lui t1, 611378
75 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, 265
76 # CHECK-S-OBJ-NOALIAS-NEXT: sh3add t1, t1, t1
77 # CHECK-S-OBJ: lui t1, 611378
78 # CHECK-S-OBJ-NEXT: addiw t1, t1, 265
79 # CHECK-S-OBJ-NEXT: sh3add t1, t1, t1
82 # CHECK-S-OBJ-NOALIAS: lui t2, 768956
83 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t2, t2, -1093
84 # CHECK-S-OBJ-NOALIAS-NEXT: slli.uw t2, t2, 12
85 # CHECK-S-OBJ-NOALIAS-NEXT: addi t2, t2, 1911
86 # CHECK-S-OBJ: lui t2, 768956
87 # CHECK-S-OBJ-NEXT: addiw t2, t2, -1093
88 # CHECK-S-OBJ-NEXT: slli.uw t2, t2, 12
89 # CHECK-S-OBJ-NEXT: addi t2, t2, 1911
92 # CHECK-S-OBJ-NOALIAS: lui t1, 768955
93 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, 273
94 # CHECK-S-OBJ-NOALIAS-NEXT: slli.uw t1, t1, 12
95 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 273
96 # CHECK-S-OBJ: lui t1, 768955
97 # CHECK-S-OBJ-NEXT: addiw t1, t1, 273
98 # CHECK-S-OBJ-NEXT: slli.uw t1, t1, 12
99 # CHECK-S-OBJ-NEXT: addi t1, t1, 273
100 li x6
, 12900925247761
102 # CHECK-S-OBJ-NOALIAS: lui t1, 768955
103 # CHECK-S-OBJ-NOALIAS-NEXT: addiw t1, t1, -1365
104 # CHECK-S-OBJ-NOALIAS-NEXT: slli.uw t1, t1, 12
105 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, -1366
106 # CHECK-S-OBJ: lui t1, 768955
107 # CHECK-S-OBJ-NEXT: addiw t1, t1, -1365
108 # CHECK-S-OBJ-NEXT: slli.uw t1, t1, 12
109 # CHECK-S-OBJ-NEXT: addi t1, t1, -1366
110 li x6
, 12900918536874
112 # CHECK-S-OBJ-NOALIAS: lui t1, 349525
113 # CHECK-S-OBJ-NOALIAS-NEXT: sh2add t1, t1, t1
114 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 1
115 # CHECK-S-OBJ: lui t1, 349525
116 # CHECK-S-OBJ-NEXT: sh2add t1, t1, t1
117 # CHECK-S-OBJ-NEXT: addi t1, t1, 1
118 li x6
, 7158272001 # 0x0000_0001_aaaa_9001
120 # CHECK-S-OBJ-NOALIAS: lui t1, 349525
121 # CHECK-S-OBJ-NOALIAS-NEXT: sh3add t1, t1, t1
122 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 1
123 # CHECK-S-OBJ: lui t1, 349525
124 # CHECK-S-OBJ-NEXT: sh3add t1, t1, t1
125 # CHECK-S-OBJ-NEXT: addi t1, t1, 1
126 li x6
, 12884889601 # 0x0000_0002_ffff_d001
128 # CHECK-S-OBJ-NOALIAS: lui t1, 768955
129 # CHECK-S-OBJ-NOALIAS-NEXT: sh1add t1, t1, t1
130 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 1
131 # CHECK-S-OBJ: lui t1, 768955
132 # CHECK-S-OBJ-NEXT: sh1add t1, t1, t1
133 # CHECK-S-OBJ-NEXT: addi t1, t1, 1
134 li x6
, -3435982847 # 0xffff_ffff_3333_1001
136 # CHECK-S-OBJ-NOALIAS: lui t1, 768945
137 # CHECK-S-OBJ-NOALIAS-NEXT: sh2add t1, t1, t1
138 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 1
139 # CHECK-S-OBJ: lui t1, 768945
140 # CHECK-S-OBJ-NEXT: sh2add t1, t1, t1
141 # CHECK-S-OBJ-NEXT: addi t1, t1, 1
142 li x6
, -5726842879 # 0xffff_fffe_aaa7_5001
144 # CHECK-S-OBJ-NOALIAS: lui t1, 768955
145 # CHECK-S-OBJ-NOALIAS-NEXT: sh3add t1, t1, t1
146 # CHECK-S-OBJ-NOALIAS-NEXT: addi t1, t1, 1
147 # CHECK-S-OBJ: lui t1, 768955
148 # CHECK-S-OBJ-NEXT: sh3add t1, t1, t1
149 # CHECK-S-OBJ-NEXT: addi t1, t1, 1
150 li x6
, -10307948543 # 0xffff_fffd_9999_3001