1 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx1010
-show-encoding
%s
2>&1 | FileCheck
-check-prefix
=GFX10
%s
2 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx1010
-show-encoding
%s
2>&1 | FileCheck
-check-prefix
=GFX10-ERR
%s
4 //-----------------------------------------------------------------------------------------
5 // On GFX10 we can use two scalar operands
(except for
64-bit shift instructions
)
8 // GFX10
: v_add_f32_e64 v0
, s0
, s1 ; encoding
: [0x00,0x00,0x03,0xd5,0x00,0x02,0x00,0x00]
10 v_madak_f32 v0
, s0
, v1
, 42.42
11 // GFX10
: v_madak_f32 v0
, s0
, v1
, 0x4229ae14 ; encoding
: [0x00,0x02,0x00,0x42,0x14,0xae,0x29,0x42]
13 v_med3_f32 v0
, s0
, s0
, s1
14 // GFX10
: v_med3_f32 v0
, s0
, s0
, s1 ; encoding
: [0x00,0x00,0x57,0xd5,0x00,0x00,0x04,0x00]
16 //-----------------------------------------------------------------------------------------
17 // 64-bit shift instructions can use only one scalar value input
19 v_ashrrev_i64 v
[0:1], 0x100, s
[0:1]
20 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
22 v_ashrrev_i64 v
[0:1], s2
, s
[0:1]
23 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
25 //-----------------------------------------------------------------------------------------
26 // v_div_fmas implicitly reads VCC
, so only one scalar operand is possible
28 v_div_fmas_f32 v5
, s3
, s3
, s3
29 // GFX10
: v_div_fmas_f32 v5
, s3
, s3
, s3 ; encoding
: [0x05,0x00,0x6f,0xd5,0x03,0x06,0x0c,0x00]
31 v_div_fmas_f32 v5
, s3
, s3
, s2
32 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
34 v_div_fmas_f32 v5
, s3
, 0x123, v3
35 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
37 v_div_fmas_f64 v
[5:6], 0x12345678, 0x12345678, 0x12345678
38 // GFX10
: v_div_fmas_f64 v
[5:6], 0x12345678, 0x12345678, 0x12345678 ; encoding
: [0x05,0x00,0x70,0xd5,0xff,0xfe,0xfd,0x03,0x78,0x56,0x34,0x12]
40 v_div_fmas_f64 v
[5:6], v
[1:2], s
[2:3], v
[3:4]
41 // GFX10
: v_div_fmas_f64 v
[5:6], v
[1:2], s
[2:3], v
[3:4] ; encoding
: [0x05,0x00,0x70,0xd5,0x01,0x05,0x0c,0x04]
43 v_div_fmas_f64 v
[5:6], v
[1:2], s
[2:3], 0x123456
44 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
46 //-----------------------------------------------------------------------------------------
47 // v_mad_u64_u32 has operands of different sizes.
48 // When these operands are literals
, they are counted as
2 scalar values even if literals are identical.
50 v_lshlrev_b64 v
[5:6], 0x3f717273, 0x3f717273
51 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
53 v_mad_u64_u32 v
[5:6], s12
, v1
, 0x12345678, 0x12345678
54 // GFX10
: v_mad_u64_u32 v
[5:6], s12
, v1
, 0x12345678, 0x12345678 ; encoding
: [0x05,0x0c,0x76,0xd5,0x01,0xff,0xfd,0x03,0x78,0x56,0x34,0x12]
56 v_mad_u64_u32 v
[5:6], s12
, s1
, 0x12345678, 0x12345678
57 // GFX10-ERR
: error
: invalid operand
(violates constant bus restrictions
)
59 //-----------------------------------------------------------------------------------------
62 v_bfe_u32 v5
, s1
, s2
, null
63 // GFX10
: v_bfe_u32 v5
, s1
, s2
, null ; encoding
: [0x05,0x00,0x48,0xd5,0x01,0x04,0xf4,0x01]