================
@@ -2559,6 +2559,12 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register 
ResVReg,
   } break;
   case Intrinsic::spv_saturate:
     return selectSaturate(ResVReg, ResType, I);
+  case Intrinsic::spv_fclamp:
+    return selectExtInst(ResVReg, ResType, I, CL::fclamp, GL::FClamp);
----------------
farzonl wrote:

I don't beleive fclamp is correct for HLSL. I beleive HLSL uses NClamp since 
max and min are NMin and NMax.  
We had to fix a bug like this in the past.
https://github.com/llvm/llvm-project/issues/87072

Either we make a spv_nclamp and use that in CGBuiltins.cpp or we just change 
this line to:
```suggestion
    return selectExtInst(ResVReg, ResType, I, CL::nclamp, GL::NClamp);
```

https://github.com/llvm/llvm-project/pull/113394
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to