1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+a -riscv-no-aliases \
2 # RUN: | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
3 # RUN: llvm-mc %s -triple=riscv32 -mattr=+a \
4 # RUN: | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
5 # RUN: llvm-mc %s -triple=riscv64 -mattr=+a -riscv-no-aliases\
6 # RUN: | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
7 # RUN: llvm-mc %s -triple=riscv64 -mattr=+a \
8 # RUN: | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
9 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
10 # RUN: | llvm-objdump -d --mattr=+a -M no-aliases - \
11 # RUN: | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
12 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
13 # RUN: | llvm-objdump -d --mattr=+a - \
14 # RUN: | FileCheck --check-prefix=CHECK-S-OBJ %s
15 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
16 # RUN: | llvm-objdump -d --mattr=+a -M no-aliases - \
17 # RUN: | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
18 # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
19 # RUN: | llvm-objdump -d --mattr=+a - \
20 # RUN: | FileCheck --check-prefix=CHECK-S-OBJ %s
22 # The following check prefixes are used in this test:
23 # CHECK-S Match the .s output with aliases enabled
24 # CHECK-S-NOALIAS Match the .s output with aliases disabled
25 # CHECK-OBJ Match the objdumped object output with aliases enabled
26 # CHECK-OBJ-NOALIAS Match the objdumped object output with aliases enabled
27 # CHECK-S-OBJ Match both the .s and objdumped object output with
29 # CHECK-S-OBJ-NOALIAS Match both the .s and objdumped object output with
32 # The below tests for lr.w, sc.w and amo*.w, using `0(reg)` are actually
33 # implemented using a custom parser, but we test them as if they're aliases.
35 # CHECK-S-NOALIAS: {{^}}
36 # CHECK-OBJ-NOALIAS: {{^}}
38 # CHECK-S-OBJ: lr.w a1, (a0)
39 # CHECK-S-OBJ-NOALIAS: lr.w a1, (a0)
42 # CHECK-S-OBJ: lr.w.aq a1, (a0)
43 # CHECK-S-OBJ-NOALIAS: lr.w.aq a1, (a0)
46 # CHECK-S-OBJ: lr.w.rl a1, (a0)
47 # CHECK-S-OBJ-NOALIAS: lr.w.rl a1, (a0)
50 # CHECK-S-OBJ: lr.w.aqrl a1, (a0)
51 # CHECK-S-OBJ-NOALIAS: lr.w.aqrl a1, (a0)
54 # CHECK-S-OBJ: sc.w a2, a1, (a0)
55 # CHECK-S-OBJ-NOALIAS: sc.w a2, a1, (a0)
58 # CHECK-S-OBJ: sc.w.aq a2, a1, (a0)
59 # CHECK-S-OBJ-NOALIAS: sc.w.aq a2, a1, (a0)
62 # CHECK-S-OBJ: sc.w.rl a2, a1, (a0)
63 # CHECK-S-OBJ-NOALIAS: sc.w.rl a2, a1, (a0)
66 # CHECK-S-OBJ: sc.w.aqrl a2, a1, (a0)
67 # CHECK-S-OBJ-NOALIAS: sc.w.aqrl a2, a1, (a0)
68 sc.w.aqrl a2
, a1
, 0(a0
)
70 # CHECK-S-OBJ: amoswap.w a2, a1, (a0)
71 # CHECK-S-OBJ-NOALIAS: amoswap.w a2, a1, (a0)
72 amoswap.w a2
, a1
, 0(a0
)
74 # CHECK-S-OBJ: amoswap.w.aq a2, a1, (a0)
75 # CHECK-S-OBJ-NOALIAS: amoswap.w.aq a2, a1, (a0)
76 amoswap.w.aq a2
, a1
, 0(a0
)
78 # CHECK-S-OBJ: amoswap.w.rl a2, a1, (a0)
79 # CHECK-S-OBJ-NOALIAS: amoswap.w.rl a2, a1, (a0)
80 amoswap.w.rl a2
, a1
, 0(a0
)
82 # CHECK-S-OBJ: amoswap.w.aqrl a2, a1, (a0)
83 # CHECK-S-OBJ-NOALIAS: amoswap.w.aqrl a2, a1, (a0)
84 amoswap.w.aqrl a2
, a1
, 0(a0
)
86 # CHECK-S-OBJ: amoadd.w a2, a1, (a0)
87 # CHECK-S-OBJ-NOALIAS: amoadd.w a2, a1, (a0)
88 amoadd.w a2
, a1
, 0(a0
)
90 # CHECK-S-OBJ: amoadd.w.aq a2, a1, (a0)
91 # CHECK-S-OBJ-NOALIAS: amoadd.w.aq a2, a1, (a0)
92 amoadd.w.aq a2
, a1
, 0(a0
)
94 # CHECK-S-OBJ: amoadd.w.rl a2, a1, (a0)
95 # CHECK-S-OBJ-NOALIAS: amoadd.w.rl a2, a1, (a0)
96 amoadd.w.rl a2
, a1
, 0(a0
)
98 # CHECK-S-OBJ: amoadd.w.aqrl a2, a1, (a0)
99 # CHECK-S-OBJ-NOALIAS: amoadd.w.aqrl a2, a1, (a0)
100 amoadd.w.aqrl a2
, a1
, 0(a0
)
102 # CHECK-S-OBJ: amoxor.w a2, a1, (a0)
103 # CHECK-S-OBJ-NOALIAS: amoxor.w a2, a1, (a0)
104 amoxor.w a2
, a1
, 0(a0
)
106 # CHECK-S-OBJ: amoxor.w.aq a2, a1, (a0)
107 # CHECK-S-OBJ-NOALIAS: amoxor.w.aq a2, a1, (a0)
108 amoxor.w.aq a2
, a1
, 0(a0
)
110 # CHECK-S-OBJ: amoxor.w.rl a2, a1, (a0)
111 # CHECK-S-OBJ-NOALIAS: amoxor.w.rl a2, a1, (a0)
112 amoxor.w.rl a2
, a1
, 0(a0
)
114 # CHECK-S-OBJ: amoxor.w.aqrl a2, a1, (a0)
115 # CHECK-S-OBJ-NOALIAS: amoxor.w.aqrl a2, a1, (a0)
116 amoxor.w.aqrl a2
, a1
, 0(a0
)
118 # CHECK-S-OBJ: amoand.w a2, a1, (a0)
119 # CHECK-S-OBJ-NOALIAS: amoand.w a2, a1, (a0)
120 amoand.w a2
, a1
, 0(a0
)
122 # CHECK-S-OBJ: amoand.w.aq a2, a1, (a0)
123 # CHECK-S-OBJ-NOALIAS: amoand.w.aq a2, a1, (a0)
124 amoand.w.aq a2
, a1
, 0(a0
)
126 # CHECK-S-OBJ: amoand.w.rl a2, a1, (a0)
127 # CHECK-S-OBJ-NOALIAS: amoand.w.rl a2, a1, (a0)
128 amoand.w.rl a2
, a1
, 0(a0
)
130 # CHECK-S-OBJ: amoand.w.aqrl a2, a1, (a0)
131 # CHECK-S-OBJ-NOALIAS: amoand.w.aqrl a2, a1, (a0)
132 amoand.w.aqrl a2
, a1
, 0(a0
)
134 # CHECK-S-OBJ: amoor.w a2, a1, (a0)
135 # CHECK-S-OBJ-NOALIAS: amoor.w a2, a1, (a0)
136 amoor.w a2
, a1
, 0(a0
)
138 # CHECK-S-OBJ: amoor.w.aq a2, a1, (a0)
139 # CHECK-S-OBJ-NOALIAS: amoor.w.aq a2, a1, (a0)
140 amoor.w.aq a2
, a1
, 0(a0
)
142 # CHECK-S-OBJ: amoor.w.rl a2, a1, (a0)
143 # CHECK-S-OBJ-NOALIAS: amoor.w.rl a2, a1, (a0)
144 amoor.w.rl a2
, a1
, 0(a0
)
146 # CHECK-S-OBJ: amoor.w.aqrl a2, a1, (a0)
147 # CHECK-S-OBJ-NOALIAS: amoor.w.aqrl a2, a1, (a0)
148 amoor.w.aqrl a2
, a1
, 0(a0
)
150 # CHECK-S-OBJ: amomin.w a2, a1, (a0)
151 # CHECK-S-OBJ-NOALIAS: amomin.w a2, a1, (a0)
152 amomin.w a2
, a1
, 0(a0
)
154 # CHECK-S-OBJ: amomin.w.aq a2, a1, (a0)
155 # CHECK-S-OBJ-NOALIAS: amomin.w.aq a2, a1, (a0)
156 amomin.w.aq a2
, a1
, 0(a0
)
158 # CHECK-S-OBJ: amomin.w.rl a2, a1, (a0)
159 # CHECK-S-OBJ-NOALIAS: amomin.w.rl a2, a1, (a0)
160 amomin.w.rl a2
, a1
, 0(a0
)
162 # CHECK-S-OBJ: amomin.w.aqrl a2, a1, (a0)
163 # CHECK-S-OBJ-NOALIAS: amomin.w.aqrl a2, a1, (a0)
164 amomin.w.aqrl a2
, a1
, 0(a0
)
166 # CHECK-S-OBJ: amomax.w a2, a1, (a0)
167 # CHECK-S-OBJ-NOALIAS: amomax.w a2, a1, (a0)
168 amomax.w a2
, a1
, 0(a0
)
170 # CHECK-S-OBJ: amomax.w.aq a2, a1, (a0)
171 # CHECK-S-OBJ-NOALIAS: amomax.w.aq a2, a1, (a0)
172 amomax.w.aq a2
, a1
, 0(a0
)
174 # CHECK-S-OBJ: amomax.w.rl a2, a1, (a0)
175 # CHECK-S-OBJ-NOALIAS: amomax.w.rl a2, a1, (a0)
176 amomax.w.rl a2
, a1
, 0(a0
)
178 # CHECK-S-OBJ: amomax.w.aqrl a2, a1, (a0)
179 # CHECK-S-OBJ-NOALIAS: amomax.w.aqrl a2, a1, (a0)
180 amomax.w.aqrl a2
, a1
, 0(a0
)
182 # CHECK-S-OBJ: amominu.w a2, a1, (a0)
183 # CHECK-S-OBJ-NOALIAS: amominu.w a2, a1, (a0)
184 amominu.w a2
, a1
, 0(a0
)
186 # CHECK-S-OBJ: amominu.w.aq a2, a1, (a0)
187 # CHECK-S-OBJ-NOALIAS: amominu.w.aq a2, a1, (a0)
188 amominu.w.aq a2
, a1
, 0(a0
)
190 # CHECK-S-OBJ: amominu.w.rl a2, a1, (a0)
191 # CHECK-S-OBJ-NOALIAS: amominu.w.rl a2, a1, (a0)
192 amominu.w.rl a2
, a1
, 0(a0
)
194 # CHECK-S-OBJ: amominu.w.aqrl a2, a1, (a0)
195 # CHECK-S-OBJ-NOALIAS: amominu.w.aqrl a2, a1, (a0)
196 amominu.w.aqrl a2
, a1
, 0(a0
)
198 # CHECK-S-OBJ: amomaxu.w a2, a1, (a0)
199 # CHECK-S-OBJ-NOALIAS: amomaxu.w a2, a1, (a0)
200 amomaxu.w a2
, a1
, 0(a0
)
202 # CHECK-S-OBJ: amomaxu.w.aq a2, a1, (a0)
203 # CHECK-S-OBJ-NOALIAS: amomaxu.w.aq a2, a1, (a0)
204 amomaxu.w.aq a2
, a1
, 0(a0
)
206 # CHECK-S-OBJ: amomaxu.w.rl a2, a1, (a0)
207 # CHECK-S-OBJ-NOALIAS: amomaxu.w.rl a2, a1, (a0)
208 amomaxu.w.rl a2
, a1
, 0(a0
)
210 # CHECK-S-OBJ: amomaxu.w.aqrl a2, a1, (a0)
211 # CHECK-S-OBJ-NOALIAS: amomaxu.w.aqrl a2, a1, (a0)
212 amomaxu.w.aqrl a2
, a1
, 0(a0
)