Skip to content

Commit 9a0999d

Browse files
committed
[AArch64] Enable SVE_AES instructions in streaming mode with FEAT_SSVE_AES
The following SVE2 instructions are available in streaming SVE mode if the target has FEAT_SSVE_AES - PMULLB, PMULLT (128-bit element) - AESE (vectors) - AESD (vectors) - AESMC - AESIMC This patch updates the predication of these instructions to reflect this architecture change. Note that the assembler predicates here always require at least one of sve2,ssve-aes due to the following condition (https://developer.arm.com/documentation/109697/2024_09/Feature-descriptions/The-Armv9-0-architecture-extension?lang=en#md457-the-armv90-architecture-extension__feat_FEAT_SVE_AES) - 'If FEAT_SVE_AES is implemented, then FEAT_SVE2 or FEAT_SSVE_AES is implemented.'
1 parent bc7e5c2 commit 9a0999d

File tree

11 files changed

+35
-23
lines changed

11 files changed

+35
-23
lines changed

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let F = [HasSME2p2, HasSVE2p2orSME2p2, HasNonStreamingSVEorSME2p2,
7878
def SME2p2Unsupported : AArch64Unsupported;
7979

8080
def SME2p1Unsupported : AArch64Unsupported {
81-
let F = !listconcat([HasSME2p1, HasSVE2p1_or_HasSME2p1, HasSVE2p1orSSVE_AES],
81+
let F = !listconcat([HasSME2p1, HasSVE2p1_or_HasSME2p1, HasNonStreamingSVE2p1orSSVE_AES],
8282
SME2p2Unsupported.F);
8383
}
8484

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def HasSVE2orSME2
257257
: Predicate<"Subtarget->hasSVE2() || (Subtarget->isStreaming() && Subtarget->hasSME2())">,
258258
AssemblerPredicateWithAll<(any_of FeatureSVE2, FeatureSME2),
259259
"sve2 or sme2">;
260-
def HasSVE2orSSVE_AES
260+
def HasNonStreamingSVE2orSSVE_AES
261261
: Predicate<"(Subtarget->isSVEAvailable() && Subtarget->hasSVE2()) ||"
262262
"(Subtarget->isSVEorStreamingSVEAvailable() && Subtarget->hasSSVE_AES())">,
263263
AssemblerPredicateWithAll<(any_of FeatureSVE2, FeatureSSVE_AES), "sve2 or ssve-aes">;
@@ -273,7 +273,7 @@ def HasSVE2p1_or_HasSME2p1
273273
def HasSVE2p2orSME2p2
274274
: Predicate<"Subtarget->isSVEorStreamingSVEAvailable() && (Subtarget->hasSVE2p2() || Subtarget->hasSME2p2())">,
275275
AssemblerPredicateWithAll<(any_of FeatureSME2p2, FeatureSVE2p2), "sme2p2 or sve2p2">;
276-
def HasSVE2p1orSSVE_AES
276+
def HasNonStreamingSVE2p1orSSVE_AES
277277
: Predicate<"(Subtarget->isSVEAvailable() && Subtarget->hasSVE2p1()) ||"
278278
"(Subtarget->isSVEorStreamingSVEAvailable() && Subtarget->hasSSVE_AES())">,
279279
AssemblerPredicateWithAll<(any_of FeatureSVE2p1, FeatureSSVE_AES), "sve2p1 or ssve-aes">;

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,7 +3906,7 @@ let Predicates = [HasSVE2orSME] in {
39063906
defm WHILERW_PXX : sve2_int_while_rr<0b1, "whilerw", "int_aarch64_sve_whilerw">;
39073907
} // End HasSVE2orSME
39083908

3909-
let Predicates = [HasSVE2, HasSVEAES] in {
3909+
let Predicates = [HasSVEAES, HasNonStreamingSVE2orSSVE_AES] in {
39103910
// SVE2 crypto destructive binary operations
39113911
defm AESE_ZZZ_B : sve2_crypto_des_bin_op<0b00, "aese", ZPR8, int_aarch64_sve_aese, nxv16i8>;
39123912
defm AESD_ZZZ_B : sve2_crypto_des_bin_op<0b01, "aesd", ZPR8, int_aarch64_sve_aesd, nxv16i8>;
@@ -3920,7 +3920,7 @@ let Predicates = [HasSVE2, HasSVEAES] in {
39203920
// to NEON PMULL2 instruction.
39213921
defm PMULLB_ZZZ_Q : sve2_wide_int_arith_pmul<0b00, 0b11010, "pmullb", int_aarch64_sve_pmullb_pair>;
39223922
defm PMULLT_ZZZ_Q : sve2_wide_int_arith_pmul<0b00, 0b11011, "pmullt", int_aarch64_sve_pmullt_pair>;
3923-
} // End HasSVE2AES
3923+
}
39243924

39253925
let Predicates = [HasSVE2SM4] in {
39263926
// SVE2 crypto constructive binary operations
@@ -3941,7 +3941,7 @@ let Predicates = [HasSVE2BitPerm] in {
39413941
defm BGRP_ZZZ : sve2_misc_bitwise<0b1110, "bgrp", int_aarch64_sve_bgrp_x>;
39423942
} // End HasSVE2BitPerm
39433943

3944-
let Predicates = [HasSVEAES2, HasSVE2p1orSSVE_AES] in {
3944+
let Predicates = [HasSVEAES2, HasNonStreamingSVE2p1orSSVE_AES] in {
39453945
// SVE_AES2 multi-vector instructions (x2)
39463946
def AESE_2ZZI_B : sve_crypto_binary_multi2<0b000, "aese">;
39473947
def AESD_2ZZI_B : sve_crypto_binary_multi2<0b010, "aesd">;
@@ -3956,7 +3956,7 @@ let Predicates = [HasSVEAES2, HasSVE2p1orSSVE_AES] in {
39563956
// SVE_AES2 multi-vector polynomial multiply
39573957
def PMLAL_2ZZZ_Q : sve_crypto_pmlal_multi<"pmlal">;
39583958
def PMULL_2ZZZ_Q : sve_crypto_pmull_multi<"pmull">;
3959-
} // End HasSVEAES2, HasSVE2p1orSSVE_AES
3959+
}
39603960

39613961
//===----------------------------------------------------------------------===//
39623962
// SME or SVE2.1 instructions

llvm/test/MC/AArch64/SVE2/aesd.s

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
aesd z0.b, z0.b, z31.b
1416
// CHECK-INST: aesd z0.b, z0.b, z31.b
1517
// CHECK-ENCODING: [0xe0,0xe7,0x22,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 4522e7e0 <unknown>

llvm/test/MC/AArch64/SVE2/aese.s

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
aese z0.b, z0.b, z31.b
1416
// CHECK-INST: aese z0.b, z0.b, z31.b
1517
// CHECK-ENCODING: [0xe0,0xe3,0x22,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 4522e3e0 <unknown>

llvm/test/MC/AArch64/SVE2/aesimc.s

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
aesimc z0.b, z0.b
1416
// CHECK-INST: aesimc z0.b, z0.b
1517
// CHECK-ENCODING: [0x00,0xe4,0x20,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 4520e400 <unknown>
1820

1921
aesimc z31.b, z31.b
2022
// CHECK-INST: aesimc z31.b, z31.b
2123
// CHECK-ENCODING: [0x1f,0xe4,0x20,0x45]
22-
// CHECK-ERROR: instruction requires: sve2 sve-aes
24+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
2325
// CHECK-UNKNOWN: 4520e41f <unknown>

llvm/test/MC/AArch64/SVE2/aesmc.s

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
aesmc z0.b, z0.b
1416
// CHECK-INST: aesmc z0.b, z0.b
1517
// CHECK-ENCODING: [0x00,0xe0,0x20,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 4520e000 <unknown>
1820

1921
aesmc z31.b, z31.b
2022
// CHECK-INST: aesmc z31.b, z31.b
2123
// CHECK-ENCODING: [0x1f,0xe0,0x20,0x45]
22-
// CHECK-ERROR: instruction requires: sve2 sve-aes
24+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
2325
// CHECK-UNKNOWN: 4520e01f <unknown>

llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tbx z0.b, z1.b, z2.b
99
.arch_extension sve-aes
1010
.arch_extension nosve-aes
1111
aesd z23.b, z23.b, z13.b
12-
// CHECK: error: instruction requires: sve2 sve-aes
12+
// CHECK: error: instruction requires: sve2 or ssve-aes sve-aes
1313
// CHECK-NEXT: aesd z23.b, z23.b, z13.b
1414

1515
.arch_extension sve2-sm4

llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tbx z0.b, z1.b, z2.b
99
.cpu generic+sve2+sve-aes
1010
.cpu generic+nosve-aes
1111
aesd z23.b, z23.b, z13.b
12-
// CHECK: error: instruction requires: sve2 sve-aes
12+
// CHECK: error: instruction requires: sve2 or ssve-aes sve-aes
1313
// CHECK-NEXT: aesd z23.b, z23.b, z13.b
1414

1515
.cpu generic+sve2-sm4
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
pmullb z29.q, z30.d, z31.d
1416
// CHECK-INST: pmullb z29.q, z30.d, z31.d
1517
// CHECK-ENCODING: [0xdd,0x6b,0x1f,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 451f6bdd <unknown>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+sve-aes < %s \
22
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-aes,+sve-aes < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
35
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
46
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
57
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s 2>&1 \
68
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
79
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
810
// RUN: | llvm-objdump -d --mattr=+sve2,+sve-aes - | FileCheck %s --check-prefix=CHECK-INST
911
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+sve-aes < %s \
10-
// RUN: | llvm-objdump -d --mattr=-sve2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12+
// RUN: | llvm-objdump -d --mattr=-sve-aes - | FileCheck %s --check-prefix=CHECK-UNKNOWN
1113

1214

1315
pmullt z29.q, z30.d, z31.d
1416
// CHECK-INST: pmullt z29.q, z30.d, z31.d
1517
// CHECK-ENCODING: [0xdd,0x6f,0x1f,0x45]
16-
// CHECK-ERROR: instruction requires: sve2 sve-aes
18+
// CHECK-ERROR: instruction requires: sve2 or ssve-aes sve-aes
1719
// CHECK-UNKNOWN: 451f6fdd <unknown>

0 commit comments

Comments
 (0)