[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / gfx9_err_pos.s
blobf6e696482ed9ee48ec280b7a35c1d24beaacf328
1 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --implicit-check-not=error: --strict-whitespace
3 //==============================================================================
4 // 'null' operand is not supported on this GPU
6 s_add_u32 null, null, null
7 // CHECK: error: 'null' operand is not supported on this GPU
8 // CHECK-NEXT:{{^}}s_add_u32 null, null, null
9 // CHECK-NEXT:{{^}} ^
11 //==============================================================================
12 // ABS not allowed in VOP3B instructions
14 v_div_scale_f64 v[24:25], vcc, -|v[22:23]|, v[22:23], v[20:21]
15 // CHECK: error: ABS not allowed in VOP3B instructions
16 // CHECK-NEXT:{{^}}v_div_scale_f64 v[24:25], vcc, -|v[22:23]|, v[22:23], v[20:21]
17 // CHECK-NEXT:{{^}}^
19 //==============================================================================
20 // dlc modifier is not supported on this GPU
22 scratch_load_ubyte v1, v2, off dlc
23 // CHECK: error: dlc modifier is not supported on this GPU
24 // CHECK-NEXT:{{^}}scratch_load_ubyte v1, v2, off dlc
25 // CHECK-NEXT:{{^}} ^
27 scratch_load_ubyte v1, v2, off nodlc
28 // CHECK: error: dlc modifier is not supported on this GPU
29 // CHECK-NEXT:{{^}}scratch_load_ubyte v1, v2, off nodlc
30 // CHECK-NEXT:{{^}} ^
32 //==============================================================================
33 // duplicate VGPR index mode
35 s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC1,DST)
36 // CHECK: error: duplicate VGPR index mode
37 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC1,DST)
38 // CHECK-NEXT:{{^}} ^
40 //==============================================================================
41 // exp target is not supported on this GPU
43 exp pos4 v4, v3, v2, v1
44 // CHECK: error: exp target is not supported on this GPU
45 // CHECK-NEXT:{{^}}exp pos4 v4, v3, v2, v1
46 // CHECK-NEXT:{{^}} ^
48 //==============================================================================
49 // expected a 12-bit unsigned offset
51 flat_load_dword v1, v[3:4] offset:-1
52 // CHECK: error: expected a 12-bit unsigned offset
53 // CHECK-NEXT:{{^}}flat_load_dword v1, v[3:4] offset:-1
54 // CHECK-NEXT:{{^}} ^
56 flat_load_dword v1, v[3:4] offset:4096
57 // CHECK: error: expected a 12-bit unsigned offset
58 // CHECK-NEXT:{{^}}flat_load_dword v1, v[3:4] offset:4096
59 // CHECK-NEXT:{{^}} ^
61 //==============================================================================
62 // expected a 13-bit signed offset
64 global_load_dword v1, v[3:4] off, offset:-4097
65 // CHECK: error: expected a 13-bit signed offset
66 // CHECK-NEXT:{{^}}global_load_dword v1, v[3:4] off, offset:-4097
67 // CHECK-NEXT:{{^}} ^
69 //==============================================================================
70 // expected a VGPR index mode
72 s_set_gpr_idx_on s0, gpr_idx(SRC0,
73 // CHECK: error: expected a VGPR index mode
74 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(SRC0,
75 // CHECK-NEXT:{{^}} ^
77 //==============================================================================
78 // expected a VGPR index mode or a closing parenthesis
80 s_set_gpr_idx_on s0, gpr_idx(
81 // CHECK: error: expected a VGPR index mode or a closing parenthesis
82 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(
83 // CHECK-NEXT:{{^}} ^
85 s_set_gpr_idx_on s0, gpr_idx(X)
86 // CHECK: error: expected a VGPR index mode or a closing parenthesis
87 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(X)
88 // CHECK-NEXT:{{^}} ^
90 //==============================================================================
91 // expected a comma or a closing parenthesis
93 s_set_gpr_idx_on s0, gpr_idx(DST
94 // CHECK: error: expected a comma or a closing parenthesis
95 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(DST
96 // CHECK-NEXT:{{^}} ^
98 //==============================================================================
99 // expected absolute expression
101 s_set_gpr_idx_on s0, gpr_idx
102 // CHECK: error: expected absolute expression
103 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx
104 // CHECK-NEXT:{{^}} ^
106 s_set_gpr_idx_on s0, s1
107 // CHECK: error: expected absolute expression
108 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, s1
109 // CHECK-NEXT:{{^}} ^
111 //==============================================================================
112 // invalid atomic image dmask
114 image_atomic_add v252, v2, s[8:15]
115 // CHECK: error: invalid atomic image dmask
116 // CHECK-NEXT:{{^}}image_atomic_add v252, v2, s[8:15]
117 // CHECK-NEXT:{{^}}^
119 image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xe tfe
120 // CHECK: error: invalid atomic image dmask
121 // CHECK-NEXT:{{^}}image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xe tfe
122 // CHECK-NEXT:{{^}} ^
124 //==============================================================================
125 // invalid image_gather dmask: only one bit must be set
127 image_gather4_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x3
128 // CHECK: error: invalid image_gather dmask: only one bit must be set
129 // CHECK-NEXT:{{^}}image_gather4_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x3
130 // CHECK-NEXT:{{^}} ^
132 //==============================================================================
133 // invalid immediate: only 4-bit values are legal
135 s_set_gpr_idx_on s0, 16
136 // CHECK: error: invalid immediate: only 4-bit values are legal
137 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, 16
138 // CHECK-NEXT:{{^}} ^
140 //==============================================================================
141 // invalid operand (violates constant bus restrictions)
143 v_add_f32_e64 v0, flat_scratch_hi, m0
144 // CHECK: error: invalid operand (violates constant bus restrictions)
145 // CHECK-NEXT:{{^}}v_add_f32_e64 v0, flat_scratch_hi, m0
146 // CHECK-NEXT:{{^}} ^
148 v_madak_f32 v5, s1, v2, 0xa1b1c1d1
149 // CHECK: error: invalid operand (violates constant bus restrictions)
150 // CHECK-NEXT:{{^}}v_madak_f32 v5, s1, v2, 0xa1b1c1d1
151 // CHECK-NEXT:{{^}} ^
153 v_madmk_f32 v5, s1, 0x11213141, v255
154 // CHECK: error: invalid operand (violates constant bus restrictions)
155 // CHECK-NEXT:{{^}}v_madmk_f32 v5, s1, 0x11213141, v255
156 // CHECK-NEXT:{{^}} ^
158 //==============================================================================
159 // literal operands are not supported
161 v_bfe_u32 v0, v2, v3, undef
162 // CHECK: error: literal operands are not supported
163 // CHECK-NEXT:{{^}}v_bfe_u32 v0, v2, v3, undef
164 // CHECK-NEXT:{{^}} ^
166 v_bfe_u32 v0, v2, undef, v3
167 // CHECK: error: literal operands are not supported
168 // CHECK-NEXT:{{^}}v_bfe_u32 v0, v2, undef, v3
169 // CHECK-NEXT:{{^}} ^
171 v_add_i16 v5, v1, 0.5
172 // CHECK: error: literal operands are not supported
173 // CHECK-NEXT:{{^}}v_add_i16 v5, v1, 0.5
174 // CHECK-NEXT:{{^}} ^
176 v_add_i16 v5, 0.5, v2
177 // CHECK: error: literal operands are not supported
178 // CHECK-NEXT:{{^}}v_add_i16 v5, 0.5, v2
179 // CHECK-NEXT:{{^}} ^
181 //==============================================================================
182 // r128 modifier is not supported on this GPU
184 image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
185 // CHECK: error: r128 modifier is not supported on this GPU
186 // CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
187 // CHECK-NEXT:{{^}} ^
189 image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
190 // CHECK: error: r128 modifier is not supported on this GPU
191 // CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
192 // CHECK-NEXT:{{^}} ^
194 //==============================================================================
195 // unified format is not supported on this GPU
197 tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
198 // CHECK: error: unified format is not supported on this GPU
199 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
200 // CHECK-NEXT:{{^}} ^
202 //==============================================================================
203 // duplicate format
205 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
206 // CHECK: error: duplicate format
207 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
208 // CHECK-NEXT:{{^}} ^
210 //==============================================================================
211 // out of range dfmt
213 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
214 // CHECK: error: out of range dfmt
215 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
216 // CHECK-NEXT:{{^}} ^
218 //==============================================================================
219 // out of range nfmt
221 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
222 // CHECK: error: out of range nfmt
223 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
224 // CHECK-NEXT:{{^}} ^