Target handling fixes.

Set the Module's target appropriately when it's first created.
Compile separate 32 and 64 bit versions of the builtins-c bitcocde
  and load the appropriate one based on the target we're compiling
  for.
This commit is contained in:
Matt Pharr
2011-08-15 16:03:50 +01:00
parent 46037c7a11
commit 04c93043d6
7 changed files with 99 additions and 53 deletions

View File

@@ -209,8 +209,13 @@ int main(int Argc, char *Argv[]) {
g->cppArgs.push_back(argv[i]);
}
#endif // !ISPC_IS_WINDOWS
else if (!strncmp(argv[i], "--arch=", 7))
else if (!strncmp(argv[i], "--arch=", 7)) {
g->target.arch = argv[i] + 7;
if (g->target.arch == "x86")
g->target.is32bit = true;
else if (g->target.arch == "x86-64")
g->target.is32bit = false;
}
else if (!strncmp(argv[i], "--cpu=", 6))
g->target.cpu = argv[i] + 6;
else if (!strcmp(argv[i], "--fast-math"))