[llvm] [SPIRV] Lower G_FMINIMUMNUM/G_FMAXIMUMNUM to OpenCL extended inst fmin/fmax (PR #153550)
Wenju He via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 15 00:10:12 PDT 2025
================
@@ -737,9 +737,11 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg,
case TargetOpcode::G_FMINNUM:
case TargetOpcode::G_FMINIMUM:
+ case TargetOpcode::G_FMINIMUMNUM:
----------------
wenju-he wrote:
> Something isn't right on how this whole thing is handled:
Yes, I think GMINNUM and G_FMINIMUM need fix.
> If one is NaN, `fminimumnum` and ocl returns the other operand but glsl can return either operand, the other 2 llvm intrinsic have different behaviour if it is sNaN or qNan.
thanks @Naghasan, I was not aware of GLSL behavior.
https://github.com/llvm/llvm-project/pull/153550
More information about the llvm-commits
mailing list