message: Fix for PS4 target
diff: @@ -471,11 +471,6 @@ int main(int Argc, char *Argv[]) {
  Module::OutputFlags flags = Module::NoFlags;
  const char *arch = NULL, *cpu = NULL, *target = NULL, *intelAsmSyntax = NULL;
  - // Default settings for PS4
  - if (g->target_os == TargetOS::OS_PS4) {
  - flags |= Module::GeneratePIC;
  - cpu = "btver2";
  - }
  for (int i = 1; i < argc; ++i) {
  if (!strcmp(argv[i], "--help"))
  usage(0);
  @@ -497,8 +492,6 @@ int main(int Argc, char *Argv[]) {
  usage(1);
  }
  } else if (!strncmp(argv[i], "--arch=", 7)) {
  - // Do not allow to set arch for PS4 target, it is pre-defined.
  - if (g->target_os != TargetOS::OS_PS4) {
  arch = argv[i] + 7;
  // Define arch alias
  // LLVM TargetRegistry uses "x86-64", while triple uses "x86_64".
  @@ -506,7 +499,6 @@ int main(int Argc, char *Argv[]) {
  if (std::string(arch) == "x86_64") {
  arch = "x86-64";
  }
  - }
  } else if (!strncmp(argv[i], "--x86-asm-syntax=", 17)) {
  intelAsmSyntax = argv[i] + 17;
  if (!((std::string(intelAsmSyntax) == "intel") || (std::string(intelAsmSyntax) == "att"))) {
  @@ -517,10 +509,7 @@ int main(int Argc, char *Argv[]) {
  argv[i] + 17);
  }
  } else if (!strncmp(argv[i], "--cpu=", 6)) {
  - // Do not allow to set cpu for PS4 target, it is pre-defined.
  - if (g->target_os != TargetOS::OS_PS4) {
  cpu = argv[i] + 6;
  - }
  } else if (!strcmp(argv[i], "--fast-math")) {
  fprintf(stderr, "--fast-math option has been renamed to --opt=fast-math!\n");
  usage(1);
  @@ -770,6 +759,19 @@ int main(int Argc, char *Argv[]) {
  }
  }
  + // Default settings for PS4
  + if (g->target_os == TargetOS::OS_PS4) {
  + flags |= Module::GeneratePIC;
  + if (cpu && std::string(cpu) != "btver2" && std::string(cpu) != "ps4") {
  + Warning(SourcePos(), "--cpu switch is ignored for PS4 target OS. btver2 (ps4) cpu is used.");
  + }
  + cpu = "btver2";
  + if (arch && std::string(arch) != "x86-64") {
  + Warning(SourcePos(), "--arch switch is ignored for PS4 target OS. x86-64 arch is used.");
  + }
  + arch = "x86-64";
  + }
  +
  if (g->enableFuzzTest) {
  if (g->fuzzTestSeed == -1) {
  #ifdef ISPC_HOST_IS_WINDOWS
  