Skip to content

Commit c9c8f0c

Browse files
authored
[AMDGPU] Update tests for GFX12 errors and unsupported instructions (#77624)
1 parent 16945bc commit c9c8f0c

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

llvm/test/MC/AMDGPU/gfx12_err.s

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,77 @@
11
// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1200 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX12-ERR --implicit-check-not=error: -strict-whitespace %s
22

3+
v_cubesc_f32_e64_dpp v5, v1, v2, 12345678 row_shr:4 row_mask:0xf bank_mask:0xf
4+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
5+
6+
v_add3_u32_e64_dpp v5, v1, v2, 49812340 dpp8:[7,6,5,4,3,2,1,0]
7+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
8+
9+
v_cvt_f32_i32_e64_dpp v5, s1 dpp8:[7,6,5,4,3,2,1,0]
10+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
11+
12+
v_cvt_f32_i32_e64_dpp v5, s1 row_shl:15 row_mask:0xf bank_mask:0xf
13+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
14+
15+
v_cvt_f16_u16_e64_dpp v5, s1 dpp8:[7,6,5,4,3,2,1,0]
16+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
17+
18+
v_cvt_f16_u16_e64_dpp v5, s1 row_shl:1 row_mask:0xf bank_mask:0xf
19+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
20+
21+
; disallow space between colons
22+
v_dual_mul_f32 v0, v0, v2 : : v_dual_mul_f32 v1, v1, v3
23+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: unknown token in expression
24+
25+
// On GFX12, v_dot8_i32_i4 is a valid SP3 alias for v_dot8_i32_iu4.
26+
// However, we intentionally leave it unimplemented because on other
27+
// processors v_dot8_i32_i4 denotes an instruction of a different
28+
// behaviour, which is considered potentially dangerous.
29+
v_dot8_i32_i4 v0, v1, v2, v3
30+
// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
31+
32+
// On GFX12, v_dot4_i32_i8 is a valid SP3 alias for v_dot4_i32_iu8.
33+
// However, we intentionally leave it unimplemented because on other
34+
// processors v_dot4_i32_i8 denotes an instruction of a different
35+
// behaviour, which is considered potentially dangerous.
36+
v_dot4_i32_i8 v0, v1, v2, v3
37+
// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
38+
39+
v_dot4c_i32_i8 v0, v1, v2
40+
// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
41+
42+
v_cmp_class_f16_e64_dpp s105, s2, v2 row_ror:15
43+
// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
44+
45+
v_cmpx_class_f32_e64_dpp s1, v2 dpp8:[7,6,5,4,3,2,1,0] fi:1
46+
// GFX12-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
47+
48+
v_fma_mix_f32_e64_dpp v5, s1, v3, v4 quad_perm:[3,2,1,0]
49+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
50+
51+
v_fma_mix_f32_e64_dpp v5, v1, s3, v4 quad_perm:[3,2,1,0]
52+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
53+
54+
v_fma_mix_f32_e64_dpp v5, s1, v3, v4 dpp8:[7,6,5,4,3,2,1,0]
55+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
56+
57+
v_fma_mix_f32_e64_dpp v5, v1, s3, v4 dpp8:[7,6,5,4,3,2,1,0]
58+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
59+
60+
v_fma_mixhi_f16_e64_dpp v5, v1, 0, v4 quad_perm:[3,2,1,0]
61+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
62+
63+
v_fma_mixlo_f16_e64_dpp v5, v1, 1, v4 dpp8:[7,6,5,4,3,2,1,0]
64+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
65+
66+
v_lshlrev_b64 v[5:6], s2, s[0:1]
67+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
68+
69+
v_lshrrev_b64 v[5:6], s2, s[0:1]
70+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
71+
72+
v_ashrrev_i64 v[5:6], s2, s[0:1]
73+
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
74+
375
image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D th:0x7
476
// GFX12-ERR: [[@LINE-1]]:{{[0-9]+}}: error: expected an identifier
577

llvm/test/MC/AMDGPU/gfx12_unsupported.s

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ s_cbranch_cdbgsys_or_user 0
3434
s_cbranch_cdbgsys_and_user 0
3535
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
3636

37+
v_fmac_legacy_f32 v0, v1, v2
38+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
39+
40+
v_dot2c_f32_f16 v0, v1, v2
41+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
42+
43+
v_dual_max_f32 v0, v1, v2 :: v_dual_max_f32 v3, v4, v5
44+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
45+
46+
v_dual_min_f32 v0, v1, v2 :: v_dual_min_f32 v3, v4, v5
47+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
48+
3749
ds_cmpstore_f32 v0, v1, v2
3850
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
3951

@@ -91,6 +103,15 @@ s_cmpk_lt_u32 s0, 0
91103
s_cmpk_le_u32 s0, 0
92104
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
93105

106+
buffer_atomic_cmpswap_f32 v[5:6], off, s[96:99], s3
107+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
108+
109+
flat_atomic_cmpswap_f32 v[5:6], off, s[96:99], s3
110+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
111+
112+
global_atomic_cmpswap_f32 v[5:6], off, s[96:99], s3
113+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
114+
94115
ds_gws_sema_release_all gds
95116
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
96117

@@ -208,6 +229,12 @@ buffer_gl1_inv
208229
buffer_wbinvl1
209230
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
210231

232+
flat_atomic_csub v1, v[0:1], v2 offset:64 th:TH_ATOMIC_RETURN
233+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid instruction
234+
235+
ds_add_f32 v255, v255 offset:4 gds
236+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: gds modifier is not supported on this GPU
237+
211238
buffer_load_lds_b32 off, s[8:11], s3
212239
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
213240

0 commit comments

Comments
 (0)