From e9fe9f50436fdb20b3e59efece67c7949d80f888 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Mon, 23 Jul 2012 08:23:27 -0700 Subject: [PATCH] Add cpu strings for Ivy Bridge and HSW. Default to avx2 ISA for HSW CPUs. --- ispc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ispc.cpp b/ispc.cpp index 66521dcc..de1599ca 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -125,7 +125,7 @@ lGetSystemISA() { static const char *supportedCPUs[] = { "atom", "penryn", "core2", "corei7", "corei7-avx" #ifdef LLVM_3_2 - , "core-avx-i" + , "core-avx-i", "core-avx2" #endif // LLVM_3_2 }; @@ -137,7 +137,9 @@ Target::GetTarget(const char *arch, const char *cpu, const char *isa, if (cpu != NULL) { // If a CPU was specified explicitly, try to pick the best // 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"; else if (!strcmp(cpu, "sandybridge") || !strcmp(cpu, "corei7-avx"))