Skip to content

Commit 0454950

Browse files
[AArch64] Add assembly/disassembly for FMOP4{A,S} (non-widening) double-precision instructions (llvm#113345)
The new instructions are described in https://developer.arm.com/documentation/ddi0602/2024-09/SME-Instructions
1 parent feb2d86 commit 0454950

File tree

4 files changed

+465
-0
lines changed

4 files changed

+465
-0
lines changed

llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,3 +1055,8 @@ let Predicates = [HasSME2p2, HasSMEB16B16] in {
10551055
defm BFMOP4A : sme2_bfmop4as_non_widening<0, "bfmop4a">;
10561056
defm BFMOP4S : sme2_bfmop4as_non_widening<1, "bfmop4s">;
10571057
}
1058+
1059+
let Predicates = [HasSME2p2, HasSMEF64F64] in {
1060+
defm FMOP4A : sme2_fmop4as_fp64_non_widening<0, "fmop4a">;
1061+
defm FMOP4S : sme2_fmop4as_fp64_non_widening<1, "fmop4s">;
1062+
}

llvm/lib/Target/AArch64/SMEInstrFormats.td

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5491,3 +5491,40 @@ multiclass sme2_fmop4as_fp32_non_widening<bit S, string mnemonic> {
54915491
// Multiple vectors
54925492
def _M2Z2Z_S : sme2_fp32_quarter_tile_outer_product<1, 1, S, mnemonic, ZZ_s_mul_r_Lo, ZZ_s_mul_r_Hi>;
54935493
}
5494+
5495+
class sme2_fp64_quarter_tile_outer_product<bit M, bit N, bit S, string mnemonic, RegisterOperand zn_ty, RegisterOperand zm_ty>
5496+
: I<(outs TileOp64:$ZAda),
5497+
(ins TileOp64:$_ZAda, zn_ty:$Zn, zm_ty:$Zm),
5498+
mnemonic, "\t$ZAda, $Zn, $Zm",
5499+
"", []>, Sched<[]> {
5500+
bits<3> ZAda;
5501+
bits<3> Zn;
5502+
bits<3> Zm;
5503+
5504+
let Inst{31-21} = 0b10000000110;
5505+
let Inst{20} = M;
5506+
let Inst{19-17} = Zm;
5507+
let Inst{16-10} = 0b0000000;
5508+
let Inst{9} = N;
5509+
let Inst{8-6} = Zn;
5510+
let Inst{5} = 0;
5511+
let Inst{4} = S;
5512+
let Inst{3} = 0b1;
5513+
let Inst{2-0} = ZAda;
5514+
5515+
let Constraints = "$ZAda = $_ZAda";
5516+
}
5517+
5518+
multiclass sme2_fmop4as_fp64_non_widening<bit S, string mnemonic> {
5519+
// Single vectors
5520+
def _MZZ_D : sme2_fp64_quarter_tile_outer_product<0, 0, S, mnemonic, ZPR64Mul2_Lo, ZPR64Mul2_Hi>;
5521+
5522+
// Multiple and single vectors
5523+
def _M2ZZ_D : sme2_fp64_quarter_tile_outer_product<0, 1, S, mnemonic, ZZ_d_mul_r_Lo, ZPR64Mul2_Hi>;
5524+
5525+
// Single and multiple vectors
5526+
def _MZ2Z_D : sme2_fp64_quarter_tile_outer_product<1, 0, S, mnemonic, ZPR64Mul2_Lo, ZZ_d_mul_r_Hi>;
5527+
5528+
// Multiple vectors
5529+
def _M2Z2Z_D : sme2_fp64_quarter_tile_outer_product<1, 1, S, mnemonic, ZZ_d_mul_r_Lo, ZZ_d_mul_r_Hi>;
5530+
}
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
// RUN: not llvm-mc -triple=aarch64 -mattr=+sme2p2,+sme-f64f64 < %s 2>&1 | FileCheck %s
2+
3+
// FMOP4A
4+
5+
// Single vectors
6+
7+
fmop4a za0.s, z0.d, z16.d
8+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.s..z14.s
9+
10+
fmop4a za8.d, z0.d, z16.d
11+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
12+
13+
fmop4a za0.d, z0.s, z16.d
14+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
15+
16+
fmop4a za0.d, z15.d, z16.d
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
18+
19+
fmop4a za0.d, z16.d, z16.d
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
21+
22+
fmop4a za0.d, z0.d, z16.s
23+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
24+
25+
fmop4a za0.d, z12.d, z17.d
26+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
27+
28+
fmop4a za0.d, z12.d, z14.d
29+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
30+
31+
fmop4a za0.d, z12.d, z31.d
32+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
33+
34+
// Single and multiple vectors
35+
36+
fmop4a za0.s, z0.d, {z16.d-z17.d}
37+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.s..z14.s
38+
39+
fmop4a za8.d, z0.d, {z16.d-z17.d}
40+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
41+
42+
fmop4a za0.d, z0.s, {z16.d-z17.d}
43+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
44+
45+
fmop4a za0.d, z1.d, {z16.d-z17.d}
46+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
47+
48+
fmop4a za0.d, z16.d, {z16.d-z17.d}
49+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
50+
51+
fmop4a za0.d, z0.d, {z16.s-z17.s}
52+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
53+
54+
fmop4a za0.d, z0.d, {z17.d-z18.d}
55+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
56+
57+
fmop4a za0.d, z0.d, {z16.d-z18.d}
58+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
59+
60+
fmop4a za0.d, z0.d, {z12.d-z13.d}
61+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
62+
63+
// Multiple and single vectors
64+
65+
fmop4a za0.s, {z0.d-z1.d}, z16.d
66+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
67+
68+
fmop4a za8.d, {z0.d-z1.d}, z16.d
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
70+
71+
fmop4a za0.d, {z0.s-z1.s}, z16.d
72+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
73+
74+
fmop4a za0.d, {z1.d-z2.d}, z16.d
75+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
76+
77+
fmop4a za0.d, {z0.d-z2.d}, z16.d
78+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
79+
80+
fmop4a za0.d, {z16.d-z17.d}, z16.d
81+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
82+
83+
fmop4a za0.d, {z0.d-z1.d}, z16.s
84+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
85+
86+
fmop4a za0.d, {z0.d-z1.d}, z17.d
87+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
88+
89+
fmop4a za0.d, {z0.d-z1.d}, z12.d
90+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
91+
92+
// Multiple vectors
93+
94+
fmop4a za0.s, {z0.d-z1.d}, {z16.d-z17.d}
95+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
96+
97+
fmop4a za8.d, {z0.d-z1.d}, {z16.d-z17.d}
98+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
99+
100+
fmop4a za0.d, {z0.s-z1.s}, {z16.d-z17.d}
101+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
102+
103+
fmop4a za0.d, {z1.d-z2.d}, {z16.d-z17.d}
104+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
105+
106+
fmop4a za0.d, {z0.d-z2.d}, {z16.d-z17.d}
107+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
108+
109+
fmop4a za0.d, {z18.d-z19.d}, {z16.d-z17.d}
110+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
111+
112+
fmop4a za0.d, {z0.d-z1.d}, {z16.s-z17.s}
113+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
114+
115+
fmop4a za0.d, {z0.d-z1.d}, {z19.d-z20.d}
116+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
117+
118+
fmop4a za0.d, {z0.d-z1.d}, {z16.d-z18.d}
119+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
120+
121+
fmop4a za0.d, {z0.d-z1.d}, {z10.d-z11.d}
122+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
123+
124+
// FMOP4S
125+
126+
// Single vectors
127+
128+
fmop4s za0.s, z0.d, z16.d
129+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.s..z14.s
130+
131+
fmop4s za8.d, z0.d, z16.d
132+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
133+
134+
fmop4s za0.d, z0.s, z16.d
135+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
136+
137+
fmop4s za0.d, z15.d, z16.d
138+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
139+
140+
fmop4s za0.d, z16.d, z16.d
141+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
142+
143+
fmop4s za0.d, z0.d, z16.s
144+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
145+
146+
fmop4s za0.d, z12.d, z17.d
147+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
148+
149+
fmop4s za0.d, z12.d, z14.d
150+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
151+
152+
fmop4s za0.d, z12.d, z31.d
153+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
154+
155+
// Single and multiple vectors
156+
157+
fmop4s za0.s, z0.d, {z16.d-z17.d}
158+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.s..z14.s
159+
160+
fmop4s za8.d, z0.d, {z16.d-z17.d}
161+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
162+
163+
fmop4s za0.d, z0.s, {z16.d-z17.d}
164+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
165+
166+
fmop4s za0.d, z1.d, {z16.d-z17.d}
167+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
168+
169+
fmop4s za0.d, z16.d, {z16.d-z17.d}
170+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.d..z14.d
171+
172+
fmop4s za0.d, z0.d, {z16.s-z17.s}
173+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
174+
175+
fmop4s za0.d, z0.d, {z17.d-z18.d}
176+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
177+
178+
fmop4s za0.d, z0.d, {z16.d-z18.d}
179+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
180+
181+
fmop4s za0.d, z0.d, {z12.d-z13.d}
182+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
183+
184+
// Multiple and single vectors
185+
186+
fmop4s za0.s, {z0.d-z1.d}, z16.d
187+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
188+
189+
fmop4s za8.d, {z0.d-z1.d}, z16.d
190+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
191+
192+
fmop4s za0.d, {z0.s-z1.s}, z16.d
193+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
194+
195+
fmop4s za0.d, {z1.d-z2.d}, z16.d
196+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
197+
198+
fmop4s za0.d, {z0.d-z2.d}, z16.d
199+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
200+
201+
fmop4s za0.d, {z16.d-z17.d}, z16.d
202+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
203+
204+
fmop4s za0.d, {z0.d-z1.d}, z16.s
205+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
206+
207+
fmop4s za0.d, {z0.d-z1.d}, z17.d
208+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
209+
210+
fmop4s za0.d, {z0.d-z1.d}, z12.d
211+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.d..z30.d
212+
213+
// Multiple vectors
214+
215+
fmop4s za0.s, {z0.d-z1.d}, {z16.d-z17.d}
216+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
217+
218+
fmop4s za8.d, {z0.d-z1.d}, {z16.d-z17.d}
219+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
220+
221+
fmop4s za0.d, {z0.s-z1.s}, {z16.d-z17.d}
222+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
223+
224+
fmop4s za0.d, {z1.d-z2.d}, {z16.d-z17.d}
225+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
226+
227+
fmop4s za0.d, {z0.d-z2.d}, {z16.d-z17.d}
228+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
229+
230+
fmop4s za0.d, {z18.d-z19.d}, {z16.d-z17.d}
231+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types
232+
233+
fmop4s za0.d, {z0.d-z1.d}, {z16.s-z17.s}
234+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
235+
236+
fmop4s za0.d, {z0.d-z1.d}, {z19.d-z20.d}
237+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types
238+
239+
fmop4s za0.d, {z0.d-z1.d}, {z16.d-z18.d}
240+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
241+
242+
fmop4s za0.d, {z0.d-z1.d}, {z10.d-z11.d}
243+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types

0 commit comments

Comments
 (0)