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