mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-25 21:16:19 +00:00
X86: Rename the CLMUL target feature to PCLMUL.
It was renamed in gcc/gas a while ago and causes all kinds of confusion because it was named differently in llvm and clang. llvm-svn: 157745
This commit is contained in:
parent
26ddf2b0be
commit
cb686400fb
@ -86,8 +86,8 @@ def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX",
|
|||||||
def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2",
|
def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2",
|
||||||
"Enable AVX2 instructions",
|
"Enable AVX2 instructions",
|
||||||
[FeatureAVX]>;
|
[FeatureAVX]>;
|
||||||
def FeatureCLMUL : SubtargetFeature<"clmul", "HasCLMUL", "true",
|
def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
|
||||||
"Enable carry-less multiplication instructions",
|
"Enable packed carry-less multiplication instructions",
|
||||||
[FeatureSSE2]>;
|
[FeatureSSE2]>;
|
||||||
def FeatureFMA3 : SubtargetFeature<"fma3", "HasFMA3", "true",
|
def FeatureFMA3 : SubtargetFeature<"fma3", "HasFMA3", "true",
|
||||||
"Enable three-operand fused multiple-add",
|
"Enable three-operand fused multiple-add",
|
||||||
@ -172,20 +172,20 @@ def : Proc<"nehalem", [FeatureSSE42, FeatureCMPXCHG16B,
|
|||||||
// Westmere is the corei3/i5/i7 path from nehalem to sandybridge
|
// Westmere is the corei3/i5/i7 path from nehalem to sandybridge
|
||||||
def : Proc<"westmere", [FeatureSSE42, FeatureCMPXCHG16B,
|
def : Proc<"westmere", [FeatureSSE42, FeatureCMPXCHG16B,
|
||||||
FeatureSlowBTMem, FeatureFastUAMem,
|
FeatureSlowBTMem, FeatureFastUAMem,
|
||||||
FeaturePOPCNT, FeatureAES, FeatureCLMUL]>;
|
FeaturePOPCNT, FeatureAES, FeaturePCLMUL]>;
|
||||||
// Sandy Bridge
|
// Sandy Bridge
|
||||||
// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
|
// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
|
||||||
// rather than a superset.
|
// rather than a superset.
|
||||||
def : Proc<"corei7-avx", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
|
def : Proc<"corei7-avx", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
|
||||||
FeatureAES, FeatureCLMUL]>;
|
FeatureAES, FeaturePCLMUL]>;
|
||||||
// Ivy Bridge
|
// Ivy Bridge
|
||||||
def : Proc<"core-avx-i", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
|
def : Proc<"core-avx-i", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
|
||||||
FeatureAES, FeatureCLMUL,
|
FeatureAES, FeaturePCLMUL,
|
||||||
FeatureRDRAND, FeatureF16C, FeatureFSGSBase]>;
|
FeatureRDRAND, FeatureF16C, FeatureFSGSBase]>;
|
||||||
|
|
||||||
// Haswell
|
// Haswell
|
||||||
def : Proc<"core-avx2", [FeatureAVX2, FeatureCMPXCHG16B, FeaturePOPCNT,
|
def : Proc<"core-avx2", [FeatureAVX2, FeatureCMPXCHG16B, FeaturePOPCNT,
|
||||||
FeatureAES, FeatureCLMUL, FeatureRDRAND,
|
FeatureAES, FeaturePCLMUL, FeatureRDRAND,
|
||||||
FeatureF16C, FeatureFSGSBase,
|
FeatureF16C, FeatureFSGSBase,
|
||||||
FeatureMOVBE, FeatureLZCNT, FeatureBMI,
|
FeatureMOVBE, FeatureLZCNT, FeatureBMI,
|
||||||
FeatureBMI2, FeatureFMA3]>;
|
FeatureBMI2, FeatureFMA3]>;
|
||||||
@ -220,11 +220,11 @@ def : Proc<"btver1", [FeatureSSSE3, FeatureSSE4A, FeatureCMPXCHG16B,
|
|||||||
FeatureLZCNT, FeaturePOPCNT]>;
|
FeatureLZCNT, FeaturePOPCNT]>;
|
||||||
// Bulldozer
|
// Bulldozer
|
||||||
def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
|
def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
|
||||||
FeatureAES, FeatureCLMUL,
|
FeatureAES, FeaturePCLMUL,
|
||||||
FeatureLZCNT, FeaturePOPCNT]>;
|
FeatureLZCNT, FeaturePOPCNT]>;
|
||||||
// Enhanced Bulldozer
|
// Enhanced Bulldozer
|
||||||
def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
|
def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
|
||||||
FeatureAES, FeatureCLMUL,
|
FeatureAES, FeaturePCLMUL,
|
||||||
FeatureF16C, FeatureLZCNT,
|
FeatureF16C, FeatureLZCNT,
|
||||||
FeaturePOPCNT, FeatureBMI]>;
|
FeaturePOPCNT, FeatureBMI]>;
|
||||||
|
|
||||||
|
@ -511,16 +511,16 @@ class AESAI<bits<8> o, Format F, dag outs, dag ins, string asm,
|
|||||||
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
||||||
Requires<[HasAES]>;
|
Requires<[HasAES]>;
|
||||||
|
|
||||||
// CLMUL Instruction Templates
|
// PCLMUL Instruction Templates
|
||||||
class CLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
|
class PCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
|
||||||
list<dag>pattern, InstrItinClass itin = IIC_DEFAULT>
|
list<dag>pattern, InstrItinClass itin = IIC_DEFAULT>
|
||||||
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
||||||
OpSize, Requires<[HasCLMUL]>;
|
OpSize, Requires<[HasPCLMUL]>;
|
||||||
|
|
||||||
class AVXCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
|
class AVXPCLMULIi8<bits<8> o, Format F, dag outs, dag ins, string asm,
|
||||||
list<dag>pattern, InstrItinClass itin = IIC_DEFAULT>
|
list<dag>pattern, InstrItinClass itin = IIC_DEFAULT>
|
||||||
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
: Ii8<o, F, outs, ins, asm, pattern, itin, SSEPackedInt>, TA,
|
||||||
OpSize, VEX_4V, Requires<[HasAVX, HasCLMUL]>;
|
OpSize, VEX_4V, Requires<[HasAVX, HasPCLMUL]>;
|
||||||
|
|
||||||
// FMA3 Instruction Templates
|
// FMA3 Instruction Templates
|
||||||
class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
|
class FMA3<bits<8> o, Format F, dag outs, dag ins, string asm,
|
||||||
|
@ -519,7 +519,7 @@ def HasAVX2 : Predicate<"Subtarget->hasAVX2()">;
|
|||||||
|
|
||||||
def HasPOPCNT : Predicate<"Subtarget->hasPOPCNT()">;
|
def HasPOPCNT : Predicate<"Subtarget->hasPOPCNT()">;
|
||||||
def HasAES : Predicate<"Subtarget->hasAES()">;
|
def HasAES : Predicate<"Subtarget->hasAES()">;
|
||||||
def HasCLMUL : Predicate<"Subtarget->hasCLMUL()">;
|
def HasPCLMUL : Predicate<"Subtarget->hasPCLMUL()">;
|
||||||
def HasFMA3 : Predicate<"Subtarget->hasFMA3()">;
|
def HasFMA3 : Predicate<"Subtarget->hasFMA3()">;
|
||||||
def HasFMA4 : Predicate<"Subtarget->hasFMA4()">;
|
def HasFMA4 : Predicate<"Subtarget->hasFMA4()">;
|
||||||
def HasXOP : Predicate<"Subtarget->hasXOP()">;
|
def HasXOP : Predicate<"Subtarget->hasXOP()">;
|
||||||
|
@ -7209,17 +7209,17 @@ def AESKEYGENASSIST128rm : AESAI<0xDF, MRMSrcMem, (outs VR128:$dst),
|
|||||||
OpSize;
|
OpSize;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// CLMUL Instructions
|
// PCLMUL Instructions
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// AVX carry-less Multiplication instructions
|
// AVX carry-less Multiplication instructions
|
||||||
def VPCLMULQDQrr : AVXCLMULIi8<0x44, MRMSrcReg, (outs VR128:$dst),
|
def VPCLMULQDQrr : AVXPCLMULIi8<0x44, MRMSrcReg, (outs VR128:$dst),
|
||||||
(ins VR128:$src1, VR128:$src2, i8imm:$src3),
|
(ins VR128:$src1, VR128:$src2, i8imm:$src3),
|
||||||
"vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
|
"vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
|
||||||
[(set VR128:$dst,
|
[(set VR128:$dst,
|
||||||
(int_x86_pclmulqdq VR128:$src1, VR128:$src2, imm:$src3))]>;
|
(int_x86_pclmulqdq VR128:$src1, VR128:$src2, imm:$src3))]>;
|
||||||
|
|
||||||
def VPCLMULQDQrm : AVXCLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst),
|
def VPCLMULQDQrm : AVXPCLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst),
|
||||||
(ins VR128:$src1, i128mem:$src2, i8imm:$src3),
|
(ins VR128:$src1, i128mem:$src2, i8imm:$src3),
|
||||||
"vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
|
"vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
|
||||||
[(set VR128:$dst, (int_x86_pclmulqdq VR128:$src1,
|
[(set VR128:$dst, (int_x86_pclmulqdq VR128:$src1,
|
||||||
@ -7227,13 +7227,13 @@ def VPCLMULQDQrm : AVXCLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst),
|
|||||||
|
|
||||||
// Carry-less Multiplication instructions
|
// Carry-less Multiplication instructions
|
||||||
let Constraints = "$src1 = $dst" in {
|
let Constraints = "$src1 = $dst" in {
|
||||||
def PCLMULQDQrr : CLMULIi8<0x44, MRMSrcReg, (outs VR128:$dst),
|
def PCLMULQDQrr : PCLMULIi8<0x44, MRMSrcReg, (outs VR128:$dst),
|
||||||
(ins VR128:$src1, VR128:$src2, i8imm:$src3),
|
(ins VR128:$src1, VR128:$src2, i8imm:$src3),
|
||||||
"pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
"pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||||
[(set VR128:$dst,
|
[(set VR128:$dst,
|
||||||
(int_x86_pclmulqdq VR128:$src1, VR128:$src2, imm:$src3))]>;
|
(int_x86_pclmulqdq VR128:$src1, VR128:$src2, imm:$src3))]>;
|
||||||
|
|
||||||
def PCLMULQDQrm : CLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst),
|
def PCLMULQDQrm : PCLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst),
|
||||||
(ins VR128:$src1, i128mem:$src2, i8imm:$src3),
|
(ins VR128:$src1, i128mem:$src2, i8imm:$src3),
|
||||||
"pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
"pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}",
|
||||||
[(set VR128:$dst, (int_x86_pclmulqdq VR128:$src1,
|
[(set VR128:$dst, (int_x86_pclmulqdq VR128:$src1,
|
||||||
|
@ -202,8 +202,8 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
|
|||||||
bool IsAMD = !IsIntel && memcmp(text.c, "AuthenticAMD", 12) == 0;
|
bool IsAMD = !IsIntel && memcmp(text.c, "AuthenticAMD", 12) == 0;
|
||||||
|
|
||||||
if ((ECX >> 1) & 0x1) {
|
if ((ECX >> 1) & 0x1) {
|
||||||
HasCLMUL = true;
|
HasPCLMUL = true;
|
||||||
ToggleFeature(X86::FeatureCLMUL);
|
ToggleFeature(X86::FeaturePCLMUL);
|
||||||
}
|
}
|
||||||
// FMA3 autodetection is switched off until we have a special flag
|
// FMA3 autodetection is switched off until we have a special flag
|
||||||
// in code generator
|
// in code generator
|
||||||
@ -328,7 +328,7 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
|||||||
, HasPOPCNT(false)
|
, HasPOPCNT(false)
|
||||||
, HasSSE4A(false)
|
, HasSSE4A(false)
|
||||||
, HasAES(false)
|
, HasAES(false)
|
||||||
, HasCLMUL(false)
|
, HasPCLMUL(false)
|
||||||
, HasFMA3(false)
|
, HasFMA3(false)
|
||||||
, HasFMA4(false)
|
, HasFMA4(false)
|
||||||
, HasXOP(false)
|
, HasXOP(false)
|
||||||
|
@ -85,8 +85,8 @@ protected:
|
|||||||
/// HasAES - Target has AES instructions
|
/// HasAES - Target has AES instructions
|
||||||
bool HasAES;
|
bool HasAES;
|
||||||
|
|
||||||
/// HasCLMUL - Target has carry-less multiplication
|
/// HasPCLMUL - Target has carry-less multiplication
|
||||||
bool HasCLMUL;
|
bool HasPCLMUL;
|
||||||
|
|
||||||
/// HasFMA3 - Target has 3-operand fused multiply-add
|
/// HasFMA3 - Target has 3-operand fused multiply-add
|
||||||
bool HasFMA3;
|
bool HasFMA3;
|
||||||
@ -203,7 +203,7 @@ public:
|
|||||||
bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
|
bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
|
||||||
bool hasPOPCNT() const { return HasPOPCNT; }
|
bool hasPOPCNT() const { return HasPOPCNT; }
|
||||||
bool hasAES() const { return HasAES; }
|
bool hasAES() const { return HasAES; }
|
||||||
bool hasCLMUL() const { return HasCLMUL; }
|
bool hasPCLMUL() const { return HasPCLMUL; }
|
||||||
bool hasFMA3() const { return HasFMA3; }
|
bool hasFMA3() const { return HasFMA3; }
|
||||||
bool hasFMA4() const { return HasFMA4; }
|
bool hasFMA4() const { return HasFMA4; }
|
||||||
bool hasXOP() const { return HasXOP; }
|
bool hasXOP() const { return HasXOP; }
|
||||||
|
Loading…
Reference in New Issue
Block a user