llvm.org GIT mirror llvm / 956ea6a
[AMDGPU] Assembler: Update SOP* tests Add VI encodings. Reformat sopp.s to match style of other files. Differential Revision: http://reviews.llvm.org/D18084 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263540 91177308-0d34-0410-b5e6-96231b3b80d8 Nikolay Haustov 4 years ago
5 changed file(s) with 353 addition(s) and 206 deletion(s). Raw diff Collapse all Expand all
None // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
0 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI %s
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s
24
35 s_mov_b32 s1, s2
4 // CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
6 // SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
7 // VI: s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe]
58
69 s_mov_b32 s1, 1
7 // CHECK: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
10 // SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
11 // VI: s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe]
812
913 s_mov_b32 s1, 100
10 // CHECK: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
14 // SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
15 // VI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00]
1116
1217 // Literal constant sign bit
1318 s_mov_b32 s1, 0x80000000
14 // CHECK: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
19 // SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
20 // VI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80]
1521
1622 // Negative 32-bit constant
1723 s_mov_b32 s0, 0xfe5163ab
18 // CHECK: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
24 // SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
25 // VI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe]
1926
2027 s_mov_b64 s[2:3], s[4:5]
21 // CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
28 // SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
29 // VI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe]
2230
2331 s_mov_b64 s[2:3], 0xffffffffffffffff
24 // CHECK: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
32 // SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
33 // VI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe]
2534
2635 s_mov_b64 s[2:3], 0xffffffff
27 // CHECK: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
36 // SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
37 // VI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff]
2838
2939 s_mov_b64 s[0:1], 0x80000000
30 // CHECK: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
40 // SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
41 // VI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80]
3142
3243 s_mov_b64 s[102:103], -1
33 // CHECK: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
44 // SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
45 // NOVI: error: invalid operand for instruction
3446
3547 s_cmov_b32 s1, 200
36 // CHECK: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
48 // SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
49 // VI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00]
3750
3851 s_cmov_b32 s1, 1.0
39 // CHECK: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
52 // SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
53 // VI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe]
54
55 s_cmov_b32 s1, s2
56 // SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
57 // VI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe]
4058
4159 //s_cmov_b64 s[2:3], 1.0
42 //CHECK-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
43
44 //===----------------------------------------------------------------------===//
45 // Instructions
46 //===----------------------------------------------------------------------===//
47
48 s_mov_b32 s1, s2
49 // CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
50
51 s_mov_b64 s[2:3], s[4:5]
52 // CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
53
54 s_cmov_b32 s1, s2
55 // CHECK: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
60 //GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
5661
5762 s_cmov_b64 s[2:3], s[4:5]
58 // CHECK: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
63 // SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
64 // VI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe]
5965
6066 s_not_b32 s1, s2
61 // CHECK: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
67 // SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
68 // VI: s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe]
6269
6370 s_not_b64 s[2:3], s[4:5]
64 // CHECK: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
71 // SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
72 // VI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe]
6573
6674 s_wqm_b32 s1, s2
67 // CHECK: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
75 // SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
76 // VI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe]
6877
6978 s_wqm_b64 s[2:3], s[4:5]
70 // CHECK: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
79 // SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
80 // VI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe]
7181
7282 s_brev_b32 s1, s2
73 // CHECK: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
83 // SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
84 // VI: s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe]
7485
7586 s_brev_b64 s[2:3], s[4:5]
76 // CHECK: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
87 // SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
88 // VI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe]
7789
7890 s_bcnt0_i32_b32 s1, s2
79 // CHECK: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
91 // SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
92 // VI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe]
8093
8194 s_bcnt0_i32_b64 s1, s[2:3]
82 // CHECK: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
95 // SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
96 // VI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe]
8397
8498 s_bcnt1_i32_b32 s1, s2
85 // CHECK: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
99 // SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
100 // VI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe]
86101
87102 s_bcnt1_i32_b64 s1, s[2:3]
88 // CHECK: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
103 // SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
104 // VI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe]
89105
90106 s_ff0_i32_b32 s1, s2
91 // CHECK: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
107 // SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
108 // VI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe]
92109
93110 s_ff0_i32_b64 s1, s[2:3]
94 // CHECK: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
111 // SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
112 // VI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe]
95113
96114 s_ff1_i32_b32 s1, s2
97 // CHECK: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
115 // SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
116 // VI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe]
98117
99118 s_ff1_i32_b64 s1, s[2:3]
100 // CHECK: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
119 // SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
120 // VI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe]
101121
102122 s_flbit_i32_b32 s1, s2
103 // CHECK: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
123 // SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
124 // VI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe]
104125
105126 s_flbit_i32_b64 s1, s[2:3]
106 // CHECK: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
127 // SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
128 // VI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe]
107129
108130 s_flbit_i32 s1, s2
109 // CHECK: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
131 // SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
132 // VI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe]
110133
111134 s_flbit_i32_i64 s1, s[2:3]
112 // CHECK: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
135 // SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
136 // VI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe]
113137
114138 s_sext_i32_i8 s1, s2
115 // CHECK: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
139 // SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
140 // VI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe]
116141
117142 s_sext_i32_i16 s1, s2
118 // CHECK: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
143 // SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
144 // VI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
119145
120146 s_bitset0_b32 s1, s2
121 // CHECK: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
147 // SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
148 // VI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe]
122149
123150 s_bitset0_b64 s[2:3], s4
124 // CHECK: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
151 // SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
152 // VI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe]
125153
126154 s_bitset1_b32 s1, s2
127 // CHECK: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
155 // SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
156 // VI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
128157
129158 s_bitset1_b64 s[2:3], s4
130 // CHECK: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
159 // SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
160 // VI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe]
131161
132162 s_getpc_b64 s[2:3]
133 // CHECK: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
163 // SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
164 // VI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe]
134165
135166 s_setpc_b64 s[4:5]
136 // CHECK: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
167 // SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
168 // VI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe]
137169
138170 s_swappc_b64 s[2:3], s[4:5]
139 // CHECK: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
171 // SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
172 // VI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]
140173
141174 s_rfe_b64 s[4:5]
142 // CHECK: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
175 // SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
176 // VI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe]
143177
144178 s_and_saveexec_b64 s[2:3], s[4:5]
145 // CHECK: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
179 // SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
180 // VI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]
146181
147182 s_or_saveexec_b64 s[2:3], s[4:5]
148 // CHECK: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
183 // SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
184 // VI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
149185
150186 s_xor_saveexec_b64 s[2:3], s[4:5]
151 // CHECK: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
187 // SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
188 // VI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]
152189
153190 s_andn2_saveexec_b64 s[2:3], s[4:5]
154 // CHECK: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
191 // SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
192 // VI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe]
155193
156194 s_orn2_saveexec_b64 s[2:3], s[4:5]
157 // CHECK: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
195 // SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
196 // VI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
158197
159198 s_nand_saveexec_b64 s[2:3], s[4:5]
160 // CHECK: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
199 // SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
200 // VI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
161201
162202 s_nor_saveexec_b64 s[2:3], s[4:5]
163 // CHECK: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
203 // SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
204 // VI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
164205
165206 s_xnor_saveexec_b64 s[2:3], s[4:5]
166 // CHECK: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
207 // SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
208 // VI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
167209
168210 s_quadmask_b32 s1, s2
169 // CHECK: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
211 // SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
212 // VI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe]
170213
171214 s_quadmask_b64 s[2:3], s[4:5]
172 // CHECK: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
215 // SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
216 // VI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
173217
174218 s_movrels_b32 s1, s2
175 // CHECK: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
219 // SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
220 // VI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe]
176221
177222 s_movrels_b64 s[2:3], s[4:5]
178 // CHECK: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
223 // SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
224 // VI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
179225
180226 s_movreld_b32 s1, s2
181 // CHECK: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
227 // SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
228 // VI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
182229
183230 s_movreld_b64 s[2:3], s[4:5]
184 // CHECK: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
231 // SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
232 // VI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
185233
186234 s_cbranch_join s[4:5]
187 // CHECK: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
235 // SICI: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
236 // VI: s_cbranch_join s[4:5] ; encoding: [0x04,0x2e,0x80,0xbe]
188237
189238 s_abs_i32 s1, s2
190 // CHECK: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
239 // SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
240 // VI: s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
191241
192242 s_mov_fed_b32 s1, s2
193 // CHECK: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
243 // SICI: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
None // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
0 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
4 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s
25
3 // CHECK: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
46 s_add_u32 s1, s2, s3
7 // GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
58
6 // CHECK: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
79 s_sub_u32 s1, s2, s3
10 // GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
811
9 // CHECK: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
1012 s_add_i32 s1, s2, s3
13 // GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
1114
12 // CHECK: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
1315 s_sub_i32 s1, s2, s3
16 // GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
1417
15 // CHECK: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
1618 s_addc_u32 s1, s2, s3
19 // GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
1720
18 // CHECK: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
1921 s_subb_u32 s1, s2, s3
22 // GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
2023
21 // CHECK: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
2224 s_min_i32 s1, s2, s3
25 // GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
2326
24 // CHECK: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
2527 s_min_u32 s1, s2, s3
28 // GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
2629
27 // CHECK: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
2830 s_max_i32 s1, s2, s3
31 // GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
2932
30 // CHECK: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
3133 s_max_u32 s1, s2, s3
34 // GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
3235
33 // CHECK: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
3436 s_cselect_b32 s1, s2, s3
37 // GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
3538
36 // CHECK: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
3739 s_cselect_b64 s[2:3], s[4:5], s[6:7]
40 // GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
3841
39 // CHECK: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
4042 s_and_b32 s2, s4, s6
43 // SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
44 // VI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86]
4145
42 // CHECK: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
4346 s_and_b64 s[2:3], s[4:5], s[6:7]
47 // SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
48 // VI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86]
4449
45 // CHECK: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
4650 s_or_b32 s2, s4, s6
51 // SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
52 // VI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
4753
48 // CHECK: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
4954 s_or_b64 s[2:3], s[4:5], s[6:7]
55 // SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
56 // VI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
5057
51 // CHECK: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
5258 s_xor_b32 s2, s4, s6
59 // SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
60 // VI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
5361
54 // CHECK: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
5562 s_xor_b64 s[2:3], s[4:5], s[6:7]
63 // SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
64 // VI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
5665
57 // CHECK: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
5866 s_andn2_b32 s2, s4, s6
67 // SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
68 // VI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
5969
60 // CHECK: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
6170 s_andn2_b64 s[2:3], s[4:5], s[6:7]
71 // SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
72 // VI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
6273
63 // CHECK: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
6474 s_orn2_b32 s2, s4, s6
75 // SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
76 // VI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
6577
66 // CHECK: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
6778 s_orn2_b64 s[2:3], s[4:5], s[6:7]
79 // SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
80 // VI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
6881
69 // CHECK: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
7082 s_nand_b32 s2, s4, s6
83 // SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
84 // VI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
7185
72 // CHECK: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
7386 s_nand_b64 s[2:3], s[4:5], s[6:7]
87 // SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
88 // VI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
7489
75 // CHECK: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
7690 s_nor_b32 s2, s4, s6
91 // SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
92 // VI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
7793
78 // CHECK: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
7994 s_nor_b64 s[2:3], s[4:5], s[6:7]
95 // SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
96 // VI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
8097
81 // CHECK: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
8298 s_xnor_b32 s2, s4, s6
99 // SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
100 // VI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
83101
84 // CHECK: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
85102 s_xnor_b64 s[2:3], s[4:5], s[6:7]
103 // SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
104 // VI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
86105
87 // CHECK: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
88106 s_lshl_b32 s2, s4, s6
107 // SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
108 // VI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
89109
90 // CHECK: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
91110 s_lshl_b64 s[2:3], s[4:5], s6
111 // SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
112 // VI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e]
92113
93 // CHECK: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
94114 s_lshr_b32 s2, s4, s6
115 // SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
116 // VI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
95117
96 // CHECK: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
97118 s_lshr_b64 s[2:3], s[4:5], s6
119 // SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
120 // VI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
98121
99 // CHECK: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
100122 s_ashr_i32 s2, s4, s6
123 // SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
124 // VI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
101125
102 // CHECK: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
103126 s_ashr_i64 s[2:3], s[4:5], s6
127 // SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
128 // VI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
104129
105 // CHECK: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
106130 s_bfm_b32 s2, s4, s6
131 // SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
132 // VI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
107133
108 // CHECK: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
109134 s_bfm_b64 s[2:3], s4, s6
135 // SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
136 // VI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91]
110137
111 // CHECK: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
112138 s_mul_i32 s2, s4, s6
139 // SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
140 // VI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
113141
114 // CHECK: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
115142 s_bfe_u32 s2, s4, s6
143 // SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
144 // VI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
116145
117 // CHECK: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
118146 s_bfe_i32 s2, s4, s6
147 // SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
148 // VI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
119149
120 // CHECK: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
121150 s_bfe_u64 s[2:3], s[4:5], s6
151 // SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
152 // VI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93]
122153
123 // CHECK: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
124154 s_bfe_i64 s[2:3], s[4:5], s6
155 // SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
156 // VI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94]
125157
126 // CHECK: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
127158 s_cbranch_g_fork s[4:5], s[6:7]
159 // SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
160 // VI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94]
128161
129 // CHECK: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
130162 s_absdiff_i32 s2, s4, s6
163 // SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
164 // VI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95]
131165
132 // CHECK: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
133166 s_add_u32 s101, s102, s103
167 // SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
168 // NOVI: error: invalid operand for instruction
None // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s
0 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN %s
33
44 //===----------------------------------------------------------------------===//
55 // SOPC Instructions
66 //===----------------------------------------------------------------------===//
77
88 s_cmp_eq_i32 s1, s2
9 // CHECK: s_cmp_eq_i32 s1, s2 ; encoding: [0x01,0x02,0x00,0xbf]
9 // GCN: s_cmp_eq_i32 s1, s2 ; encoding: [0x01,0x02,0x00,0xbf]
1010
1111 s_cmp_lg_i32 s1, s2
12 // CHECK: s_cmp_lg_i32 s1, s2 ; encoding: [0x01,0x02,0x01,0xbf]
12 // GCN: s_cmp_lg_i32 s1, s2 ; encoding: [0x01,0x02,0x01,0xbf]
1313
1414 s_cmp_gt_i32 s1, s2
15 // CHECK: s_cmp_gt_i32 s1, s2 ; encoding: [0x01,0x02,0x02,0xbf]
15 // GCN: s_cmp_gt_i32 s1, s2 ; encoding: [0x01,0x02,0x02,0xbf]
1616
1717 s_cmp_ge_i32 s1, s2
18 // CHECK: s_cmp_ge_i32 s1, s2 ; encoding: [0x01,0x02,0x03,0xbf]
18 // GCN: s_cmp_ge_i32 s1, s2 ; encoding: [0x01,0x02,0x03,0xbf]
1919
2020 s_cmp_lt_i32 s1, s2
21 // CHECK: s_cmp_lt_i32 s1, s2 ; encoding: [0x01,0x02,0x04,0xbf]
21 // GCN: s_cmp_lt_i32 s1, s2 ; encoding: [0x01,0x02,0x04,0xbf]
2222
2323 s_cmp_le_i32 s1, s2
24 // CHECK: s_cmp_le_i32 s1, s2 ; encoding: [0x01,0x02,0x05,0xbf]
24 // GCN: s_cmp_le_i32 s1, s2 ; encoding: [0x01,0x02,0x05,0xbf]
2525
2626 s_cmp_eq_u32 s1, s2
27 // CHECK: s_cmp_eq_u32 s1, s2 ; encoding: [0x01,0x02,0x06,0xbf]
27 // GCN: s_cmp_eq_u32 s1, s2 ; encoding: [0x01,0x02,0x06,0xbf]
2828
2929 s_cmp_lg_u32 s1, s2
30 // CHECK: s_cmp_lg_u32 s1, s2 ; encoding: [0x01,0x02,0x07,0xbf]
30 // GCN: s_cmp_lg_u32 s1, s2 ; encoding: [0x01,0x02,0x07,0xbf]
3131
3232 s_cmp_gt_u32 s1, s2
33 // CHECK: s_cmp_gt_u32 s1, s2 ; encoding: [0x01,0x02,0x08,0xbf]
33 // GCN: s_cmp_gt_u32 s1, s2 ; encoding: [0x01,0x02,0x08,0xbf]
3434
3535 s_cmp_ge_u32 s1, s2
36 // CHECK: s_cmp_ge_u32 s1, s2 ; encoding: [0x01,0x02,0x09,0xbf]
36 // GCN: s_cmp_ge_u32 s1, s2 ; encoding: [0x01,0x02,0x09,0xbf]
3737
3838 s_cmp_lt_u32 s1, s2
39 // CHECK: s_cmp_lt_u32 s1, s2 ; encoding: [0x01,0x02,0x0a,0xbf]
39 // GCN: s_cmp_lt_u32 s1, s2 ; encoding: [0x01,0x02,0x0a,0xbf]
4040
4141 s_cmp_le_u32 s1, s2
42 // CHECK: s_cmp_le_u32 s1, s2 ; encoding: [0x01,0x02,0x0b,0xbf]
42 // GCN: s_cmp_le_u32 s1, s2 ; encoding: [0x01,0x02,0x0b,0xbf]
4343
4444 s_bitcmp0_b32 s1, s2
45 // CHECK: s_bitcmp0_b32 s1, s2 ; encoding: [0x01,0x02,0x0c,0xbf]
45 // GCN: s_bitcmp0_b32 s1, s2 ; encoding: [0x01,0x02,0x0c,0xbf]
4646
4747 s_bitcmp1_b32 s1, s2
48 // CHECK: s_bitcmp1_b32 s1, s2 ; encoding: [0x01,0x02,0x0d,0xbf]
48 // GCN: s_bitcmp1_b32 s1, s2 ; encoding: [0x01,0x02,0x0d,0xbf]
4949
5050 s_bitcmp0_b64 s[2:3], s4
51 // CHECK: s_bitcmp0_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0e,0xbf]
51 // GCN: s_bitcmp0_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0e,0xbf]
5252
5353 s_bitcmp1_b64 s[2:3], s4
54 // CHECK: s_bitcmp1_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0f,0xbf]
54 // GCN: s_bitcmp1_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0f,0xbf]
5555
5656 s_setvskip s3, s5
57 // CHECK: s_setvskip s3, s5 ; encoding: [0x03,0x05,0x10,0xbf]
57 // GCN: s_setvskip s3, s5 ; encoding: [0x03,0x05,0x10,0xbf]
None // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
0 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
23
34 //===----------------------------------------------------------------------===//
45 // Instructions
56 //===----------------------------------------------------------------------===//
67
78 s_movk_i32 s2, 0x6
8 // CHECK: s_movk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb0]
9 // GCN: s_movk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb0]
910
1011 s_cmovk_i32 s2, 0x6
11 // CHECK: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
12 // SICI: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
13 // VI: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb0]
1214
1315 s_cmpk_eq_i32 s2, 0x6
14 // CHECK: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
16 // SICI: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
17 // VI: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
1518
1619 s_cmpk_lg_i32 s2, 0x6
17 // CHECK: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
20 // SICI: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
21 // VI: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
1822
1923 s_cmpk_gt_i32 s2, 0x6
20 // CHECK: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
24 // SICI: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
25 // VI: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
2126
2227 s_cmpk_ge_i32 s2, 0x6
23 // CHECK: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
28 // SICI: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
29 // VI: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
2430
2531 s_cmpk_lt_i32 s2, 0x6
26 // CHECK: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
32 // SICI: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
33 // VI: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
2734
2835 s_cmpk_le_i32 s2, 0x6
29 // CHECK: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
36 // SICI: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
37 // VI: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
3038
3139 s_cmpk_eq_u32 s2, 0x6
32 // CHECK: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
40 // SICI: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
41 // VI: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
3342
3443 s_cmpk_lg_u32 s2, 0x6
35 // CHECK: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
44 // SICI: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
45 // VI: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
3646
3747 s_cmpk_gt_u32 s2, 0x6
38 // CHECK: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
48 // SICI: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
49 // VI: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
3950
4051 s_cmpk_ge_u32 s2, 0x6
41 // CHECK: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
52 // SICI: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
53 // VI: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
4254
4355 s_cmpk_lt_u32 s2, 0x6
44 // CHECK: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
56 // SICI: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
57 // VI: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
4558
4659 s_cmpk_le_u32 s2, 0x6
47 // CHECK: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
60 // SICI: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
61 // VI: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
4862
4963 s_addk_i32 s2, 0x6
50 // CHECK: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
64 // SICI: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
65 // VI: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
5166
5267 s_mulk_i32 s2, 0x6
53 // CHECK: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
68 // SICI: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
69 // VI: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
5470
5571 s_cbranch_i_fork s[2:3], 0x6
56 // CHECK: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
72 // SICI: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
73 // VI: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
5774
5875 s_getreg_b32 s2, 0x6
59 // CHECK: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
76 // SICI: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
77 // VI: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
6078
6179 s_setreg_b32 s2, 0x6
62 // CHECK: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb9]
80 // SICI: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb9]
81 // VI: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
6382
6483 s_setreg_imm32_b32 0xff, 0x6
65 // CHECK: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x80,0xba,0xff,0x00,0x00,0x00]
84 // SICI: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x80,0xba,0xff,0x00,0x00,0x00]
85 // VI: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x00,0xba,0xff,0x00,0x00,0x00]
None // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
0 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
1 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
23
34 //===----------------------------------------------------------------------===//
45 // Edge Cases
56 //===----------------------------------------------------------------------===//
67
7 s_nop 0 // CHECK: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
8 s_nop 0xffff // CHECK: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
8 s_nop 0
9 // GCN: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
10
11 s_nop 0xffff
12 // GCN: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
913
1014 //===----------------------------------------------------------------------===//
1115 // Instructions
1216 //===----------------------------------------------------------------------===//
1317
14 s_nop 1 // CHECK: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
15 s_endpgm // CHECK: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
16 s_branch 2 // CHECK: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
17 s_cbranch_scc0 3 // CHECK: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
18 s_cbranch_scc1 4 // CHECK: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
19 s_cbranch_vccz 5 // CHECK: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
20 s_cbranch_vccnz 6 // CHECK: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
21 s_cbranch_execz 7 // CHECK: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
22 s_cbranch_execnz 8 // CHECK: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
23 s_barrier // CHECK: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
18 s_nop 1
19 // GCN: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
20
21 s_endpgm
22 // GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
23
24 s_branch 2
25 // GCN: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
26
27 s_cbranch_scc0 3
28 // GCN: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
29
30 s_cbranch_scc1 4
31 // GCN: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
32
33 s_cbranch_vccz 5
34 // GCN: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
35
36 s_cbranch_vccnz 6
37 // GCN: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
38
39 s_cbranch_execz 7
40 // GCN: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
41
42 s_cbranch_execnz 8
43 // GCN: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
44
45 s_barrier
46 // GCN: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
2447
2548 //===----------------------------------------------------------------------===//
2649 // s_waitcnt
2750 //===----------------------------------------------------------------------===//
2851
29 s_waitcnt 0
30 // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
52 s_waitcnt 0
53 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
3154
32 s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
33 // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
55 s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
56 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
3457
35 s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
36 // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
58 s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
59 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
3760
38 s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
39 // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
61 s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
62 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
4063
41 s_waitcnt vmcnt(1)
42 // CHECK: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
64 s_waitcnt vmcnt(1)
65 // GCN: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
4366
44 s_waitcnt vmcnt(9)
45 // CHECK: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
67 s_waitcnt vmcnt(9)
68 // GCN: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
4669
47 s_waitcnt expcnt(2)
48 // CHECK: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
70 s_waitcnt expcnt(2)
71 // GCN: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
4972
50 s_waitcnt lgkmcnt(3)
51 // CHECK: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
73 s_waitcnt lgkmcnt(3)
74 // GCN: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
5275
53 s_waitcnt lgkmcnt(9)
54 // CHECK: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
76 s_waitcnt lgkmcnt(9)
77 // GCN: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
5578
56 s_waitcnt vmcnt(0), expcnt(0)
57 // CHECK: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
79 s_waitcnt vmcnt(0), expcnt(0)
80 // GCN: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
5881
5982
60 s_sethalt 9 // CHECK: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
61 s_sleep 10 // CHECK: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
62 s_setprio 1 // CHECK: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
63 s_sendmsg 2 // CHECK: s_sendmsg Gs(nop), [m0] ; encoding: [0x02,0x00,0x90,0xbf]
64 s_sendmsghalt 3 // CHECK: s_sendmsghalt 3 ; encoding: [0x03,0x00,0x91,0xbf]
65 s_trap 4 // CHECK: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
66 s_icache_inv // CHECK: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
67 s_incperflevel 5 // CHECK: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
68 s_decperflevel 6 // CHECK: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
69 s_ttracedata // CHECK: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]
83 s_sethalt 9
84 // GCN: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
85
86 s_sleep 10
87 // GCN: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
88
89 s_setprio 1
90 // GCN: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
91
92 s_sendmsg 2
93 // GCN: s_sendmsg Gs(nop), [m0] ; encoding: [0x02,0x00,0x90,0xbf]
94
95 s_sendmsghalt 3
96 // GCN: s_sendmsghalt 3 ; encoding: [0x03,0x00,0x91,0xbf]
97
98 s_trap 4
99 // GCN: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
100
101 s_icache_inv
102 // GCN: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
103
104 s_incperflevel 5
105 // GCN: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
106
107 s_decperflevel 6
108 // GCN: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
109
110 s_ttracedata
111 // GCN: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]