Skip to content

Commit cb1530f

Browse files
committed
[AArch64][llvm] Armv9.7-A: Add support for SVE2p3 arithmetic operations
Add instructions for SVE2p3 arithmetic operations: - `ADDQP` (add pairwise within quadword vector segments) - `ADDSUBP` (add subtract pairwise) - `SABAL` (two-way signed absolute difference sum and accumulate long) - `SUBP` (subtract pairwise) - `UABAL` (two-way unsigned absolute difference sum and accumulate long) as documented here: * https://developer.arm.com/documentation/ddi0602/2025-09/ * https://developer.arm.com/documentation/109697/2025_09/2025-Architecture-Extensions
1 parent 970f746 commit cb1530f

File tree

14 files changed

+530
-21
lines changed

14 files changed

+530
-21
lines changed

clang/test/Driver/aarch64-v97a.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@
66
// RUN: %clang -target aarch64 -mlittle-endian -march=armv9.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A %s
77
// RUN: %clang -target aarch64_be -mlittle-endian -march=armv9.7a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A %s
88
// RUN: %clang -target aarch64_be -mlittle-endian -march=armv9.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A %s
9-
// GENERICV97A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}}
9+
// GENERICV97A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}} "-target-feature" "+sve2p3"
1010

1111
// RUN: %clang -target aarch64_be -march=armv9.7a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
1212
// RUN: %clang -target aarch64_be -march=armv9.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
1313
// RUN: %clang -target aarch64 -mbig-endian -march=armv9.7a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
1414
// RUN: %clang -target aarch64 -mbig-endian -march=armv9.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
1515
// RUN: %clang -target aarch64_be -mbig-endian -march=armv9.7a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
1616
// RUN: %clang -target aarch64_be -mbig-endian -march=armv9.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV97A-BE %s
17-
// GENERICV97A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}}
17+
// GENERICV97A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}} "-target-feature" "+sve2p3"
1818

1919
// ===== Features supported on aarch64 =====
2020

21+
// RUN: %clang -target aarch64 -march=armv9.7a+sme2p3 -### -c %s 2>&1 | FileCheck -check-prefix=V97A-SME2p3 %s
22+
// RUN: %clang -target aarch64 -march=armv9.7-a+sme2p3 -### -c %s 2>&1 | FileCheck -check-prefix=V97A-SME2p3 %s
23+
// V97A-SME2p3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}} "-target-feature" "+sme2p3"
24+
25+
// RUN: %clang -target aarch64 -march=armv9.7a+sve2p3 -### -c %s 2>&1 | FileCheck -check-prefix=V97A-SVE2p3 %s
26+
// RUN: %clang -target aarch64 -march=armv9.7-a+sve2p3 -### -c %s 2>&1 | FileCheck -check-prefix=V97A-SVE2p3 %s
27+
// V97A-SVE2p3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}} "-target-feature" "+sve2p3"
28+
2129
// RUN: %clang -target aarch64 -march=armv9.7a+cmh -### -c %s 2>&1 | FileCheck -check-prefix=V97A-CMH %s
2230
// RUN: %clang -target aarch64 -march=armv9.7-a+cmh -### -c %s 2>&1 | FileCheck -check-prefix=V97A-CMH %s
2331
// V97A-CMH: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.7a"{{.*}} "-target-feature" "+cmh"

clang/test/Driver/print-supported-extensions-aarch64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
// CHECK-NEXT: sme2 FEAT_SME2 Enable Scalable Matrix Extension 2 (SME2) instructions
8282
// CHECK-NEXT: sme2p1 FEAT_SME2p1 Enable Scalable Matrix Extension 2.1 instructions
8383
// CHECK-NEXT: sme2p2 FEAT_SME2p2 Enable Armv9.6-A Scalable Matrix Extension 2.2 instructions
84+
// CHECK-NEXT: sme2p3 FEAT_SME2p3 Enable Armv9.7-A Scalable Matrix Extension 2.3 instructions
8485
// CHECK-NEXT: profile FEAT_SPE Enable Statistical Profiling extension
8586
// CHECK-NEXT: predres2 FEAT_SPECRES2 Enable Speculation Restriction Instruction
8687
// CHECK-NEXT: ssbs FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
@@ -106,6 +107,7 @@
106107
// CHECK-NEXT: sve2-sm4 Shorthand for +sve2+sve-sm4
107108
// CHECK-NEXT: sve2p1 FEAT_SVE2p1 Enable Scalable Vector Extension 2.1 instructions
108109
// CHECK-NEXT: sve2p2 FEAT_SVE2p2 Enable Armv9.6-A Scalable Vector Extension 2.2 instructions
110+
// CHECK-NEXT: sve2p3 FEAT_SVE2p3 Enable Armv9.7-A Scalable Vector Extension 2.3 instructions
109111
// CHECK-NEXT: the FEAT_THE Enable Armv8.9-A Translation Hardening Extension
110112
// CHECK-NEXT: tlbid FEAT_TLBID Enable Armv9.7-A TLBI Domains extension
111113
// CHECK-NEXT: tlbiw FEAT_TLBIW Enable Armv9.5-A TLBI VMALL for Dirty State

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ def SVEUnsupported : AArch64Unsupported {
7373
SVE2Unsupported.F);
7474
}
7575

76-
let F = [HasSME2p2, HasSVE2p2_or_SME2p2, HasNonStreamingSVE_or_SME2p2,
77-
HasNonStreamingSVE2p2_or_SME2p2] in
78-
def SME2p2Unsupported : AArch64Unsupported;
76+
def SME2p3Unsupported : AArch64Unsupported {
77+
let F = [HasSVE2p3_or_SME2p3];
78+
}
79+
80+
def SME2p2Unsupported : AArch64Unsupported {
81+
let F = !listconcat([HasSME2p2, HasSVE2p2_or_SME2p2,
82+
HasNonStreamingSVE_or_SME2p2,
83+
HasNonStreamingSVE2p2_or_SME2p2],
84+
SME2p3Unsupported.F);
85+
}
7986

8087
def SME2p1Unsupported : AArch64Unsupported {
8188
let F = !listconcat([HasSME2p1, HasSVE2p1_or_SME2p1,

llvm/lib/Target/AArch64/AArch64Features.td

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,12 @@ def FeatureMTETC: ExtensionWithMArch<"mtetc", "MTETC", "FEAT_MTETC",
607607
def FeatureGCIE: ExtensionWithMArch<"gcie", "GCIE", "FEAT_GCIE",
608608
"Enable Armv9.7-A GICv5 (Generic Interrupt Controller) CPU Interface Extension", [FeatureNMI]>;
609609

610+
def FeatureSVE2p3 : ExtensionWithMArch<"sve2p3", "SVE2p3", "FEAT_SVE2p3",
611+
"Enable Armv9.7-A Scalable Vector Extension 2.3 instructions", [FeatureSVE2p2]>;
612+
613+
def FeatureSME2p3 : ExtensionWithMArch<"sme2p3", "SME2p3", "FEAT_SME2p3",
614+
"Enable Armv9.7-A Scalable Matrix Extension 2.3 instructions", [FeatureSME2p2]>;
615+
610616
//===----------------------------------------------------------------------===//
611617
// Other Features
612618
//===----------------------------------------------------------------------===//
@@ -966,8 +972,8 @@ def HasV9_6aOps : Architecture64<9, 6, "a", "v9.6a",
966972
!listconcat(HasV9_5aOps.DefaultExts, [FeatureCMPBR, FeatureFPRCVT, FeatureSVE2p2,
967973
FeatureLSUI, FeatureOCCMO])>;
968974
def HasV9_7aOps : Architecture64<9, 7, "a", "v9.7a",
969-
[HasV9_6aOps],
970-
!listconcat(HasV9_6aOps.DefaultExts, [])>;
975+
[HasV9_6aOps, FeatureSVE2p3],
976+
!listconcat(HasV9_6aOps.DefaultExts, [FeatureSVE2p3])>;
971977
def HasV8_0rOps : Architecture64<8, 0, "r", "v8r",
972978
[ //v8.1
973979
FeatureCRC, FeaturePAN, FeatureLSE, FeatureCONTEXTIDREL2,

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ def HasSVE2p2_or_SME2p2
315315
: Predicate<"Subtarget->isSVEorStreamingSVEAvailable() && (Subtarget->hasSVE2p2() || Subtarget->hasSME2p2())">,
316316
AssemblerPredicateWithAll<(any_of FeatureSME2p2, FeatureSVE2p2),
317317
"sme2p2 or sve2p2">;
318+
def HasSVE2p3_or_SME2p3
319+
: Predicate<"Subtarget->isSVEorStreamingSVEAvailable() && (Subtarget->hasSVE2p3() || Subtarget->hasSME2p3())">,
320+
AssemblerPredicateWithAll<(any_of FeatureSME2p3, FeatureSVE2p3),
321+
"sme2p3 or sve2p3">;
318322
def HasNonStreamingSVE2p2_or_SME2p2
319323
: Predicate<"(Subtarget->isSVEAvailable() && Subtarget->hasSVE2p2()) ||"
320324
"(Subtarget->isSVEorStreamingSVEAvailable() && Subtarget->hasSME2p2())">,

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4615,6 +4615,24 @@ let Predicates = [HasSVE2p2_or_SME2p2] in {
46154615
defm REVD_ZPzZ : sve_int_perm_rev_revd_z<"revd", AArch64revd_mt>;
46164616
} // End HasSME2p2orSVE2p2
46174617

4618+
4619+
//===----------------------------------------------------------------------===//
4620+
// SME2.3 or SVE2.3 instructions
4621+
//===----------------------------------------------------------------------===//
4622+
let Predicates = [HasSVE2p3_or_SME2p3] in {
4623+
// SVE2 Add pairwise within quadword vector segments (unpredicated)
4624+
defm ADDQP_ZZZ : sve2_int_mul<0b110, "addqp", null_frag>;
4625+
4626+
// SVE2 Add subtract/subtract pairwise
4627+
defm ADDSUBP_ZZZ : sve2_int_mul<0b111, "addsubp", null_frag>;
4628+
defm SUBP_ZPmZ : sve2_int_arith_pred<0b100001, "subp", null_frag>;
4629+
4630+
// SVE2 integer absolute difference and accumulate long
4631+
defm SABAL_ZZZ : sve2_int_two_way_absdiff_accum_long<0b0, "sabal">;
4632+
defm UABAL_ZZZ : sve2_int_two_way_absdiff_accum_long<0b1, "uabal">;
4633+
4634+
} // End HasSME2p2orSVE2p2
4635+
46184636
//===----------------------------------------------------------------------===//
46194637
// SME2.2 or SVE2.2 instructions - Legal in streaming mode iff target has SME2p2
46204638
//===----------------------------------------------------------------------===//

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3890,6 +3890,8 @@ static const struct Extension {
38903890
{"mpamv2", {AArch64::FeatureMPAMv2}},
38913891
{"mtetc", {AArch64::FeatureMTETC}},
38923892
{"gcie", {AArch64::FeatureGCIE}},
3893+
{"sme2p3", {AArch64::FeatureSME2p3}},
3894+
{"sve2p3", {AArch64::FeatureSVE2p3}},
38933895
};
38943896

38953897
static void setRequiredFeatureString(FeatureBitset FBS, std::string &Str) {

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,7 +4085,7 @@ class sve2_int_arith_pred<bits<2> sz, bits<6> opc, string asm,
40854085
bits<5> Zdn;
40864086
let Inst{31-24} = 0b01000100;
40874087
let Inst{23-22} = sz;
4088-
let Inst{21-20} = 0b01;
4088+
let Inst{21} = 0b0;
40894089
let Inst{20-16} = opc{5-1};
40904090
let Inst{15-14} = 0b10;
40914091
let Inst{13} = opc{0};
@@ -4590,15 +4590,15 @@ multiclass sve2_int_cadd<bit opc, string asm, SDPatternOperator op> {
45904590
def : SVE_3_Op_Imm_Pat<nxv2i64, op, nxv2i64, nxv2i64, i32, complexrotateopodd, !cast<Instruction>(NAME # _D)>;
45914591
}
45924592

4593-
class sve2_int_absdiff_accum<bits<2> sz, bits<4> opc, string asm,
4593+
class sve2_int_absdiff_accum<bits<3> sz, bits<4> opc, string asm,
45944594
ZPRRegOp zprty1, ZPRRegOp zprty2>
45954595
: I<(outs zprty1:$Zda), (ins zprty1:$_Zda, zprty2:$Zn, zprty2:$Zm),
45964596
asm, "\t$Zda, $Zn, $Zm", "", []>, Sched<[]> {
45974597
bits<5> Zda;
45984598
bits<5> Zn;
45994599
bits<5> Zm;
4600-
let Inst{31-24} = 0b01000101;
4601-
let Inst{23-22} = sz;
4600+
let Inst{31-25} = 0b0100010;
4601+
let Inst{24-22} = sz;
46024602
let Inst{21} = 0b0;
46034603
let Inst{20-16} = Zm;
46044604
let Inst{15-14} = 0b11;
@@ -4613,10 +4613,10 @@ class sve2_int_absdiff_accum<bits<2> sz, bits<4> opc, string asm,
46134613
}
46144614

46154615
multiclass sve2_int_absdiff_accum<bit opc, string asm, SDPatternOperator op> {
4616-
def _B : sve2_int_absdiff_accum<0b00, { 0b111, opc }, asm, ZPR8, ZPR8>;
4617-
def _H : sve2_int_absdiff_accum<0b01, { 0b111, opc }, asm, ZPR16, ZPR16>;
4618-
def _S : sve2_int_absdiff_accum<0b10, { 0b111, opc }, asm, ZPR32, ZPR32>;
4619-
def _D : sve2_int_absdiff_accum<0b11, { 0b111, opc }, asm, ZPR64, ZPR64>;
4616+
def _B : sve2_int_absdiff_accum<0b100, { 0b111, opc }, asm, ZPR8, ZPR8>;
4617+
def _H : sve2_int_absdiff_accum<0b101, { 0b111, opc }, asm, ZPR16, ZPR16>;
4618+
def _S : sve2_int_absdiff_accum<0b110, { 0b111, opc }, asm, ZPR32, ZPR32>;
4619+
def _D : sve2_int_absdiff_accum<0b111, { 0b111, opc }, asm, ZPR64, ZPR64>;
46204620

46214621
def : SVE_3_Op_Pat<nxv16i8, op, nxv16i8, nxv16i8, nxv16i8, !cast<Instruction>(NAME # _B)>;
46224622
def : SVE_3_Op_Pat<nxv8i16, op, nxv8i16, nxv8i16, nxv8i16, !cast<Instruction>(NAME # _H)>;
@@ -4626,20 +4626,26 @@ multiclass sve2_int_absdiff_accum<bit opc, string asm, SDPatternOperator op> {
46264626

46274627
multiclass sve2_int_absdiff_accum_long<bits<2> opc, string asm,
46284628
SDPatternOperator op> {
4629-
def _H : sve2_int_absdiff_accum<0b01, { 0b00, opc }, asm, ZPR16, ZPR8>;
4630-
def _S : sve2_int_absdiff_accum<0b10, { 0b00, opc }, asm, ZPR32, ZPR16>;
4631-
def _D : sve2_int_absdiff_accum<0b11, { 0b00, opc }, asm, ZPR64, ZPR32>;
4629+
def _H : sve2_int_absdiff_accum<0b101, { 0b00, opc }, asm, ZPR16, ZPR8>;
4630+
def _S : sve2_int_absdiff_accum<0b110, { 0b00, opc }, asm, ZPR32, ZPR16>;
4631+
def _D : sve2_int_absdiff_accum<0b111, { 0b00, opc }, asm, ZPR64, ZPR32>;
46324632

46334633
def : SVE_3_Op_Pat<nxv8i16, op, nxv8i16, nxv16i8, nxv16i8, !cast<Instruction>(NAME # _H)>;
46344634
def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv8i16, nxv8i16, !cast<Instruction>(NAME # _S)>;
46354635
def : SVE_3_Op_Pat<nxv2i64, op, nxv2i64, nxv4i32, nxv4i32, !cast<Instruction>(NAME # _D)>;
46364636
}
46374637

4638+
multiclass sve2_int_two_way_absdiff_accum_long<bit U, string asm> {
4639+
def _BtoH : sve2_int_absdiff_accum<0b001, { 0b01, U, 0b1 }, asm, ZPR16, ZPR8>;
4640+
def _HtoS : sve2_int_absdiff_accum<0b010, { 0b01, U, 0b1 }, asm, ZPR32, ZPR16>;
4641+
def _StoD : sve2_int_absdiff_accum<0b011, { 0b01, U, 0b1 }, asm, ZPR64, ZPR32>;
4642+
}
4643+
46384644
multiclass sve2_int_addsub_long_carry<bits<2> opc, string asm,
46394645
SDPatternOperator op> {
4640-
def _S : sve2_int_absdiff_accum<{ opc{1}, 0b0 }, { 0b010, opc{0} }, asm,
4646+
def _S : sve2_int_absdiff_accum<{ 0b1, opc{1}, 0b0 }, { 0b010, opc{0} }, asm,
46414647
ZPR32, ZPR32>;
4642-
def _D : sve2_int_absdiff_accum<{ opc{1}, 0b1 }, { 0b010, opc{0} }, asm,
4648+
def _D : sve2_int_absdiff_accum<{ 0b1, opc{1}, 0b1 }, { 0b010, opc{0} }, asm,
46434649
ZPR64, ZPR64>;
46444650

46454651
def : SVE_3_Op_Pat<nxv4i32, op, nxv4i32, nxv4i32, nxv4i32, !cast<Instruction>(NAME # _S)>;
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p3 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Test addqp
5+
6+
addqp z0.h, z0.b, z0.b
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: addqp z0.h, z0.b, z0.b
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
addqp z0.s, z0.h, z0.h
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: addqp z0.s, z0.h, z0.h
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
addqp z0.d, z0.s, z0.s
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18+
// CHECK-NEXT: addqp z0.d, z0.s, z0.s
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
addqp z0.b, z0.d, z0.d
22+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
23+
// CHECK-NEXT: addqp z0.b, z0.d, z0.d
24+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25+
26+
// --------------------------------------------------------------------------//
27+
// Test addsubp
28+
29+
addsubp z0.h, z0.b, z0.b
30+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
31+
// CHECK-NEXT: addsubp z0.h, z0.b, z0.b
32+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33+
34+
addsubp z0.s, z0.h, z0.h
35+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
36+
// CHECK-NEXT: addsubp z0.s, z0.h, z0.h
37+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38+
39+
addsubp z0.d, z0.s, z0.s
40+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
41+
// CHECK-NEXT: addsubp z0.d, z0.s, z0.s
42+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
43+
44+
addsubp z0.b, z0.d, z0.d
45+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
46+
// CHECK-NEXT: addsubp z0.b, z0.d, z0.d
47+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
48+
49+
// --------------------------------------------------------------------------//
50+
// Test sabal
51+
52+
sabal z0.b, z0.b, z0.b
53+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
54+
// CHECK-NEXT: sabal z0.b, z0.b, z0.b
55+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
56+
57+
sabal z0.h, z0.h, z0.h
58+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
59+
// CHECK-NEXT: sabal z0.h, z0.h, z0.h
60+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
61+
62+
sabal z0.s, z0.s, z0.s
63+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
64+
// CHECK-NEXT: sabal z0.s, z0.s, z0.s
65+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
66+
67+
sabal z0.d, z0.d, z0.d
68+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
69+
// CHECK-NEXT: sabal z0.d, z0.d, z0.d
70+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
71+
72+
// --------------------------------------------------------------------------//
73+
// Test uabal
74+
75+
uabal z0.b, z0.b, z0.b
76+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
77+
// CHECK-NEXT: uabal z0.b, z0.b, z0.b
78+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
79+
80+
uabal z0.h, z0.h, z0.h
81+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
82+
// CHECK-NEXT: uabal z0.h, z0.h, z0.h
83+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
84+
85+
uabal z0.s, z0.s, z0.s
86+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
87+
// CHECK-NEXT: uabal z0.s, z0.s, z0.s
88+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
89+
90+
uabal z0.d, z0.d, z0.d
91+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
92+
// CHECK-NEXT: uabal z0.d, z0.d, z0.d
93+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
94+
95+
// --------------------------------------------------------------------------//
96+
// Test subp
97+
98+
subp z0.h, p0/m, z0.b, z0.b
99+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
100+
// CHECK-NEXT: subp z0.h, p0/m, z0.b, z0.b
101+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
102+
103+
subp z0.s, p0/m, z0.h, z0.h
104+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
105+
// CHECK-NEXT: subp z0.s, p0/m, z0.h, z0.h
106+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
107+
108+
subp z0.d, p0/m, z0.s, z0.s
109+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
110+
// CHECK-NEXT: subp z0.d, p0/m, z0.s, z0.s
111+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
112+
113+
subp z0.b, p0/m, z0.d, z0.d
114+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
115+
// CHECK-NEXT: subp z0.b, p0/m, z0.d, z0.d
116+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
117+
118+
// --------------------------------------------------------------------------//
119+
// Predicate not in restricted predicate range
120+
121+
subp z0.h, p8/m, z0.b, z0.b
122+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
123+
// CHECK-NEXT: subp z0.h, p8/m, z0.b, z0.b
124+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
125+
126+
// --------------------------------------------------------------------------//
127+
// Operand must match destination register
128+
129+
subp z0.b, p0/m, z1.b, z2.b
130+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register
131+
// CHECK-NEXT: subp z0.b, p0/m, z1.b, z2.b
132+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
133+
134+
// --------------------------------------------------------------------------//
135+
// Negative tests for instructions that are incompatible with movprfx
136+
137+
movprfx z0, z7
138+
addqp z0.b, z0.b, z0.b
139+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
140+
// CHECK-NEXT: addqp z0.b, z0.b, z0.b
141+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
142+
143+
movprfx z0, z7
144+
addsubp z0.b, z0.b, z0.b
145+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
146+
// CHECK-NEXT: addsubp z0.b, z0.b, z0.b
147+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)