Skip to content

Commit 5469010

Browse files
authored
[AArch64] FP/SIMD is not mandatory for v8-R (#79004)
The FP/SIMD instructions are optional for v8-R, so they should not be marked as a dependency of HasV8_0rOps. This had the effect of disabling some v8R-specific system registers when any of these features was disabled. I've moved these features to be enabled by default for Cortex-R82 (currently the only v8-R AArch64 core), matching the previous behavior, and clang's default. Based on a patch by Simi Pallipurath <[email protected]>
1 parent d1b473c commit 5469010

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

llvm/lib/Target/AArch64/AArch64.td

+9-8
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def FeatureFMV : SubtargetFeature<"fmv", "HasFMV", "true",
8181
"Enable Function Multi Versioning support.">;
8282

8383
def FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
84-
"Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions (FEAT_RDM)">;
84+
"Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions (FEAT_RDM)",
85+
[FeatureNEON]>;
8586

8687
def FeaturePAN : SubtargetFeature<
8788
"pan", "HasPAN", "true",
@@ -321,7 +322,7 @@ def FeatureUseRSqrt : SubtargetFeature<
321322

322323
def FeatureDotProd : SubtargetFeature<
323324
"dotprod", "HasDotProd", "true",
324-
"Enable dot product support (FEAT_DotProd)">;
325+
"Enable dot product support (FEAT_DotProd)", [FeatureNEON]>;
325326

326327
def FeaturePAuth : SubtargetFeature<
327328
"pauth", "HasPAuth", "true",
@@ -708,15 +709,14 @@ def HasV9_5aOps : SubtargetFeature<
708709
def HasV8_0rOps : SubtargetFeature<
709710
"v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
710711
[//v8.1
711-
FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
712+
FeatureCRC, FeaturePAN, FeatureLSE, FeatureCONTEXTIDREL2,
712713
//v8.2
713714
FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
714715
//v8.3
715-
FeatureComplxNum, FeatureCCIDX, FeatureJS,
716-
FeaturePAuth, FeatureRCPC,
716+
FeatureCCIDX, FeaturePAuth, FeatureRCPC,
717717
//v8.4
718-
FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
719-
FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO,
718+
FeatureTRACEV8_4, FeatureTLB_RMI, FeatureFlagM, FeatureDIT, FeatureSEL2,
719+
FeatureRCPC_IMMO,
720720
// Not mandatory in v8.0-R, but included here on the grounds that it
721721
// only enables names of system registers
722722
FeatureSpecRestrict
@@ -1420,7 +1420,8 @@ def ProcessorFeatures {
14201420
FeaturePerfMon, FeatureSPE, FeatureSPE_EEF];
14211421
list<SubtargetFeature> R82 = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
14221422
FeatureFP16FML, FeatureSSBS, FeaturePredRes,
1423-
FeatureSB];
1423+
FeatureSB, FeatureRDM, FeatureDotProd,
1424+
FeatureComplxNum, FeatureJS];
14241425
list<SubtargetFeature> X1 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
14251426
FeatureNEON, FeatureRCPC, FeaturePerfMon,
14261427
FeatureSPE, FeatureFullFP16, FeatureDotProd,

llvm/test/MC/AArch64/armv8.1a-rdma.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.1a -show-encoding < %s 2> %t | FileCheck %s
22
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
3-
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r -show-encoding < %s 2> %t | FileCheck %s
3+
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r,+rdm -show-encoding < %s 2> %t | FileCheck %s
44
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
55
.text
66

llvm/test/MC/AArch64/armv8.2a-dotprod-errors.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: not llvm-mc -triple aarch64 -mattr=+dotprod -show-encoding < %s 2> %t
22
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
3-
// RUN: not llvm-mc -triple aarch64 -mattr=+v8r -show-encoding < %s 2> %t
3+
// RUN: not llvm-mc -triple aarch64 -mattr=+v8r,+dotprod -show-encoding < %s 2> %t
44
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
55

66
udot v0.2s, v1.8b, v2.4b[4]

llvm/test/MC/AArch64/armv8.2a-dotprod.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// RUN: llvm-mc -triple aarch64 -mcpu=neoverse-n2 -show-encoding < %s| FileCheck %s --check-prefix=CHECK-DOTPROD
1313
// RUN: llvm-mc -triple aarch64 -mcpu=tsv110 -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
1414
// RUN: llvm-mc -triple aarch64 -mcpu=cortex-r82 -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
15-
// RUN: llvm-mc -triple aarch64 -mattr=+v8r -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
15+
// RUN: llvm-mc -triple aarch64 -mattr=+v8r,+dotprod -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
1616
// RUN: llvm-mc -triple aarch64 -mcpu=ampere1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
1717
// RUN: llvm-mc -triple aarch64 -mcpu=ampere1a -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
1818

1919
// RUN: not llvm-mc -triple aarch64 -mattr=+v8.2a -show-encoding < %s 2> %t
2020
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s
21-
// RUN: not llvm-mc -triple aarch64 -mattr=+v8r,-dotprod -show-encoding < %s 2> %t
21+
// RUN: not llvm-mc -triple aarch64 -mattr=+v8r -show-encoding < %s 2> %t
2222
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s
2323
// RUN: not llvm-mc -triple aarch64 -mcpu=cortex-r82 -mattr=-dotprod -show-encoding < %s 2> %t
2424
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s

llvm/test/MC/AArch64/armv8r-sysreg.s

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+v8r -o - %s | FileCheck %s
2+
// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+v8r,-fp-armv8,-rdm,-dotprod,-complxnum,-jsconv -o - %s | FileCheck %s
3+
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=cortex-r82 -o - %s | FileCheck %s
4+
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=cortex-r82 -mattr=-fp-armv8,-rdm,-dotprod,-complxnum,-jsconv -o - %s | FileCheck %s
25
.text
36
mrs x0, VSCTLR_EL2
47
mrs x0, MPUIR_EL1

llvm/test/MC/Disassembler/AArch64/armv8.3a-complex.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.3a,-fullfp16 --disassemble < %s 2>%t | FileCheck %s --check-prefix=CHECK
22
# RUN: FileCheck %s < %t --check-prefix=NO-FP16
33
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.3a,+fullfp16 --disassemble < %s 2>%t | FileCheck %s --check-prefix=CHECK --check-prefix=FP16
4-
# RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r --disassemble < %s 2>%t | FileCheck %s --check-prefix=CHECK
4+
# RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r,+complxnum --disassemble < %s 2>%t | FileCheck %s --check-prefix=CHECK
55
# RUN: FileCheck %s < %t --check-prefix=NO-FP16
66
# RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=-v8.3a,+fullfp16 --disassemble < %s 2>&1 | FileCheck %s --check-prefix=NO-V83A
77

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.3a --disassemble < %s | FileCheck %s
2-
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r --disassemble < %s | FileCheck %s
2+
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8r,+jsconv --disassemble < %s | FileCheck %s
33
# CHECK: fjcvtzs w0, d0
44
[0x00,0x00,0x7e,0x1e]

0 commit comments

Comments
 (0)