Skip to content

Commit 78237b7

Browse files
authored
[AArch64] Fix predicates for FEAT_CPA's SVE-specific instructions (#73923)
Following up on #73777, this fixes the predicate for the SVE-specific FEAT_CPA instructions to require SVE instead of SVE or SME. These instructions should not be availabe if only SME is enabled.
1 parent 1c2a076 commit 78237b7

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4167,7 +4167,7 @@ let Predicates = [HasSVE2orSME2, HasLUT] in {
41674167
//===----------------------------------------------------------------------===//
41684168
// Checked Pointer Arithmetic (FEAT_CPA)
41694169
//===----------------------------------------------------------------------===//
4170-
let Predicates = [HasSVEorSME, HasCPA] in {
4170+
let Predicates = [HasSVE, HasCPA] in {
41714171
// Add/subtract (vectors, unpredicated)
41724172
def ADD_ZZZ_CPA : sve_int_bin_cons_arit_0<0b11, 0b010, "addpt", ZPR64>;
41734173
def SUB_ZZZ_CPA : sve_int_bin_cons_arit_0<0b11, 0b011, "subpt", ZPR64>;
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve -mattr=+cpa < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3-
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme -mattr=+cpa < %s \
4-
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme -mattr=+cpa < %s 2>&1 \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ERROR-NO-SVE
55
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
66
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
77
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+cpa < %s 2>&1 \
8-
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR-NO-SVESME
8+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR-NO-SVE
99
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s 2>&1 \
1010
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR-NO-CPA
1111
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
12-
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR-NO-CPA
12+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
1313
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve -mattr=+cpa < %s \
1414
// RUN: | llvm-objdump -d --mattr=+sve --mattr=+cpa - \
1515
// RUN: | FileCheck %s --check-prefix=CHECK-INST
@@ -23,47 +23,47 @@
2323
addpt z23.d, z13.d, z8.d
2424
// CHECK-INST: addpt z23.d, z13.d, z8.d
2525
// CHECK-ENCODING: [0xb7,0x09,0xe8,0x04]
26-
// CHECK-ERROR: instruction requires: cpa sve or sme
27-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
26+
// CHECK-ERROR: instruction requires: cpa sve
27+
// CHECK-ERROR-NO-SVE: instruction requires: sve
2828
// CHECK-ERROR-NO-CPA: instruction requires: cpa
2929
// CHECK-UNKNOWN: 04e809b7 <unknown>
3030

3131
addpt z23.d, p3/m, z23.d, z13.d
3232
// CHECK-INST: addpt z23.d, p3/m, z23.d, z13.d
3333
// CHECK-ENCODING: [0xb7,0x0d,0xc4,0x04]
34-
// CHECK-ERROR: instruction requires: cpa sve or sme
35-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
34+
// CHECK-ERROR: instruction requires: cpa sve
35+
// CHECK-ERROR-NO-SVE: instruction requires: sve
3636
// CHECK-ERROR-NO-CPA: instruction requires: cpa
3737
// CHECK-UNKNOWN: 04c40db7 <unknown>
3838

3939
subpt z23.d, z13.d, z8.d
4040
// CHECK-INST: subpt z23.d, z13.d, z8.d
4141
// CHECK-ENCODING: [0xb7,0x0d,0xe8,0x04]
42-
// CHECK-ERROR: instruction requires: cpa sve or sme
43-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
42+
// CHECK-ERROR: instruction requires: cpa sve
43+
// CHECK-ERROR-NO-SVE: instruction requires: sve
4444
// CHECK-ERROR-NO-CPA: instruction requires: cpa
4545
// CHECK-UNKNOWN: 04e80db7 <unknown>
4646

4747
subpt z23.d, p3/m, z23.d, z13.d
4848
// CHECK-INST: subpt z23.d, p3/m, z23.d, z13.d
4949
// CHECK-ENCODING: [0xb7,0x0d,0xc5,0x04]
50-
// CHECK-ERROR: instruction requires: cpa sve or sme
51-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
50+
// CHECK-ERROR: instruction requires: cpa sve
51+
// CHECK-ERROR-NO-SVE: instruction requires: sve
5252
// CHECK-ERROR-NO-CPA: instruction requires: cpa
5353
// CHECK-UNKNOWN: 04c50db7 <unknown>
5454

5555
madpt z0.d, z1.d, z31.d
5656
// CHECK-INST: madpt z0.d, z1.d, z31.d
5757
// CHECK-ENCODING: [0xe0,0xdb,0xc1,0x44]
58-
// CHECK-ERROR: instruction requires: cpa sve or sme
59-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
58+
// CHECK-ERROR: instruction requires: cpa sve
59+
// CHECK-ERROR-NO-SVE: instruction requires: sve
6060
// CHECK-ERROR-NO-CPA: instruction requires: cpa
6161
// CHECK-UNKNOWN: 44c1dbe0 <unknown>
6262

6363
mlapt z0.d, z1.d, z31.d
6464
// CHECK-INST: mlapt z0.d, z1.d, z31.d
6565
// CHECK-ENCODING: [0x20,0xd0,0xdf,0x44]
66-
// CHECK-ERROR: instruction requires: cpa sve or sme
67-
// CHECK-ERROR-NO-SVESME: instruction requires: sve or sme
66+
// CHECK-ERROR: instruction requires: cpa sve
67+
// CHECK-ERROR-NO-SVE: instruction requires: sve
6868
// CHECK-ERROR-NO-CPA: instruction requires: cpa
6969
// CHECK-UNKNOWN: 44dfd020 <unknown>

0 commit comments

Comments
 (0)