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
=tonga
-show-encoding
%s | FileCheck
-check-prefix
=VI
-check-prefix
=GCN
%s
4 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx900
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=GFX9-ERR
-check-prefix
=GCNERR
%s
5 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=tonga
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=VI-ERR
-check-prefix
=GCNERR
%s
8 flat_load_dword v1
, v
[3:4] offset
:0
9 // GCN
: flat_load_dword v1
, v
[3:4] ; encoding
: [0x00,0x00,0x50,0xdc,0x03,0x00,0x00,0x01]
11 flat_load_dword v1
, v
[3:4] offset
:-1
12 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
13 // GFX9-ERR
: :28: error
: expected
a 12-bit unsigned offset
15 // FIXME
: Error on VI in wrong column
16 flat_load_dword v1
, v
[3:4] offset
:4095
17 // GFX9
: flat_load_dword v1
, v
[3:4] offset
:4095 ; encoding
: [0xff,0x0f,0x50,0xdc,0x03,0x00,0x00,0x01]
18 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
20 flat_load_dword v1
, v
[3:4] offset
:4096
21 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
22 // GFX9-ERR
: :28: error
: expected
a 12-bit unsigned offset
24 flat_load_dword v1
, v
[3:4] offset
:4 glc
25 // GFX9
: flat_load_dword v1
, v
[3:4] offset
:4 glc ; encoding
: [0x04,0x00,0x51,0xdc,0x03,0x00,0x00,0x01]
26 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
28 flat_load_dword v1
, v
[3:4] offset
:4 glc slc
29 // GFX9
: flat_load_dword v1
, v
[3:4] offset
:4 glc slc ; encoding
: [0x04,0x00,0x53,0xdc,0x03,0x00,0x00,0x01]
30 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
32 flat_atomic_add v
[3:4], v5 offset
:8 slc
33 // GFX9
: flat_atomic_add v
[3:4], v5 offset
:8 slc ; encoding
: [0x08,0x00,0x0a,0xdd,0x03,0x05,0x00,0x00]
34 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
36 flat_atomic_add v
[3:4], v5 inst_offset
:8 slc
37 // GFX9
: flat_atomic_add v
[3:4], v5 offset
:8 slc ; encoding
: [0x08,0x00,0x0a,0xdd,0x03,0x05,0x00,0x00]
38 // VI-ERR
: :28: error
: flat offset modifier is
not supported on this GPU
40 flat_atomic_cmpswap v
[1:2], v
[3:4] offset
:4095
41 // GFX9
: flat_atomic_cmpswap v
[1:2], v
[3:4] offset
:4095 ; encoding
: [0xff,0x0f,0x04,0xdd,0x01,0x03,0x00,0x00]
42 // VI-ERR
: :36: error
: flat offset modifier is
not supported on this GPU
44 flat_atomic_cmpswap v
[1:2], v
[3:4] offset
:4095 slc
45 // GFX9
: flat_atomic_cmpswap v
[1:2], v
[3:4] offset
:4095 slc ; encoding
: [0xff,0x0f,0x06,0xdd,0x01,0x03,0x00,0x00]
46 // VI-ERR
: :36: error
: flat offset modifier is
not supported on this GPU
48 flat_atomic_cmpswap v
[1:2], v
[3:4]
49 // GFX9
: flat_atomic_cmpswap v
[1:2], v
[3:4] ; encoding
: [0x00,0x00,0x04,0xdd,0x01,0x03,0x00,0x00]
50 // VI
: flat_atomic_cmpswap v
[1:2], v
[3:4] ; encoding
: [0x00,0x00,0x04,0xdd,0x01,0x03,0x00,0x00]
52 flat_atomic_cmpswap v
[1:2], v
[3:4] slc
53 // GFX9
: flat_atomic_cmpswap v
[1:2], v
[3:4] slc ; encoding
: [0x00,0x00,0x06,0xdd,0x01,0x03,0x00,0x00]
54 // VI
: flat_atomic_cmpswap v
[1:2], v
[3:4] slc ; encoding
: [0x00,0x00,0x06,0xdd,0x01,0x03,0x00,0x00]
56 flat_atomic_cmpswap v
[1:2], v
[3:4] offset
:4095 glc
57 // GCNERR
: error
: invalid operand for instruction
59 flat_atomic_cmpswap v
[1:2], v
[3:4] glc
60 // GCNERR
: error
: invalid operand for instruction
62 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] offset
:4095 glc
63 // GFX9
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] offset
:4095 glc ; encoding
: [0xff,0x0f,0x05,0xdd,0x01,0x03,0x00,0x00]
64 // VI-ERR
: :40: error
: flat offset modifier is
not supported on this GPU
66 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] offset
:4095 glc slc
67 // GFX9
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] offset
:4095 glc slc ; encoding
: [0xff,0x0f,0x07,0xdd,0x01,0x03,0x00,0x00]
68 // VI-ERR
: :40: error
: flat offset modifier is
not supported on this GPU
70 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc
71 // GFX9
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc ; encoding
: [0x00,0x00,0x05,0xdd,0x01,0x03,0x00,0x00]
72 // VI
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc ; encoding
: [0x00,0x00,0x05,0xdd,0x01,0x03,0x00,0x00]
74 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc slc
75 // GFX9
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc slc ; encoding
: [0x00,0x00,0x07,0xdd,0x01,0x03,0x00,0x00]
76 // VI
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc slc ; encoding
: [0x00,0x00,0x07,0xdd,0x01,0x03,0x00,0x00]
78 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4]
79 // GFX9
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc ; encoding
: [0x00,0x00,0x05,0xdd,0x01,0x03,0x00,0x00]
80 // VI
: flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] glc ; encoding
: [0x00,0x00,0x05,0xdd,0x01,0x03,0x00,0x00]
82 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] offset
:4095
83 // GCNERR
: error
: too few operands for instruction
85 flat_atomic_cmpswap v0
, v
[1:2], v
[3:4] slc
86 // GCNERR
: error
: invalid operand for instruction
88 flat_atomic_swap v
[3:4], v5 offset
:16
89 // GFX9
: flat_atomic_swap v
[3:4], v5 offset
:16 ; encoding
: [0x10,0x00,0x00,0xdd,0x03,0x05,0x00,0x00]
90 // VI-ERR
: :29: error
: flat offset modifier is
not supported on this GPU
92 flat_store_dword v
[3:4], v1 offset
:16
93 // GFX9
: flat_store_dword v
[3:4], v1 offset
:16 ; encoding
: [0x10,0x00,0x70,0xdc,0x03,0x01,0x00,0x00]
94 // VI-ERR
: :29: error
: flat offset modifier is
not supported on this GPU
96 flat_store_dword v
[3:4], v1
, off
97 // GCNERR
: :30: error
: invalid operand for instruction
99 flat_store_dword v
[3:4], v1
, s
[0:1]
100 // GCNERR
: :30: error
: invalid operand for instruction
102 flat_store_dword v
[3:4], v1
, s0
103 // GCNERR
: :30: error
: invalid operand for instruction
105 flat_load_dword v1
, v
[3:4], off
106 // GCNERR
: :29: error
: invalid operand for instruction
108 flat_load_dword v1
, v
[3:4], s
[0:1]
109 // GCNERR
: :29: error
: invalid operand for instruction
111 flat_load_dword v1
, v
[3:4], s0
112 // GCNERR
: :29: error
: invalid operand for instruction
114 flat_load_dword v1
, v
[3:4], exec_hi
115 // GCNERR
: :29: error
: invalid operand for instruction
117 flat_store_dword v
[3:4], v1
, exec_hi
118 // GCNERR
: :30: error
: invalid operand for instruction
120 flat_load_ubyte_d16 v1
, v
[3:4]
121 // GFX9
: flat_load_ubyte_d16 v1
, v
[3:4] ; encoding
: [0x00,0x00,0x80,0xdc,0x03,0x00,0x00,0x01]
122 // VI-ERR
: error
: instruction
not supported on this GPU
124 flat_load_ubyte_d16_hi v1
, v
[3:4]
125 // GFX9
: flat_load_ubyte_d16_hi v1
, v
[3:4] ; encoding
: [0x00,0x00,0x84,0xdc,0x03,0x00,0x00,0x01]
126 // VI-ERR
: error
: instruction
not supported on this GPU
128 flat_load_sbyte_d16 v1
, v
[3:4]
129 // GFX9
: flat_load_sbyte_d16 v1
, v
[3:4] ; encoding
: [0x00,0x00,0x88,0xdc,0x03,0x00,0x00,0x01]
130 // VI-ERR
: error
: instruction
not supported on this GPU
132 flat_load_sbyte_d16_hi v1
, v
[3:4]
133 // GFX9
: flat_load_sbyte_d16_hi v1
, v
[3:4] ; encoding
: [0x00,0x00,0x8c,0xdc,0x03,0x00,0x00,0x01]
134 // VI-ERR
: error
: instruction
not supported on this GPU
136 flat_load_short_d16 v1
, v
[3:4]
137 // GFX9
: flat_load_short_d16 v1
, v
[3:4] ; encoding
: [0x00,0x00,0x90,0xdc,0x03,0x00,0x00,0x01]
138 // VI-ERR
: error
: instruction
not supported on this GPU
140 flat_load_short_d16_hi v1
, v
[3:4]
141 // GFX9
: flat_load_short_d16_hi v1
, v
[3:4] ; encoding
: [0x00,0x00,0x94,0xdc,0x03,0x00,0x00,0x01]
142 // VI-ERR
: error
: instruction
not supported on this GPU
144 flat_store_byte_d16_hi v
[3:4], v1
145 // GFX9
: flat_store_byte_d16_hi v
[3:4], v1 ; encoding
: [0x00,0x00,0x64,0xdc,0x03,0x01,0x00,0x00]
146 // VI-ERR
: error
: instruction
not supported on this GPU
148 flat_store_short_d16_hi v
[3:4], v1
149 // GFX9
: flat_store_short_d16_hi v
[3:4], v1 ; encoding
: [0x00,0x00,0x6c,0xdc,0x03,0x01,0x00,0x00
150 // VI-ERR
: error
: instruction
not supported on this GPU