[llvm] [SPIR-V] Add lowering for G_FEXP10 (PR #182466)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 03:49:30 PST 2026
================
@@ -3218,6 +3284,46 @@ 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);
+ } else if (STI.canUseExtInstSet(SPIRV::InstructionSet::GLSL_std_450)) {
----------------
jmmartinez wrote:
Don't use else after return: https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
You can also reduce indentation by doing
```cpp
if (!STI.canUseExtInstSet(SPIRV::InstructionSet::GLSL_std_450)
return false;
...
```
https://github.com/llvm/llvm-project/pull/182466
More information about the llvm-commits
mailing list