[clang] [llvm] [HLSL][SPIRV] Added clamp intrinsic (PR #113394)

Adam Yang via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 10:05:17 PDT 2024


================
@@ -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);
----------------
adam-yang wrote:

Anyways, it's now doing the right thing and tests verify it.

https://github.com/llvm/llvm-project/pull/113394


More information about the llvm-commits mailing list