1// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
2// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
3
4s_mov_b32 s1, s2
5// CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
6
7s_mov_b32 s1, 1
8// CHECK: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
9
10s_mov_b32 s1, 100
11// CHECK: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
12
13s_mov_b64 s[2:3], s[4:5]
14// CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
15
16s_mov_b64 s[2:3], 0xffffffffffffffff
17// CHECK: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
18
19s_cmov_b32 s1, 200
20// CHECK: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
21
22s_cmov_b32 s1, 1.0
23// CHECK: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
24
25//s_cmov_b64 s[2:3], 1.0
26//CHECK-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
27
28//===----------------------------------------------------------------------===//
29// Instructions
30//===----------------------------------------------------------------------===//
31
32s_mov_b32 s1, s2
33// CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
34
35s_mov_b64 s[2:3], s[4:5]
36// CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
37
38s_cmov_b32 s1, s2
39// CHECK: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
40
41s_cmov_b64 s[2:3], s[4:5]
42// CHECK: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
43
44s_not_b32 s1, s2
45// CHECK: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
46
47s_not_b64 s[2:3], s[4:5]
48// CHECK: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
49
50s_wqm_b32 s1, s2
51// CHECK: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
52
53s_wqm_b64 s[2:3], s[4:5]
54// CHECK: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
55
56s_brev_b32 s1, s2
57// CHECK: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
58
59s_brev_b64 s[2:3], s[4:5]
60// CHECK: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
61
62s_bcnt0_i32_b32 s1, s2
63// CHECK: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
64
65s_bcnt0_i32_b64 s1, s[2:3]
66// CHECK: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
67
68s_bcnt1_i32_b32 s1, s2
69// CHECK: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
70
71s_bcnt1_i32_b64 s1, s[2:3]
72// CHECK: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
73
74s_ff0_i32_b32 s1, s2
75// CHECK: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
76
77s_ff0_i32_b64 s1, s[2:3]
78// CHECK: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
79
80s_ff1_i32_b32 s1, s2
81// CHECK: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
82
83s_ff1_i32_b64 s1, s[2:3]
84// CHECK: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
85
86s_flbit_i32_b32 s1, s2
87// CHECK: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
88
89s_flbit_i32_b64 s1, s[2:3]
90// CHECK: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
91
92s_flbit_i32 s1, s2
93// CHECK: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
94
95s_flbit_i32_i64 s1, s[2:3]
96// CHECK: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
97
98s_sext_i32_i8 s1, s2
99// CHECK: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
100
101s_sext_i32_i16 s1, s2
102// CHECK: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
103
104s_bitset0_b32 s1, s2
105// CHECK: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
106
107s_bitset0_b64 s[2:3], s[4:5]
108// CHECK: s_bitset0_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1c,0x82,0xbe]
109
110s_bitset1_b32 s1, s2
111// CHECK: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
112
113s_bitset1_b64 s[2:3], s[4:5]
114// CHECK: s_bitset1_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]
115
116s_getpc_b64 s[2:3]
117// CHECK: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
118
119s_setpc_b64 s[2:3], s[4:5]
120// CHECK: s_setpc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]
121
122s_swappc_b64 s[2:3], s[4:5]
123// CHECK: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
124
125s_rfe_b64 s[2:3], s[4:5]
126// CHECK: s_rfe_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]
127
128s_and_saveexec_b64 s[2:3], s[4:5]
129// CHECK: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
130
131s_or_saveexec_b64 s[2:3], s[4:5]
132// CHECK: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
133
134s_xor_saveexec_b64 s[2:3], s[4:5]
135// CHECK: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
136
137s_andn2_saveexec_b64 s[2:3], s[4:5]
138// CHECK: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
139
140s_orn2_saveexec_b64 s[2:3], s[4:5]
141// CHECK: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
142
143s_nand_saveexec_b64 s[2:3], s[4:5]
144// CHECK: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
145
146s_nor_saveexec_b64 s[2:3], s[4:5]
147// CHECK: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
148
149s_xnor_saveexec_b64 s[2:3], s[4:5]
150// CHECK: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
151
152s_quadmask_b32 s1, s2
153// CHECK: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
154
155s_quadmask_b64 s[2:3], s[4:5]
156// CHECK: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
157
158s_movrels_b32 s1, s2
159// CHECK: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
160
161s_movrels_b64 s[2:3], s[4:5]
162// CHECK: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
163
164s_movreld_b32 s1, s2
165// CHECK: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
166
167s_movreld_b64 s[2:3], s[4:5]
168// CHECK: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
169
170s_cbranch_join s[4:5]
171// CHECK: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
172
173s_abs_i32 s1, s2
174// CHECK: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
175
176s_mov_fed_b32 s1, s2
177// CHECK: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
178