diff --git a/rocclr/compiler/lib/backends/common/codegen.cpp b/rocclr/compiler/lib/backends/common/codegen.cpp index 528f6fa497..739a28cb87 100644 --- a/rocclr/compiler/lib/backends/common/codegen.cpp +++ b/rocclr/compiler/lib/backends/common/codegen.cpp @@ -546,7 +546,7 @@ llvmCodeGen( OptionsObj->oVariables->EnableMAD; targetOptions.NoInfsFPMath = OptionsObj->oVariables->FiniteMathOnly; // Need to add a support for OptionsObj->oVariables->NoSignedZeros, - targetOptions.NoNaNsFPMath = OptionsObj->oVariables->FastRelaxedMath; + targetOptions.NoNaNsFPMath = OptionsObj->oVariables->FiniteMathOnly; std::auto_ptr target(TheTarget->createTargetMachine(TheTriple.getTriple(), diff --git a/rocclr/compiler/lib/backends/common/opt_level.cpp b/rocclr/compiler/lib/backends/common/opt_level.cpp index fc7af4875a..5c6500000e 100644 --- a/rocclr/compiler/lib/backends/common/opt_level.cpp +++ b/rocclr/compiler/lib/backends/common/opt_level.cpp @@ -119,7 +119,7 @@ OptLevel::run(aclBinary *elf) targetOptions.LessPreciseFPMADOption = Options()->oVariables->MadEnable || Options()->oVariables->EnableMAD; targetOptions.NoInfsFPMath = Options()->oVariables->FiniteMathOnly; - targetOptions.NoNaNsFPMath = Options()->oVariables->FastRelaxedMath; + targetOptions.NoNaNsFPMath = Options()->oVariables->FiniteMathOnly; llvm::CodeGenOpt::Level OLvl = CodeGenOpt::None; switch (Options()->oVariables->OptLevel) { diff --git a/rocclr/compiler/lib/utils/options.cpp b/rocclr/compiler/lib/utils/options.cpp index 131cc56eda..671b167299 100644 --- a/rocclr/compiler/lib/utils/options.cpp +++ b/rocclr/compiler/lib/utils/options.cpp @@ -740,6 +740,18 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value, } break; + case OID_FiniteMathOnly: + Opts.setFlag(OID_FiniteMathOnly, 1); + tod = &OptDescTable[OID_FiniteMathOnly]; + (void)setOptionVariable (tod, ovars, (int64_t)1, NULL); + break; + + case OID_NoSignedZeros: + Opts.setFlag(OID_NoSignedZeros, 1); + tod = &OptDescTable[OID_NoSignedZeros]; + (void)setOptionVariable (tod, ovars, (int64_t)1, NULL); + break; + case OID_FastRelaxedMath: // -cl-fast-relaxed-math implies: // -cl-finite-math-only