Make SSE2 the default target on Atom CPUs unless explicitly overridden. (Fixes issue #45

This commit is contained in:
Matt Pharr
2011-06-28 08:32:58 -07:00
parent b6d6ee6fc2
commit 7aec7486f8

View File

@@ -91,7 +91,7 @@ static void usage(int ret) {
printf(" disable-gather-scatter-flattening\tDisable flattening when all lanes are on\n");
printf(" disable-uniform-memory-optimizations\tDisable uniform-based coherent memory access\n");
printf(" disable-masked-store-optimizations\tDisable lowering to regular stores when possible\n");
printf(" [--target={sse2,sse4,sse4x2,avx}] Select target ISA (SSE4 is default)\n");
printf(" [--target={sse2,sse4,sse4x2,avx}] Select target ISA (SSE4 is default unless compiling for atom; then SSE2 is.)\n");
printf(" [--version]\t\t\t\tPrint ispc version\n");
printf(" [--woff]\t\t\t\tDisable warnings\n");
printf(" [--wno-perf]\t\t\tDon't issue warnings related to performance-related issues\n");
@@ -192,7 +192,7 @@ int main(int Argc, char *Argv[]) {
// as we're parsing below
g = new Globals;
bool debugSet = false, optSet = false;
bool debugSet = false, optSet = false, targetSet = false;
Module::OutputType ot = Module::Object;
for (int i = 1; i < argc; ++i) {
@@ -226,6 +226,7 @@ int main(int Argc, char *Argv[]) {
else if (!strcmp(argv[i], "--target")) {
if (++i == argc) usage(1);
lDoTarget(argv[i]);
targetSet = true;
}
else if (!strncmp(argv[i], "--target=", 9)) {
const char *target = argv[i] + 9;
@@ -315,6 +316,11 @@ int main(int Argc, char *Argv[]) {
if (debugSet && !optSet)
g->opt.level = 0;
// Make SSE2 the default target on atom unless the target has been set
// explicitly.
if (!targetSet && (g->target.cpu == "atom"))
lDoTarget("sse2");
m = new Module(file);
if (m->CompileFile() == 0) {
if (outFileName != NULL)