Make 32-bit addressing the default.

Also renamed the command-line flag to --addressing={32,64}.
This commit is contained in:
Matt Pharr
2011-12-01 13:38:40 -08:00
parent 82aa6efd12
commit 1390aed99c
2 changed files with 15 additions and 4 deletions

View File

@@ -317,7 +317,7 @@ Opt::Opt() {
level = 1; level = 1;
fastMath = false; fastMath = false;
fastMaskedVload = false; fastMaskedVload = false;
force32BitAddressing = false; force32BitAddressing = true;
unrollLoops = true; unrollLoops = true;
disableAsserts = false; disableAsserts = false;
disableHandlePseudoMemoryOps = false; disableHandlePseudoMemoryOps = false;

View File

@@ -60,6 +60,9 @@ static void usage(int ret) {
printf("This is the Intel(r) SPMD Program Compiler (ispc), build %s (%s)\n\n", printf("This is the Intel(r) SPMD Program Compiler (ispc), build %s (%s)\n\n",
BUILD_DATE, BUILD_VERSION); BUILD_DATE, BUILD_VERSION);
printf("usage: ispc\n"); printf("usage: ispc\n");
printf(" [--addressing={32,64}]\t\tSelect 32- or 64-bit addressing. (Note that 32-bit\n");
printf(" \t\taddressing calculations are done by default, even\n");
printf(" \t\ton 64-bit target architectures.)\n");
printf(" [--arch={%s}]\t\tSelect target architecture\n", printf(" [--arch={%s}]\t\tSelect target architecture\n",
Target::SupportedTargetArchs()); Target::SupportedTargetArchs());
printf(" [--cpu=<cpu>]\t\t\tSelect target CPU type\n"); printf(" [--cpu=<cpu>]\t\t\tSelect target CPU type\n");
@@ -83,7 +86,6 @@ static void usage(int ret) {
printf(" [-o <name>/--outfile=<name>]\tOutput filename (may be \"-\" for standard output)\n"); printf(" [-o <name>/--outfile=<name>]\tOutput filename (may be \"-\" for standard output)\n");
printf(" [-O0/-O1]\t\t\t\tSet optimization level (-O1 is default)\n"); printf(" [-O0/-O1]\t\t\t\tSet optimization level (-O1 is default)\n");
printf(" [--opt=<option>]\t\t\tSet optimization option\n"); printf(" [--opt=<option>]\t\t\tSet optimization option\n");
printf(" 32-bit-addressing\t\tUse 32-bit math for addressing calculations even on 64-bit targets.\n");
printf(" disable-assertions\t\tRemove assertion statements from final code.\n"); printf(" disable-assertions\t\tRemove assertion statements from final code.\n");
printf(" disable-loop-unroll\t\tDisable loop unrolling.\n"); printf(" disable-loop-unroll\t\tDisable loop unrolling.\n");
printf(" fast-masked-vload\t\tFaster masked vector loads on SSE (may go past end of array)\n"); printf(" fast-masked-vload\t\tFaster masked vector loads on SSE (may go past end of array)\n");
@@ -197,6 +199,17 @@ int main(int Argc, char *Argv[]) {
usage(0); usage(0);
else if (!strncmp(argv[i], "-D", 2)) else if (!strncmp(argv[i], "-D", 2))
g->cppArgs.push_back(argv[i]); g->cppArgs.push_back(argv[i]);
else if (!strncmp(argv[i], "--addressing=", 13)) {
if (atoi(argv[i] + 13) == 64)
g->opt.force32BitAddressing = false;
else if (atoi(argv[i] + 13) == 32)
g->opt.force32BitAddressing = 32;
else {
fprintf(stderr, "Addressing width \"%s\" invalid--only 32 and "
"64 are allowed.\n", argv[i]+13);
usage(1);
}
}
else if (!strncmp(argv[i], "--arch=", 7)) else if (!strncmp(argv[i], "--arch=", 7))
arch = argv[i] + 7; arch = argv[i] + 7;
else if (!strncmp(argv[i], "--cpu=", 6)) else if (!strncmp(argv[i], "--cpu=", 6))
@@ -250,8 +263,6 @@ int main(int Argc, char *Argv[]) {
g->opt.fastMath = true; g->opt.fastMath = true;
else if (!strcmp(opt, "fast-masked-vload")) else if (!strcmp(opt, "fast-masked-vload"))
g->opt.fastMaskedVload = true; g->opt.fastMaskedVload = true;
else if (!strcmp(opt, "32-bit-addressing"))
g->opt.force32BitAddressing = true;
else if (!strcmp(opt, "disable-assertions")) else if (!strcmp(opt, "disable-assertions"))
g->opt.disableAsserts = true; g->opt.disableAsserts = true;
else if (!strcmp(opt, "disable-loop-unroll")) else if (!strcmp(opt, "disable-loop-unroll"))