• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
3// RUN: llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
4// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
5// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s
6
7s_add_u32 s1, s2, s3
8// GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
9
10s_sub_u32 s1, s2, s3
11// GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
12
13s_add_i32 s1, s2, s3
14// GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
15
16s_sub_i32 s1, s2, s3
17// GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
18
19s_addc_u32 s1, s2, s3
20// GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
21
22s_subb_u32 s1, s2, s3
23// GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
24
25s_min_i32 s1, s2, s3
26// GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
27
28s_min_u32 s1, s2, s3
29// GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
30
31s_max_i32 s1, s2, s3
32// GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
33
34s_max_u32 s1, s2, s3
35// GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
36
37s_cselect_b32 s1, s2, s3
38// GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
39
40s_cselect_b64 s[2:3], s[4:5], s[6:7]
41// GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
42
43s_and_b32 s2, s4, s6
44// SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
45// VI:   s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86]
46
47s_and_b64 s[2:3], s[4:5], s[6:7]
48// SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
49// VI:   s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86]
50
51s_or_b32 s2, s4, s6
52// SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
53// VI:   s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
54
55s_or_b64 s[2:3], s[4:5], s[6:7]
56// SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
57// VI:   s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
58
59s_xor_b32 s2, s4, s6
60// SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
61// VI:   s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
62
63s_xor_b64 s[2:3], s[4:5], s[6:7]
64// SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
65// VI:   s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
66
67s_andn2_b32 s2, s4, s6
68// SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
69// VI:   s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
70
71s_andn2_b64 s[2:3], s[4:5], s[6:7]
72// SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
73// VI:   s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
74
75s_orn2_b32 s2, s4, s6
76// SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
77// VI:   s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
78
79s_orn2_b64 s[2:3], s[4:5], s[6:7]
80// SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
81// VI:   s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
82
83s_nand_b32 s2, s4, s6
84// SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
85// VI:   s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
86
87s_nand_b64 s[2:3], s[4:5], s[6:7]
88// SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
89// VI:   s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
90
91s_nor_b32 s2, s4, s6
92// SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
93// VI:   s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
94
95s_nor_b64 s[2:3], s[4:5], s[6:7]
96// SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
97// VI:   s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
98
99s_xnor_b32 s2, s4, s6
100// SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
101// VI:   s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
102
103s_xnor_b64 s[2:3], s[4:5], s[6:7]
104// SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
105// VI:   s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
106
107s_lshl_b32 s2, s4, s6
108// SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
109// VI:   s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
110
111s_lshl_b64 s[2:3], s[4:5], s6
112// SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
113// VI:   s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e]
114
115s_lshr_b32 s2, s4, s6
116// SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
117// VI:   s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
118
119s_lshr_b64 s[2:3], s[4:5], s6
120// SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
121// VI:   s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
122
123s_ashr_i32 s2, s4, s6
124// SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
125// VI:   s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
126
127s_ashr_i64 s[2:3], s[4:5], s6
128// SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
129// VI:   s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
130
131s_bfm_b32 s2, s4, s6
132// SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
133// VI:   s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
134
135s_bfm_b64 s[2:3], s4, s6
136// SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
137// VI:   s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91]
138
139s_mul_i32 s2, s4, s6
140// SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
141// VI:   s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
142
143s_bfe_u32 s2, s4, s6
144// SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
145// VI:   s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
146
147s_bfe_i32 s2, s4, s6
148// SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
149// VI:   s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
150
151s_bfe_u64 s[2:3], s[4:5], s6
152// SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
153// VI:   s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93]
154
155s_bfe_i64 s[2:3], s[4:5], s6
156// SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
157// VI:   s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94]
158
159s_cbranch_g_fork s[4:5], s[6:7]
160// SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
161// VI:   s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94]
162
163s_absdiff_i32 s2, s4, s6
164// SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
165// VI:   s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95]
166
167s_add_u32 s101, s102, s103
168// SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
169// NOVI:   error: not a valid operand
170