Skip to content

Commit

Permalink
Add a reg key to disable emulation for fp64 to fp16 conversion
Browse files Browse the repository at this point in the history
This change is only to control over the emulation mask for fp64 to fp16 conversion.
  • Loading branch information
krystian-andrzejewski authored and igcbot committed Oct 29, 2024
1 parent 757e20e commit 46173b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
theEmuKind |= (hasDPDivSqrtEmu ? EmuKind::EMU_DP_DIV_SQRT : 0);
theEmuKind |= (ctx.m_hasDPConvEmu ? EmuKind::EMU_DP_CONV : 0);
theEmuKind |= (ctx.m_DriverInfo.NeedI64BitDivRem() ? EmuKind::EMU_I64DIVREM : 0);
theEmuKind |= (ctx.m_DriverInfo.NeedFP64toFP16Conv() ? EmuKind::EMU_FP64_FP16_CONV : 0);
theEmuKind |= (ctx.m_DriverInfo.NeedFP64toFP16Conv() && IGC_IS_FLAG_DISABLED(ForceDisableDPToHFConvEmu) ? EmuKind::EMU_FP64_FP16_CONV : 0);
theEmuKind |=
((IGC_IS_FLAG_ENABLED(ForceSPDivEmulation) ||
(ctx.m_DriverInfo.NeedIEEESPDiv() && !ctx.platform.hasCorrectlyRoundedMacros()))
Expand Down
3 changes: 2 additions & 1 deletion IGC/common/igc_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ DECLARE_IGC_REGKEY(bool, Force32BitIntDivRemEmuSP, false, "Force 32-bit Int
DECLARE_IGC_REGKEY(bool, EnableRecursionOpenCL, true, "Enable recursion with OpenCL user functions", false)
DECLARE_IGC_REGKEY(bool, ForceDPEmulation, false, "Force double emulation for testing purpose", false)
DECLARE_IGC_REGKEY(bool, EnableDPEmulation, false, "Enforce double precision floating point operations emulation on platforms that do not support it natively", true)
DECLARE_IGC_REGKEY(bool, DPEmuNeedI64Emu, true, "Double Emulation needs I64 emulation. Unsetting it to disable I64 Emulation for testing.", false)
DECLARE_IGC_REGKEY(bool, DPEmuNeedI64Emu, true, "Double Emulation needs I64 emulation. Unsetting it to disable I64 Emulation for testing.", false)
DECLARE_IGC_REGKEY(bool, ForceDisableDPToHFConvEmu, false, "Force the compiler to disable an emulation for the conversion from fp64 to fp16 (use a native (inaccurate) operations instead - fp64 to fp32 and then fp32 to fp16)", false)
DECLARE_IGC_REGKEY(bool, SelectiveLoopUnrollForDPEmu, true, "Setting this to 0/false disable selective loop unrolling for DP emu.", true)
DECLARE_IGC_REGKEY(bool, ForceSPDivEmulation, false, "Force SP Div emulation for testing purpose", false)
DECLARE_IGC_REGKEY(DWORD, ForceI64DivRemEmu, 0, "Forces specific int64 div/rem emulation: 0 = platform default, 1 = int based, 2 = SP based, 3 = DP based", false)
Expand Down

0 comments on commit 46173b7

Please sign in to comment.