xref: /aosp_15_r20/external/llvm/test/MC/AMDGPU/reg-syntax-extra.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2*9880d681SAndroid Build Coastguard Worker// RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
3*9880d681SAndroid Build Coastguard Worker// RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI %s
4*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workers_mov_b32 [ttmp5], [ttmp3]
7*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b32 ttmp5, ttmp3          ; encoding: [0x73,0x03,0xf5,0xbe]
8*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b32 ttmp5, ttmp3          ; encoding: [0x73,0x00,0xf5,0xbe]
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workers_mov_b64 [ttmp4,ttmp5], [ttmp2,ttmp3]
11*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 ttmp[4:5], ttmp[2:3]  ; encoding: [0x72,0x04,0xf4,0xbe]
12*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 ttmp[4:5], ttmp[2:3]  ; encoding: [0x72,0x01,0xf4,0xbe]
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workers_mov_b64 ttmp[4:5], ttmp[2:3]
15*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 ttmp[4:5], ttmp[2:3]  ; encoding: [0x72,0x04,0xf4,0xbe]
16*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 ttmp[4:5], ttmp[2:3]  ; encoding: [0x72,0x01,0xf4,0xbe]
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workers_mov_b64 [s6,s7], s[8:9]
19*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 s[6:7], s[8:9]        ; encoding: [0x08,0x04,0x86,0xbe]
20*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 s[6:7], s[8:9]        ; encoding: [0x08,0x01,0x86,0xbe]
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workers_mov_b64 s[6:7], [s8,s9]
23*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 s[6:7], s[8:9]        ; encoding: [0x08,0x04,0x86,0xbe]
24*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 s[6:7], s[8:9]        ; encoding: [0x08,0x01,0x86,0xbe]
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workers_mov_b64 [exec_lo,exec_hi], s[2:3]
27*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 exec, s[2:3]          ; encoding: [0x02,0x04,0xfe,0xbe]
28*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 exec, s[2:3]          ; encoding: [0x02,0x01,0xfe,0xbe]
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workers_mov_b64 [flat_scratch_lo,flat_scratch_hi], s[2:3]
31*9880d681SAndroid Build Coastguard Worker// NOSICI: error:
32*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 flat_scratch, s[2:3]  ; encoding: [0x02,0x01,0xe6,0xbe]
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workers_mov_b64 [vcc_lo,vcc_hi], s[2:3]
35*9880d681SAndroid Build Coastguard Worker// SICI: s_mov_b64 vcc, s[2:3]           ; encoding: [0x02,0x04,0xea,0xbe]
36*9880d681SAndroid Build Coastguard Worker// VI:   s_mov_b64 vcc, s[2:3]           ; encoding: [0x02,0x01,0xea,0xbe]
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workers_mov_b64 [tba_lo,tba_hi], s[2:3]
39*9880d681SAndroid Build Coastguard Worker// SICI:  s_mov_b64 tba, s[2:3]           ; encoding: [0x02,0x04,0xec,0xbe]
40*9880d681SAndroid Build Coastguard Worker// VI:    s_mov_b64 tba, s[2:3]           ; encoding: [0x02,0x01,0xec,0xbe]
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workers_mov_b64 [tma_lo,tma_hi], s[2:3]
43*9880d681SAndroid Build Coastguard Worker// SICI:  s_mov_b64 tma, s[2:3]           ; encoding: [0x02,0x04,0xee,0xbe]
44*9880d681SAndroid Build Coastguard Worker// VI:    s_mov_b64 tma, s[2:3]           ; encoding: [0x02,0x01,0xee,0xbe]
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerv_mov_b32 [v1], [v2]
47*9880d681SAndroid Build Coastguard Worker// GCN:  v_mov_b32_e32 v1, v2 ; encoding: [0x02,0x03,0x02,0x7e]
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Workerv_rcp_f64 [v1,v2], [v2,v3]
50*9880d681SAndroid Build Coastguard Worker// SICI: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x5f,0x02,0x7e]
51*9880d681SAndroid Build Coastguard Worker// VI:   v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x4b,0x02,0x7e]
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Workerbuffer_load_dwordx4 [v1,v2,v3,v4], off, [s4,s5,s6,s7], s1
54*9880d681SAndroid Build Coastguard Worker// SICI: buffer_load_dwordx4 v[1:4], off, s[4:7], s1 ; encoding: [0x00,0x00,0x38,0xe0,0x00,0x01,0x01,0x01]
55*9880d681SAndroid Build Coastguard Worker// VI:   buffer_load_dwordx4 v[1:4], off, s[4:7], s1 ; encoding: [0x00,0x00,0x5c,0xe0,0x00,0x01,0x01,0x01]
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerbuffer_load_dword v1, off, [ttmp4,ttmp5,ttmp6,ttmp7], s1
58*9880d681SAndroid Build Coastguard Worker// SICI: buffer_load_dword v1, off, ttmp[4:7], s1 ; encoding: [0x00,0x00,0x30,0xe0,0x00,0x01,0x1d,0x01]
59*9880d681SAndroid Build Coastguard Worker// VI:   buffer_load_dword v1, off, ttmp[4:7], s1 ; encoding: [0x00,0x00,0x50,0xe0,0x00,0x01,0x1d,0x01]
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Workerbuffer_store_format_xyzw v[1:4], off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1
62*9880d681SAndroid Build Coastguard Worker// SICI: buffer_store_format_xyzw v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x1c,0xe0,0x00,0x01,0x1d,0x71]
63*9880d681SAndroid Build Coastguard Worker// VI:   buffer_store_format_xyzw v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x1c,0xe0,0x00,0x01,0x1d,0x71]
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerbuffer_load_ubyte v1, off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1
66*9880d681SAndroid Build Coastguard Worker// SICI: buffer_load_ubyte v1, off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x20,0xe0,0x00,0x01,0x1d,0x71]
67*9880d681SAndroid Build Coastguard Worker// VI:   buffer_load_ubyte v1, off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x40,0xe0,0x00,0x01,0x1d,0x71]
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerbuffer_store_dwordx4 v[1:4], off, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp1
70*9880d681SAndroid Build Coastguard Worker// SICI: buffer_store_dwordx4 v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x78,0xe0,0x00,0x01,0x1d,0x71]
71*9880d681SAndroid Build Coastguard Worker// VI:   buffer_store_dwordx4 v[1:4], off, ttmp[4:7], ttmp1 ; encoding: [0x00,0x00,0x7c,0xe0,0x00,0x01,0x1d,0x71]
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Workers_load_dwordx4 [ttmp4,ttmp5,ttmp6,ttmp7], [ttmp2,ttmp3], ttmp4
74*9880d681SAndroid Build Coastguard Worker// SICI: s_load_dwordx4 ttmp[4:7], ttmp[2:3], ttmp4 ; encoding: [0x74,0x72,0xba,0xc0]
75*9880d681SAndroid Build Coastguard Worker// VI:	 s_load_dwordx4 ttmp[4:7], ttmp[2:3], ttmp4 ; encoding: [0x39,0x1d,0x08,0xc0,0x74,0x00,0x00,0x00]
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Workers_buffer_load_dword ttmp1, [ttmp4,ttmp5,ttmp6,ttmp7], ttmp4
78*9880d681SAndroid Build Coastguard Worker// SICI: s_buffer_load_dword ttmp1, ttmp[4:7], ttmp4 ; encoding: [0x74,0xf4,0x38,0xc2]
79*9880d681SAndroid Build Coastguard Worker// VI:	 s_buffer_load_dword ttmp1, ttmp[4:7], ttmp4 ; encoding: [0x7a,0x1c,0x20,0xc0,0x74,0x00,0x00,0x00]
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Workers_buffer_load_dwordx4 [ttmp8,ttmp9,ttmp10,ttmp11], [ttmp4,ttmp5,ttmp6,ttmp7], ttmp4
82*9880d681SAndroid Build Coastguard Worker// SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2]
83*9880d681SAndroid Build Coastguard Worker// VI:   s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00]
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Workers_buffer_load_dwordx4 [ttmp[8],ttmp[8+1],ttmp[5*2],ttmp[(3+2)*2+1]], ttmp[45/11:(33+45)/11], ttmp4
86*9880d681SAndroid Build Coastguard Worker// SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2]
87*9880d681SAndroid Build Coastguard Worker// VI:   s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00]
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Workers_buffer_load_dwordx4 ttmp[7+1:(3+2)*2+1], [ttmp[45/11],ttmp[5],ttmp6,ttmp[(33+45)/11]], ttmp4
90*9880d681SAndroid Build Coastguard Worker// SICI: s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x74,0x74,0xbc,0xc2]
91*9880d681SAndroid Build Coastguard Worker// VI:   s_buffer_load_dwordx4 ttmp[8:11], ttmp[4:7], ttmp4 ; encoding: [0x3a,0x1e,0x28,0xc0,0x74,0x00,0x00,0x00]
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Workerflat_load_dword v[8:8], v[2:3]
94*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dword v8, v[2:3]      ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08]
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard Workerflat_load_dword v[63/8+1:65/8], v[2:3]
97*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dword v8, v[2:3]      ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08]
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerflat_load_dword v8, v[2*2-2:(3+7)/3]
100*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dword v8, v[2:3]      ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08]
101*9880d681SAndroid Build Coastguard Worker
102*9880d681SAndroid Build Coastguard Workerflat_load_dword v[63/8+1], v[2:3]
103*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dword v8, v[2:3]      ; encoding: [0x00,0x00,0x50,0xdc,0x02,0x00,0x00,0x08]
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard Workerflat_load_dwordx4 v[8:11], v[2*2-2:(3*3-6)]
106*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08]
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Workerflat_load_dwordx4 v[8/2+4:11/2+6], v[2:3]
109*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08]
110*9880d681SAndroid Build Coastguard Worker
111*9880d681SAndroid Build Coastguard Workerflat_load_dwordx4   [v[8/2+4],v9,v[10],v[11/2+6]], v[2:3]
112*9880d681SAndroid Build Coastguard Worker// VI:   flat_load_dwordx4 v[8:11], v[2:3] ; encoding: [0x00,0x00,0x5c,0xdc,0x02,0x00,0x00,0x08]
113