1# RUN: llvm-mc %s -triple=riscv32 -mattr=+a -riscv-no-aliases -show-encoding \
2# RUN:     | FileCheck -check-prefixes=CHECK,CHECK-INST %s
3# RUN: llvm-mc %s -triple=riscv64 -mattr=+a -riscv-no-aliases -show-encoding \
4# RUN:     | FileCheck -check-prefixes=CHECK,CHECK-INST %s
5# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
6# RUN:     | llvm-objdump -mattr=+a -riscv-no-aliases -d - \
7# RUN:     | FileCheck -check-prefix=CHECK-INST %s
8# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
9# RUN:     | llvm-objdump -mattr=+a -riscv-no-aliases -d - \
10# RUN:     | FileCheck -check-prefix=CHECK-INST %s
11
12# CHECK-INST: lr.w t0, (t1)
13# CHECK: encoding: [0xaf,0x22,0x03,0x10]
14lr.w t0, (t1)
15# CHECK-INST: lr.w.aq t1, (t2)
16# CHECK: encoding: [0x2f,0xa3,0x03,0x14]
17lr.w.aq t1, (t2)
18# CHECK-INST: lr.w.rl t2, (t3)
19# CHECK: encoding: [0xaf,0x23,0x0e,0x12]
20lr.w.rl t2, (t3)
21# CHECK-INST: lr.w.aqrl t3, (t4)
22# CHECK: encoding: [0x2f,0xae,0x0e,0x16]
23lr.w.aqrl t3, (t4)
24
25# CHECK-INST: sc.w t6, t5, (t4)
26# CHECK: encoding: [0xaf,0xaf,0xee,0x19]
27sc.w t6, t5, (t4)
28# CHECK-INST: sc.w.aq t5, t4, (t3)
29# CHECK: encoding: [0x2f,0x2f,0xde,0x1d]
30sc.w.aq t5, t4, (t3)
31# CHECK-INST: sc.w.rl t4, t3, (t2)
32# CHECK: encoding: [0xaf,0xae,0xc3,0x1b]
33sc.w.rl t4, t3, (t2)
34# CHECK-INST: sc.w.aqrl t3, t2, (t1)
35# CHECK: encoding: [0x2f,0x2e,0x73,0x1e]
36sc.w.aqrl t3, t2, (t1)
37
38# CHECK-INST: amoswap.w a4, ra, (s0)
39# CHECK: encoding: [0x2f,0x27,0x14,0x08]
40amoswap.w a4, ra, (s0)
41# CHECK-INST: amoadd.w a1, a2, (a3)
42# CHECK: encoding: [0xaf,0xa5,0xc6,0x00]
43amoadd.w a1, a2, (a3)
44# CHECK-INST: amoxor.w a2, a3, (a4)
45# CHECK: encoding: [0x2f,0x26,0xd7,0x20]
46amoxor.w a2, a3, (a4)
47# CHECK-INST: amoand.w a3, a4, (a5)
48# CHECK: encoding: [0xaf,0xa6,0xe7,0x60]
49amoand.w a3, a4, (a5)
50# CHECK-INST: amoor.w a4, a5, (a6)
51# CHECK: encoding: [0x2f,0x27,0xf8,0x40]
52amoor.w a4, a5, (a6)
53# CHECK-INST: amomin.w a5, a6, (a7)
54# CHECK: encoding: [0xaf,0xa7,0x08,0x81]
55amomin.w a5, a6, (a7)
56# CHECK-INST: amomax.w s7, s6, (s5)
57# CHECK: encoding: [0xaf,0xab,0x6a,0xa1]
58amomax.w s7, s6, (s5)
59# CHECK-INST: amominu.w s6, s5, (s4)
60# CHECK: encoding: [0x2f,0x2b,0x5a,0xc1]
61amominu.w s6, s5, (s4)
62# CHECK-INST: amomaxu.w s5, s4, (s3)
63# CHECK: encoding: [0xaf,0xaa,0x49,0xe1]
64amomaxu.w s5, s4, (s3)
65
66# CHECK-INST: amoswap.w.aq a4, ra, (s0)
67# CHECK: encoding: [0x2f,0x27,0x14,0x0c]
68amoswap.w.aq a4, ra, (s0)
69# CHECK-INST: amoadd.w.aq a1, a2, (a3)
70# CHECK: encoding: [0xaf,0xa5,0xc6,0x04]
71amoadd.w.aq a1, a2, (a3)
72# CHECK-INST: amoxor.w.aq a2, a3, (a4)
73# CHECK: encoding: [0x2f,0x26,0xd7,0x24]
74amoxor.w.aq a2, a3, (a4)
75# CHECK-INST: amoand.w.aq a3, a4, (a5)
76# CHECK: encoding: [0xaf,0xa6,0xe7,0x64]
77amoand.w.aq a3, a4, (a5)
78# CHECK-INST: amoor.w.aq a4, a5, (a6)
79# CHECK: encoding: [0x2f,0x27,0xf8,0x44]
80amoor.w.aq a4, a5, (a6)
81# CHECK-INST: amomin.w.aq a5, a6, (a7)
82# CHECK: encoding: [0xaf,0xa7,0x08,0x85]
83amomin.w.aq a5, a6, (a7)
84# CHECK-INST: amomax.w.aq s7, s6, (s5)
85# CHECK: encoding: [0xaf,0xab,0x6a,0xa5]
86amomax.w.aq s7, s6, (s5)
87# CHECK-INST: amominu.w.aq s6, s5, (s4)
88# CHECK: encoding: [0x2f,0x2b,0x5a,0xc5]
89amominu.w.aq s6, s5, (s4)
90# CHECK-INST: amomaxu.w.aq s5, s4, (s3)
91# CHECK: encoding: [0xaf,0xaa,0x49,0xe5]
92amomaxu.w.aq s5, s4, (s3)
93
94# CHECK-INST: amoswap.w.rl a4, ra, (s0)
95# CHECK: encoding: [0x2f,0x27,0x14,0x0a]
96amoswap.w.rl a4, ra, (s0)
97# CHECK-INST: amoadd.w.rl a1, a2, (a3)
98# CHECK: encoding: [0xaf,0xa5,0xc6,0x02]
99amoadd.w.rl a1, a2, (a3)
100# CHECK-INST: amoxor.w.rl a2, a3, (a4)
101# CHECK: encoding: [0x2f,0x26,0xd7,0x22]
102amoxor.w.rl a2, a3, (a4)
103# CHECK-INST: amoand.w.rl a3, a4, (a5)
104# CHECK: encoding: [0xaf,0xa6,0xe7,0x62]
105amoand.w.rl a3, a4, (a5)
106# CHECK-INST: amoor.w.rl a4, a5, (a6)
107# CHECK: encoding: [0x2f,0x27,0xf8,0x42]
108amoor.w.rl a4, a5, (a6)
109# CHECK-INST: amomin.w.rl a5, a6, (a7)
110# CHECK: encoding: [0xaf,0xa7,0x08,0x83]
111amomin.w.rl a5, a6, (a7)
112# CHECK-INST: amomax.w.rl s7, s6, (s5)
113# CHECK: encoding: [0xaf,0xab,0x6a,0xa3]
114amomax.w.rl s7, s6, (s5)
115# CHECK-INST: amominu.w.rl s6, s5, (s4)
116# CHECK: encoding: [0x2f,0x2b,0x5a,0xc3]
117amominu.w.rl s6, s5, (s4)
118# CHECK-INST: amomaxu.w.rl s5, s4, (s3)
119# CHECK: encoding: [0xaf,0xaa,0x49,0xe3]
120amomaxu.w.rl s5, s4, (s3)
121
122# CHECK-INST: amoswap.w.aqrl a4, ra, (s0)
123# CHECK: encoding: [0x2f,0x27,0x14,0x0e]
124amoswap.w.aqrl a4, ra, (s0)
125# CHECK-INST: amoadd.w.aqrl a1, a2, (a3)
126# CHECK: encoding: [0xaf,0xa5,0xc6,0x06]
127amoadd.w.aqrl a1, a2, (a3)
128# CHECK-INST: amoxor.w.aqrl a2, a3, (a4)
129# CHECK: encoding: [0x2f,0x26,0xd7,0x26]
130amoxor.w.aqrl a2, a3, (a4)
131# CHECK-INST: amoand.w.aqrl a3, a4, (a5)
132# CHECK: encoding: [0xaf,0xa6,0xe7,0x66]
133amoand.w.aqrl a3, a4, (a5)
134# CHECK-INST: amoor.w.aqrl a4, a5, (a6)
135# CHECK: encoding: [0x2f,0x27,0xf8,0x46]
136amoor.w.aqrl a4, a5, (a6)
137# CHECK-INST: amomin.w.aqrl a5, a6, (a7)
138# CHECK: encoding: [0xaf,0xa7,0x08,0x87]
139amomin.w.aqrl a5, a6, (a7)
140# CHECK-INST: amomax.w.aqrl s7, s6, (s5)
141# CHECK: encoding: [0xaf,0xab,0x6a,0xa7]
142amomax.w.aqrl s7, s6, (s5)
143# CHECK-INST: amominu.w.aqrl s6, s5, (s4)
144# CHECK: encoding: [0x2f,0x2b,0x5a,0xc7]
145amominu.w.aqrl s6, s5, (s4)
146# CHECK-INST: amomaxu.w.aqrl s5, s4, (s3)
147# CHECK: encoding: [0xaf,0xaa,0x49,0xe7]
148amomaxu.w.aqrl s5, s4, (s3)
149