Add cpu strings for Ivy Bridge and HSW.

Default to avx2 ISA for HSW CPUs.
This commit is contained in:
Matt Pharr
2012-07-23 08:23:27 -07:00
parent ce8dc5927c
commit e9fe9f5043

View File

@@ -125,7 +125,7 @@ lGetSystemISA() {
static const char *supportedCPUs[] = { static const char *supportedCPUs[] = {
"atom", "penryn", "core2", "corei7", "corei7-avx" "atom", "penryn", "core2", "corei7", "corei7-avx"
#ifdef LLVM_3_2 #ifdef LLVM_3_2
, "core-avx-i" , "core-avx-i", "core-avx2"
#endif // LLVM_3_2 #endif // LLVM_3_2
}; };
@@ -137,7 +137,9 @@ Target::GetTarget(const char *arch, const char *cpu, const char *isa,
if (cpu != NULL) { if (cpu != NULL) {
// If a CPU was specified explicitly, try to pick the best // If a CPU was specified explicitly, try to pick the best
// possible ISA based on that. // possible ISA based on that.
if (!strcmp(cpu, "corei7-avx-i")) if (!strcmp(cpu, "core-avx2"))
isa = "avx2";
else if (!strcmp(cpu, "core-avx-i"))
isa = "avx1.1"; isa = "avx1.1";
else if (!strcmp(cpu, "sandybridge") || else if (!strcmp(cpu, "sandybridge") ||
!strcmp(cpu, "corei7-avx")) !strcmp(cpu, "corei7-avx"))