aboutsummaryrefslogtreecommitdiff
path: root/test/MC/AMDGPU/sop1.s
blob: c1fe7d013e6cefca4d611a03ed050fc1aaacbc67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
// RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI %s
// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI %s
// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s

s_mov_b32 s1, s2
// SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
// VI:   s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe]

s_mov_b32 s1, 1
// SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
// VI:   s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe]

s_mov_b32 s1, 100
// SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
// VI:   s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00]

// Literal constant sign bit
s_mov_b32 s1, 0x80000000
// SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
// VI:   s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80]

// Negative 32-bit constant
s_mov_b32 s0, 0xfe5163ab
// SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
// VI:   s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe]

s_mov_b64 s[2:3], s[4:5]
// SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
// VI:   s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe]

s_mov_b64 s[2:3], 0xffffffffffffffff
// SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
// VI:   s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe]

s_mov_b64 s[2:3], 0xffffffff
// SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
// VI:   s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff]

s_mov_b64 s[0:1], 0x80000000
// SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
// VI:   s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80]

s_mov_b64 s[102:103], -1
// SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
// NOVI: error: not a valid operand

s_cmov_b32 s1, 200
// SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
// VI:   s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00]

s_cmov_b32 s1, 1.0
// SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
// VI:   s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe]

s_cmov_b32 s1, s2
// SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
// VI:   s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe]

//s_cmov_b64 s[2:3], 1.0
//GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]

s_cmov_b64 s[2:3], s[4:5]
// SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
// VI:   s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe]

s_not_b32 s1, s2
// SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
// VI:   s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe]

s_not_b64 s[2:3], s[4:5]
// SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
// VI:   s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe]

s_wqm_b32 s1, s2
// SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
// VI:   s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe]

s_wqm_b64 s[2:3], s[4:5]
// SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
// VI:   s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe]

s_brev_b32 s1, s2
// SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
// VI:   s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe]

s_brev_b64 s[2:3], s[4:5]
// SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
// VI:   s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe]

s_bcnt0_i32_b32 s1, s2
// SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
// VI:   s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe]

s_bcnt0_i32_b64 s1, s[2:3]
// SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
// VI:   s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe]

s_bcnt1_i32_b32 s1, s2
// SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
// VI:   s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe]

s_bcnt1_i32_b64 s1, s[2:3]
// SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
// VI:   s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe]

s_ff0_i32_b32 s1, s2
// SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
// VI:   s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe]

s_ff0_i32_b64 s1, s[2:3]
// SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
// VI:   s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe]

s_ff1_i32_b32 s1, s2
// SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
// VI:   s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe]

s_ff1_i32_b64 s1, s[2:3]
// SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
// VI:   s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe]

s_flbit_i32_b32 s1, s2
// SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
// VI:   s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe]

s_flbit_i32_b64 s1, s[2:3]
// SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
// VI:   s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe]

s_flbit_i32 s1, s2
// SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
// VI:   s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe]

s_flbit_i32_i64 s1, s[2:3]
// SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
// VI:   s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe]

s_sext_i32_i8 s1, s2
// SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
// VI:   s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe]

s_sext_i32_i16 s1, s2
// SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
// VI:   s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]

s_bitset0_b32 s1, s2
// SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
// VI:   s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe]

s_bitset0_b64 s[2:3], s4
// SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
// VI:   s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe]

s_bitset1_b32 s1, s2
// SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
// VI:   s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]

s_bitset1_b64 s[2:3], s4
// SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
// VI:   s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe]

s_getpc_b64 s[2:3]
// SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
// VI:   s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe]

s_setpc_b64 s[4:5]
// SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
// VI:   s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe]

s_swappc_b64 s[2:3], s[4:5]
// SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
// VI:   s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]

s_rfe_b64 s[4:5]
// SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
// VI:   s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe]

s_and_saveexec_b64 s[2:3], s[4:5]
// SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
// VI:   s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]

s_or_saveexec_b64 s[2:3], s[4:5]
// SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
// VI:   s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]

s_xor_saveexec_b64 s[2:3], s[4:5]
// SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
// VI:   s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]

s_andn2_saveexec_b64 s[2:3], s[4:5]
// SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
// VI:   s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe]

s_orn2_saveexec_b64 s[2:3], s[4:5]
// SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
// VI:   s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]

s_nand_saveexec_b64 s[2:3], s[4:5]
// SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
// VI:   s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]

s_nor_saveexec_b64 s[2:3], s[4:5]
// SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
// VI:   s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]

s_xnor_saveexec_b64 s[2:3], s[4:5]
// SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
// VI:   s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]

s_quadmask_b32 s1, s2
// SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
// VI:   s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe]

s_quadmask_b64 s[2:3], s[4:5]
// SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
// VI:   s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]

s_movrels_b32 s1, s2
// SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
// VI:   s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe]

s_movrels_b64 s[2:3], s[4:5]
// SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
// VI:   s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]

s_movreld_b32 s1, s2
// SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
// VI:   s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]

s_movreld_b64 s[2:3], s[4:5]
// SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
// VI:   s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]

s_cbranch_join s4
// SICI: s_cbranch_join s4 ; encoding: [0x04,0x32,0x80,0xbe]
// VI:   s_cbranch_join s4 ; encoding: [0x04,0x2e,0x80,0xbe]

s_cbranch_join 1
// NOSICI: error: invalid operand for instruction
// NOVI: error: invalid operand for instruction

s_cbranch_join 100
// NOSICI: error: invalid operand for instruction
// NOVI: error: invalid operand for instruction

s_abs_i32 s1, s2
// SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
// VI:   s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]

s_mov_fed_b32 s1, s2
// SICI: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]

s_set_gpr_idx_idx s0
// VI: s_set_gpr_idx_idx s0 ; encoding: [0x00,0x32,0x80,0xbe]
// NOSICI: error: instruction not supported on this GPU