From: Craig Topper Date: Sun, 3 Jun 2012 18:58:46 +0000 (+0000) Subject: Rename FMA3 feature flag to just FMA to match gcc so it can be added to clang. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a15f9d53114a86005b260cbc451b0c63aa92bc1d;p=oota-llvm.git Rename FMA3 feature flag to just FMA to match gcc so it can be added to clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157903 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86.td b/lib/Target/X86/X86.td index 7bbb2b19033..0aafd605488 100644 --- a/lib/Target/X86/X86.td +++ b/lib/Target/X86/X86.td @@ -89,7 +89,7 @@ def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2", def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true", "Enable packed carry-less multiplication instructions", [FeatureSSE2]>; -def FeatureFMA3 : SubtargetFeature<"fma3", "HasFMA3", "true", +def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true", "Enable three-operand fused multiple-add", [FeatureAVX]>; def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true", @@ -188,7 +188,7 @@ def : Proc<"core-avx2", [FeatureAVX2, FeatureCMPXCHG16B, FeaturePOPCNT, FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C, FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI, - FeatureBMI2, FeatureFMA3]>; + FeatureBMI2, FeatureFMA]>; def : Proc<"k6", [FeatureMMX]>; def : Proc<"k6-2", [Feature3DNow]>; diff --git a/lib/Target/X86/X86InstrFormats.td b/lib/Target/X86/X86InstrFormats.td index de59c47466e..fab30248d8b 100644 --- a/lib/Target/X86/X86InstrFormats.td +++ b/lib/Target/X86/X86InstrFormats.td @@ -526,7 +526,7 @@ class AVXPCLMULIi8 o, Format F, dag outs, dag ins, string asm, class FMA3 o, Format F, dag outs, dag ins, string asm, listpattern, InstrItinClass itin = IIC_DEFAULT> : I, T8, - OpSize, VEX_4V, Requires<[HasFMA3]>; + OpSize, VEX_4V, Requires<[HasFMA]>; // FMA4 Instruction Templates class FMA4 o, Format F, dag outs, dag ins, string asm, diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 5cb2c80b60e..9ce61409daf 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -531,7 +531,7 @@ def HasAVX2 : Predicate<"Subtarget->hasAVX2()">; def HasPOPCNT : Predicate<"Subtarget->hasPOPCNT()">; def HasAES : Predicate<"Subtarget->hasAES()">; def HasPCLMUL : Predicate<"Subtarget->hasPCLMUL()">; -def HasFMA3 : Predicate<"Subtarget->hasFMA3()">; +def HasFMA : Predicate<"Subtarget->hasFMA()">; def HasFMA4 : Predicate<"Subtarget->hasFMA4()">; def HasXOP : Predicate<"Subtarget->hasXOP()">; def HasMOVBE : Predicate<"Subtarget->hasMOVBE()">; diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 3b60be532e7..5be31267281 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -206,8 +206,8 @@ void X86Subtarget::AutoDetectSubtargetFeatures() { ToggleFeature(X86::FeaturePCLMUL); } if ((ECX >> 12) & 0x1) { - HasFMA3 = true; - ToggleFeature(X86::FeatureFMA3); + HasFMA = true; + ToggleFeature(X86::FeatureFMA); } if (IsIntel && ((ECX >> 22) & 0x1)) { HasMOVBE = true; @@ -327,7 +327,7 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU, , HasSSE4A(false) , HasAES(false) , HasPCLMUL(false) - , HasFMA3(false) + , HasFMA(false) , HasFMA4(false) , HasXOP(false) , HasMOVBE(false) diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h index 544491f205d..1af585f2ad0 100644 --- a/lib/Target/X86/X86Subtarget.h +++ b/lib/Target/X86/X86Subtarget.h @@ -88,8 +88,8 @@ protected: /// HasPCLMUL - Target has carry-less multiplication bool HasPCLMUL; - /// HasFMA3 - Target has 3-operand fused multiply-add - bool HasFMA3; + /// HasFMA - Target has 3-operand fused multiply-add + bool HasFMA; /// HasFMA4 - Target has 4-operand fused multiply-add bool HasFMA4; @@ -204,7 +204,7 @@ public: bool hasPOPCNT() const { return HasPOPCNT; } bool hasAES() const { return HasAES; } bool hasPCLMUL() const { return HasPCLMUL; } - bool hasFMA3() const { return HasFMA3; } + bool hasFMA() const { return HasFMA; } bool hasFMA4() const { return HasFMA4; } bool hasXOP() const { return HasXOP; } bool hasMOVBE() const { return HasMOVBE; } diff --git a/test/CodeGen/X86/fma3-intrinsics.ll b/test/CodeGen/X86/fma3-intrinsics.ll index 3890082905c..8659dfe3266 100755 --- a/test/CodeGen/X86/fma3-intrinsics.ll +++ b/test/CodeGen/X86/fma3-intrinsics.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=x86_64-pc-win32 -mcpu=core-avx2 -mattr=avx2,+fma3 | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-pc-win32 -mcpu=core-avx2 -mattr=avx2,+fma | FileCheck %s define <4 x float> @test_x86_fmadd_ss(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) { ; CHECK: fmadd132ss %xmm