1 # RUN: llvm-mc %s -triple=riscv64 -mattr=zcmp -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=zcmp < %s \
4 # RUN: | llvm-objdump --mattr=-c,zcmp -M no-aliases -d -r - \
5 # RUN: | FileCheck --check-prefixes=CHECK-ASM-AND-OBJ %s
7 # CHECK-ASM-AND-OBJ: cm.mvsa01 s1, s0
8 # CHECK-ASM: encoding: [0xa2,0xac]
11 # CHECK-ASM-AND-OBJ: cm.mva01s s1, s0
12 # CHECK-ASM: encoding: [0xe2,0xac]
15 # CHECK-ASM-AND-OBJ: cm.popret {ra}, 16
16 # CHECK-ASM: encoding: [0x42,0xbe]
19 # CHECK-ASM-AND-OBJ: cm.popret {ra}, 32
20 # CHECK-ASM: encoding: [0x46,0xbe]
23 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0}, 64
24 # CHECK-ASM: encoding: [0x5e,0xbe]
25 cm.popret
{ra
, s0
}, 64
27 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s1}, 32
28 # CHECK-ASM: encoding: [0x62,0xbe]
29 cm.popret
{ra
,s0-s1
}, 32
31 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s2}, 32
32 # CHECK-ASM: encoding: [0x72,0xbe]
33 cm.popret
{ra
, s0-s2
}, 32
35 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s3}, 64
36 # CHECK-ASM: encoding: [0x86,0xbe]
37 cm.popret
{ra
, s0-s3
}, 64
39 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s5}, 64
40 # CHECK-ASM: encoding: [0xa2,0xbe]
41 cm.popret
{ra
, s0-s5
}, 64
43 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s7}, 80
44 # CHECK-ASM: encoding: [0xc2,0xbe]
45 cm.popret
{ra
, s0-s7
}, 80
47 # CHECK-ASM-AND-OBJ: cm.popret {ra, s0-s11}, 112
48 # CHECK-ASM: encoding: [0xf2,0xbe]
49 cm.popret
{ra
, s0-s11
}, 112
51 # CHECK-ASM-AND-OBJ: cm.popretz {ra}, 16
52 # CHECK-ASM: encoding: [0x42,0xbc]
55 # CHECK-ASM-AND-OBJ: cm.popretz {ra}, 32
56 # CHECK-ASM: encoding: [0x46,0xbc]
59 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0}, 64
60 # CHECK-ASM: encoding: [0x5e,0xbc]
61 cm.popretz
{ra
, s0
}, 64
63 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s1}, 32
64 # CHECK-ASM: encoding: [0x62,0xbc]
65 cm.popretz
{ra
, s0-s1
}, 32
67 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s2}, 32
68 # CHECK-ASM: encoding: [0x72,0xbc]
69 cm.popretz
{ra
, s0-s2
}, 32
71 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s3}, 64
72 # CHECK-ASM: encoding: [0x86,0xbc]
73 cm.popretz
{ra
, s0-s3
}, 64
75 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s5}, 64
76 # CHECK-ASM: encoding: [0xa2,0xbc]
77 cm.popretz
{ra
, s0-s5
}, 64
79 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s7}, 80
80 # CHECK-ASM: encoding: [0xc2,0xbc]
81 cm.popretz
{ra
, s0-s7
}, 80
83 # CHECK-ASM-AND-OBJ: cm.popretz {ra, s0-s11}, 112
84 # CHECK-ASM: encoding: [0xf2,0xbc]
85 cm.popretz
{ra
, s0-s11
}, 112
87 # CHECK-ASM-AND-OBJ: cm.pop {ra}, 16
88 # CHECK-ASM: encoding: [0x42,0xba]
91 # CHECK-ASM-AND-OBJ: cm.pop {ra}, 32
92 # CHECK-ASM: encoding: [0x46,0xba]
95 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0}, 16
96 # CHECK-ASM: encoding: [0x52,0xba]
99 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0-s1}, 32
100 # CHECK-ASM: encoding: [0x62,0xba]
101 cm.pop
{ra
, s0-s1
}, 32
103 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0-s2}, 32
104 # CHECK-ASM: encoding: [0x72,0xba]
105 cm.pop
{ra
, s0-s2
}, 32
107 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0-s5}, 64
108 # CHECK-ASM: encoding: [0xa2,0xba]
109 cm.pop
{ra
, s0-s5
}, 64
111 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0-s7}, 80
112 # CHECK-ASM: encoding: [0xc2,0xba]
113 cm.pop
{ra
, s0-s7
}, 80
115 # CHECK-ASM-AND-OBJ: cm.pop {ra, s0-s11}, 112
116 # CHECK-ASM: encoding: [0xf2,0xba]
117 cm.pop
{ra
, s0-s11
}, 112
119 # CHECK-ASM-AND-OBJ: cm.push {ra}, -16
120 # CHECK-ASM: encoding: [0x42,0xb8]
123 # CHECK-ASM-AND-OBJ: cm.push {ra, s0}, -32
124 # CHECK-ASM: encoding: [0x56,0xb8]
125 cm.push
{ra
, s0
}, -32
127 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s1}, -32
128 # CHECK-ASM: encoding: [0x62,0xb8]
129 cm.push
{ra
, s0-s1
}, -32
131 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s3}, -64
132 # CHECK-ASM: encoding: [0x86,0xb8]
133 cm.push
{ra
, s0-s3
}, -64
135 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s7}, -80
136 # CHECK-ASM: encoding: [0xc2,0xb8]
137 cm.push
{ra
, s0-s7
}, -80
139 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s7}, -80
140 # CHECK-ASM: encoding: [0xc2,0xb8]
141 cm.push
{ra
, s0-s7
}, -80
143 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s11}, -112
144 # CHECK-ASM: encoding: [0xf2,0xb8]
145 cm.push
{ra
, s0-s11
}, -112
147 # CHECK-ASM-AND-OBJ: cm.push {ra, s0-s11}, -128
148 # CHECK-ASM: encoding: [0xf6,0xb8]
149 cm.push
{ra
, s0-s11
}, -128