1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[LLVM][X86][Goldmont] Adding new target-cpu: Goldmont

[LLVM SIDE]
Connecting the GoldMont processor to his feature.

Reviewers: 
1. igorb
2. zvi
3. delena
4. RKSimon
5. craig.topper        

Differential Revision: https://reviews.llvm.org/D34504

llvm-svn: 306658
This commit is contained in:
Michael Zuckerman 2017-06-29 10:00:33 +00:00
parent 0e4c1d88e8
commit 26ae204aaa
7 changed files with 47 additions and 2 deletions

View File

@ -327,6 +327,7 @@ enum ProcessorSubtypes {
INTEL_COREI7_SKYLAKE_AVX512, INTEL_COREI7_SKYLAKE_AVX512,
INTEL_ATOM_BONNELL, INTEL_ATOM_BONNELL,
INTEL_ATOM_SILVERMONT, INTEL_ATOM_SILVERMONT,
INTEL_ATOM_GOLDMONT,
INTEL_KNIGHTS_LANDING, INTEL_KNIGHTS_LANDING,
AMDPENTIUM_K6, AMDPENTIUM_K6,
AMDPENTIUM_K62, AMDPENTIUM_K62,
@ -707,7 +708,12 @@ getIntelProcessorTypeAndSubtype(unsigned int Family, unsigned int Model,
*Type = INTEL_ATOM; *Type = INTEL_ATOM;
*Subtype = INTEL_ATOM_SILVERMONT; *Subtype = INTEL_ATOM_SILVERMONT;
break; // "silvermont" break; // "silvermont"
// Goldmont:
case 0x5c:
case 0x5f:
*Type = INTEL_ATOM;
*Subtype = INTEL_ATOM_GOLDMONT;
break; // "goldmont"
case 0x57: case 0x57:
*Type = INTEL_XEONPHI; // knl *Type = INTEL_XEONPHI; // knl
*Subtype = INTEL_KNIGHTS_LANDING; *Subtype = INTEL_KNIGHTS_LANDING;
@ -1070,6 +1076,8 @@ StringRef sys::getHostCPUName() {
switch (Subtype) { switch (Subtype) {
case INTEL_ATOM_BONNELL: case INTEL_ATOM_BONNELL:
return "bonnell"; return "bonnell";
case INTEL_ATOM_GOLDMONT:
return "goldmont";
case INTEL_ATOM_SILVERMONT: case INTEL_ATOM_SILVERMONT:
return "silvermont"; return "silvermont";
default: default:

View File

@ -300,6 +300,8 @@ def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom",
"Intel Atom processors">; "Intel Atom processors">;
def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM", def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM",
"Intel Silvermont processors">; "Intel Silvermont processors">;
def ProcIntelGLM : SubtargetFeature<"glm", "X86ProcFamily", "IntelGLM",
"Intel Goldmont processors">;
class Proc<string Name, list<SubtargetFeature> Features> class Proc<string Name, list<SubtargetFeature> Features>
: ProcessorModel<Name, GenericModel, Features>; : ProcessorModel<Name, GenericModel, Features>;
@ -430,6 +432,34 @@ class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [
def : SilvermontProc<"silvermont">; def : SilvermontProc<"silvermont">;
def : SilvermontProc<"slm">; // Legacy alias. def : SilvermontProc<"slm">; // Legacy alias.
class GoldmontProc<string Name> : ProcessorModel<Name, SLMModel, [
ProcIntelGLM,
FeatureX87,
FeatureMMX,
FeatureSSE42,
FeatureFXSR,
FeatureCMPXCHG16B,
FeatureMOVBE,
FeaturePOPCNT,
FeaturePCLMUL,
FeatureAES,
FeaturePRFCHW,
FeatureCallRegIndirect,
FeatureSlowLEA,
FeatureSlowIncDec,
FeatureSlowBTMem,
FeatureLAHFSAHF,
FeatureMPX,
FeatureSHA,
FeatureRDSEED,
FeatureXSAVE,
FeatureXSAVEOPT,
FeatureXSAVEC,
FeatureXSAVES,
FeatureCLFLUSHOPT
]>;
def : GoldmontProc<"goldmont">;
// "Arrandale" along with corei3 and corei5 // "Arrandale" along with corei3 and corei5
class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
FeatureX87, FeatureX87,

View File

@ -58,7 +58,7 @@ protected:
}; };
enum X86ProcFamilyEnum { enum X86ProcFamilyEnum {
Others, IntelAtom, IntelSLM Others, IntelAtom, IntelSLM, IntelGLM
}; };
/// X86 processor family: Intel Atom, and others /// X86 processor family: Intel Atom, and others

View File

@ -4,6 +4,8 @@
; RUN: llc < %s -mcpu=core2 -mtriple=x86_64-linux | FileCheck -check-prefix=ATOM-NOT64 %s ; RUN: llc < %s -mcpu=core2 -mtriple=x86_64-linux | FileCheck -check-prefix=ATOM-NOT64 %s
; RUN: llc < %s -mcpu=slm -mtriple=i686-linux | FileCheck -check-prefix=SLM32 %s ; RUN: llc < %s -mcpu=slm -mtriple=i686-linux | FileCheck -check-prefix=SLM32 %s
; RUN: llc < %s -mcpu=slm -mtriple=x86_64-linux | FileCheck -check-prefix=SLM64 %s ; RUN: llc < %s -mcpu=slm -mtriple=x86_64-linux | FileCheck -check-prefix=SLM64 %s
; RUN: llc < %s -mcpu=goldmont -mtriple=i686-linux | FileCheck -check-prefix=SLM32 %s
; RUN: llc < %s -mcpu=goldmont -mtriple=x86_64-linux | FileCheck -check-prefix=SLM64 %s
; fn_ptr.ll ; fn_ptr.ll

View File

@ -1,4 +1,6 @@
; RUN: llc < %s -mcpu=atom -mtriple=i686-linux | FileCheck %s ; RUN: llc < %s -mcpu=atom -mtriple=i686-linux | FileCheck %s
; RUN: llc < %s -mcpu=goldmont -mtriple=i686-linux | FileCheck %s
; CHECK:BB#5 ; CHECK:BB#5
; CHECK-NEXT:leal ; CHECK-NEXT:leal
; CHECK-NEXT:leal ; CHECK-NEXT:leal

View File

@ -1,5 +1,6 @@
; RUN: llc <%s -O2 -mcpu=atom -march=x86 -relocation-model=static | FileCheck -check-prefix=atom %s ; RUN: llc <%s -O2 -mcpu=atom -march=x86 -relocation-model=static | FileCheck -check-prefix=atom %s
; RUN: llc <%s -O2 -mcpu=slm -march=x86 -relocation-model=static | FileCheck -check-prefix=slm %s ; RUN: llc <%s -O2 -mcpu=slm -march=x86 -relocation-model=static | FileCheck -check-prefix=slm %s
; RUN: llc <%s -O2 -mcpu=goldmont -march=x86 -relocation-model=static | FileCheck -check-prefix=slm %s
; RUN: llc <%s -O2 -mcpu=core2 -march=x86 -relocation-model=static | FileCheck %s ; RUN: llc <%s -O2 -mcpu=core2 -march=x86 -relocation-model=static | FileCheck %s
; ;

View File

@ -18,6 +18,7 @@
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=broadwell 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=broadwell 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=bonnell 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=bonnell 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=silvermont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=silvermont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=goldmont 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=k8 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=k8 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=opteron 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=opteron 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=athlon64 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=athlon64 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
@ -34,3 +35,4 @@
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=btver1 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=btver1 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=btver2 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=btver2 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=znver1 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty ; RUN: llc < %s -o /dev/null -mtriple=x86_64-unknown-unknown -mcpu=znver1 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty