[PATCH] D67981: [NFC][PowerPC] Adding FeatureFPU in the definition of FeatureISA3_0

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 13:49:58 PDT 2019


amyk created this revision.
amyk added reviewers: power-llvm-team, nemanjai, echristo, hfinkel.
Herald added subscribers: llvm-commits, shchenz, jsji, MaskRay, kbarton, hiraditya.
Herald added a project: LLVM.

This is patch aims to add `FeatureFPU` into the definition of the feature, `FeatureISA3_0`.

There is no need to specify both predicates, `IsISA3_0` and `HasFPU`, as a compliant implementation of ISA 3.0 should have the floating point unit.


Repository:
  rL LLVM

https://reviews.llvm.org/D67981

Files:
  llvm/lib/Target/PowerPC/PPC.td
  llvm/test/CodeGen/PowerPC/feature-isav30.ll


Index: llvm/test/CodeGen/PowerPC/feature-isav30.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/feature-isav30.ll
@@ -0,0 +1,18 @@
+; RUN: not llc -mattr=+isa-v30-instructions,+spe -verify-machineinstrs \
+; RUN:   -mtriple=powerpc-unknown-unknown %s -o - 2>&1 | FileCheck %s
+
+; This IR aims to test how having ISA 3.0 implies that FPU is also enabled, as
+; a compliant implementation of ISA 3.0 should have the floating point unit.
+;
+; Thus, also setting SPE along side of having ISA 3.0 would not be correct as
+; both SPE and traditional floating point cannot be enabled.
+;
+; The triple is set to powerpc-unknown-unknown, as SPE is only supported on
+; 32-bit targets.
+
+define signext i32 @test_fpu_v30_feature () {
+; CHECK: LLVM ERROR: SPE and traditional floating point cannot both be enabled.
+entry:
+  ret i32 0
+}
+
Index: llvm/lib/Target/PowerPC/PPC.td
===================================================================
--- llvm/lib/Target/PowerPC/PPC.td
+++ llvm/lib/Target/PowerPC/PPC.td
@@ -189,7 +189,8 @@
 
 def FeatureISA3_0 : SubtargetFeature<"isa-v30-instructions", "IsISA3_0",
                                      "true",
-                                     "Enable instructions added in ISA 3.0.">;
+                                     "Enable instructions added in ISA 3.0.",
+                                     [FeatureFPU]>;
 def FeatureP9Altivec : SubtargetFeature<"power9-altivec", "HasP9Altivec", "true",
                                         "Enable POWER9 Altivec instructions",
                                         [FeatureISA3_0, FeatureP8Altivec]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67981.221567.patch
Type: text/x-patch
Size: 1671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190924/457f2df8/attachment.bin>


More information about the llvm-commits mailing list