1 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx900
-show-encoding
%s | FileCheck
-check-prefix
=GFX9
-check-prefix
=GCN
%s
2 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx900
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=GFX9-ERR
-check-prefix
=GCNERR
%s
3 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=tonga
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=VI-ERR
-check-prefix
=GCNERR
%s
5 scratch_load_ubyte v1
, v2
, off
6 // GFX9
: scratch_load_ubyte v1
, v2
, off ; encoding
: [0x00,0x40,0x40,0xdc,0x02,0x00,0x7f,0x01]
7 // VI-ERR
: instruction
not supported on this GPU
9 scratch_load_sbyte v1
, v2
, off
10 // GFX9
: scratch_load_sbyte v1
, v2
, off ; encoding
: [0x00,0x40,0x44,0xdc,0x02,0x00,0x7f,0x01]
11 // VI-ERR
: instruction
not supported on this GPU
13 scratch_load_ushort v1
, v2
, off
14 // GFX9
: scratch_load_ushort v1
, v2
, off ; encoding
: [0x00,0x40,0x48,0xdc,0x02,0x00,0x7f,0x01]
15 // VI-ERR
: instruction
not supported on this GPU
17 scratch_load_sshort v1
, v2
, off
18 // GFX9
: scratch_load_sshort v1
, v2
, off ; encoding
: [0x00,0x40,0x4c,0xdc,0x02,0x00,0x7f,0x01]
19 // VI-ERR
: instruction
not supported on this GPU
21 scratch_load_dword v1
, v2
, off
22 // GFX9
: scratch_load_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01]
23 // VI-ERR
: instruction
not supported on this GPU
25 scratch_load_dwordx2 v
[1:2], v3
, off
26 // GFX9
: scratch_load_dwordx2 v
[1:2], v3
, off ; encoding
: [0x00,0x40,0x54,0xdc,0x03,0x00,0x7f,0x01]
27 // VI-ERR
: instruction
not supported on this GPU
29 scratch_load_dwordx3 v
[1:3], v4
, off
30 // GFX9
: scratch_load_dwordx3 v
[1:3], v4
, off ; encoding
: [0x00,0x40,0x58,0xdc,0x04,0x00,0x7f,0x01]
31 // VI-ERR
: instruction
not supported on this GPU
33 scratch_load_dwordx4 v
[1:4], v5
, off
34 // GFX9
: scratch_load_dwordx4 v
[1:4], v5
, off ; encoding
: [0x00,0x40,0x5c,0xdc,0x05,0x00,0x7f,0x01]
35 // VI-ERR
: instruction
not supported on this GPU
36 // FIXME
: VI error should
be instruction nto supported
38 scratch_load_dword v1
, v2
, off offset
:0
39 // GFX9
: scratch_load_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01]
40 // VI-ERR
: error
: not a valid operand.
42 scratch_load_dword v1
, v2
, off offset
:4095
43 // GFX9
: scratch_load_dword v1
, v2
, off offset
:4095 ; encoding
: [0xff,0x4f,0x50,0xdc,0x02,0x00,0x7f,0x01]
44 // VI-ERR
: error
: not a valid operand.
46 scratch_load_dword v1
, v2
, off offset
:-1
47 // GFX9
: scratch_load_dword v1
, v2
, off offset
:-1 ; encoding
: [0xff,0x5f,0x50,0xdc,0x02,0x00,0x7f,0x01]
48 // VI-ERR
: error
: not a valid operand.
50 scratch_load_dword v1
, v2
, off offset
:-4096
51 // GFX9
: scratch_load_dword v1
, v2
, off offset
:-4096 ; encoding
: [0x00,0x50,0x50,0xdc,0x02,0x00,0x7f,0x01]
52 // VI-ERR
: error
: not a valid operand.
54 scratch_load_dword v1
, v2
, off offset
:4096
55 // GFX9-ERR
: error
: invalid operand for instruction
56 // VI-ERR
: error
: not a valid operand.
58 scratch_load_dword v1
, v2
, off offset
:-4097
59 // GFX9-ERR
: error
: invalid operand for instruction
60 // VI-ERR
: error
: not a valid operand.
62 scratch_store_byte v1
, v2
, off
63 // GFX9
: scratch_store_byte v1
, v2
, off ; encoding
: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7f,0x00]
64 // VI-ERR
: instruction
not supported on this GPU
66 scratch_store_short v1
, v2
, off
67 // GFX9
: scratch_store_short v1
, v2
, off ; encoding
: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7f,0x00]
68 // VI-ERR
: instruction
not supported on this GPU
70 scratch_store_dword v1
, v2
, off
71 // GFX9
: scratch_store_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
72 // VI-ERR
: instruction
not supported on this GPU
74 scratch_store_dwordx2 v1
, v
[2:3], off
75 // GFX9
: scratch_store_dwordx2 v1
, v
[2:3], off ; encoding
: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7f,0x00]
76 // VI-ERR
: instruction
not supported on this GPU
78 scratch_store_dwordx3 v1
, v
[2:4], off
79 // GFX9
: scratch_store_dwordx3 v1
, v
[2:4], off ; encoding
: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7f,0x00]
80 // VI-ERR
: instruction
not supported on this GPU
82 scratch_store_dwordx4 v1
, v
[2:5], off
83 // GFX9
: scratch_store_dwordx4 v1
, v
[2:5], off ; encoding
: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7f,0x00]
84 // VI-ERR
: instruction
not supported on this GPU
86 scratch_store_dword v1
, v2
, off offset
:12
87 // GFX9
: scratch_store_dword v1
, v2
, off offset
:12 ; encoding
: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
88 // VI-ERR
: error
: not a valid operand
90 scratch_load_dword v1
, off
, s1
91 // GFX9
: scratch_load_dword v1
, off
, s1 ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
92 // VI-ERR
: instruction
not supported on this GPU
94 scratch_load_dword v1
, off
, s1 offset
:32
95 // GFX9
: scratch_load_dword v1
, off
, s1 offset
:32 ; encoding
: [0x20,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
96 // VI-ERR
: error
: not a valid operand
98 scratch_store_dword off
, v2
, s1
99 // GFX9
: scratch_store_dword off
, v2
, s1 ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
100 // VI-ERR
: instruction
not supported on this GPU
102 scratch_store_dword off
, v2
, s1 offset
:12
103 // GFX9
: scratch_store_dword off
, v2
, s1 offset
:12 ; encoding
: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
104 // VI-ERR
: error
: not a valid operand
106 // FIXME
: Should error about multiple offsets
107 scratch_load_dword v1
, v2
, s1
108 // GFX9-ERR
: error
: invalid operand for instruction
109 // VI-ERR
: error
: invalid operand for instruction
111 scratch_load_dword v1
, v2
, s1 offset
:32
112 // GFX9-ERR
: error
: invalid operand for instruction
113 // VI-ERR
: error
: not a valid operand
115 scratch_store_dword v1
, v2
, s1
116 // GFX9-ERR
: error
: invalid operand for instruction
117 // VI-ERR
: error
: invalid operand for instruction
119 scratch_store_dword v1
, v2
, s1 offset
:32
120 // GFX9-ERR
: error
: invalid operand for instruction
121 // VI-ERR
: error
: not a valid operand
123 scratch_load_dword v1
, off
, exec_hi
124 // GFX9-ERR
: error
: invalid operand for instruction
125 // VI-ERR
: error
: invalid operand for instruction
127 scratch_store_dword off
, v2
, exec_hi
128 // GFX9-ERR
: error
: invalid operand for instruction
129 // VI-ERR
: error
: invalid operand for instruction
131 scratch_load_dword v1
, off
, exec_lo
132 // GFX9
: scratch_load_dword v1
, off
, exec_lo ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7e,0x01]
133 // VI-ERR
: instruction
not supported on this GPU
135 scratch_store_dword off
, v2
, exec_lo
136 // GFX9
: scratch_store_dword off
, v2
, exec_lo ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00]
137 // VI-ERR
: instruction
not supported on this GPU
139 scratch_load_dword v1
, off
, m0
140 // GFX9
: scratch_load_dword v1
, off
, m0 ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7c,0x01]
141 // VI-ERR
: instruction
not supported on this GPU
143 scratch_store_dword off
, v2
, m0
144 // GFX9
: scratch_store_dword off
, v2
, m0 ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00]
145 // VI-ERR
: instruction
not supported on this GPU
147 scratch_load_ubyte_d16 v1
, v2
, off
148 // GFX9
: scratch_load_ubyte_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7f,0x01]
149 // VI-ERR
: instruction
not supported on this GPU
151 scratch_load_ubyte_d16_hi v1
, v2
, off
152 // GFX9
: scratch_load_ubyte_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7f,0x01]
153 // VI-ERR
: instruction
not supported on this GPU
155 scratch_load_sbyte_d16 v1
, v2
, off
156 // GFX9
: scratch_load_sbyte_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7f,0x01]
157 // VI-ERR
: instruction
not supported on this GPU
159 scratch_load_sbyte_d16_hi v1
, v2
, off
160 // GFX9
: scratch_load_sbyte_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7f,0x01]
161 // VI-ERR
: instruction
not supported on this GPU
163 scratch_load_short_d16 v1
, v2
, off
164 // GFX9
: scratch_load_short_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7f,0x01]
165 // VI-ERR
: instruction
not supported on this GPU
167 scratch_load_short_d16_hi v1
, v2
, off
168 // GFX9
: scratch_load_short_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7f,0x01]
169 // VI-ERR
: instruction
not supported on this GPU
171 scratch_store_byte_d16_hi off
, v2
, s1
172 // GFX9
: scratch_store_byte_d16_hi off
, v2
, s1 ; encoding
: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00]
173 // VI-ERR
: instruction
not supported on this GPU
175 scratch_store_short_d16_hi off
, v2
, s1
176 // GFX9
: scratch_store_short_d16_hi off
, v2
, s1 ; encoding
: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00]
177 // VI-ERR
: instruction
not supported on this GPU