[llvm] [SPIR-V] Add lowering for G_FEXP10 (PR #182466)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 24 05:48:03 PST 2026


================
@@ -3218,6 +3246,45 @@ bool SPIRVInstructionSelector::selectFCmp(Register ResVReg,
   return selectCmp(ResVReg, ResType, CmpOp, I);
 }
 
+bool SPIRVInstructionSelector::selectExp10(Register ResVReg,
+                                           SPIRVTypeInst ResType,
+                                           MachineInstr &I) const {
+  if (STI.canUseExtInstSet(SPIRV::InstructionSet::OpenCL_std)) {
+    return selectExtInst(ResVReg, ResType, I, CL::exp10);
+  }
+  if (STI.canUseExtInstSet(SPIRV::InstructionSet::GLSL_std_450)) {
----------------
idubinov wrote:

This function is list of "if -> {do; return}" statements. Now only two ifs: OpenCL and GLSL. There is no problem with deep nesting in this function. Early exit will mess the code, decrease readability

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


More information about the llvm-commits mailing list