[llvm] [DXIL] Implement pow lowering (PR #86733)
Joshua Batista via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 14:52:59 PDT 2024
================
@@ -197,6 +198,26 @@ static bool expandLog10Intrinsic(CallInst *Orig) {
return expandLogIntrinsic(Orig, numbers::ln2f / numbers::ln10f);
}
+static bool expandPowIntrinsic(CallInst *Orig) {
+
+ Value *X = Orig->getOperand(0);
+ Value *Y = Orig->getOperand(1);
+ Type *Ty = X->getType();
+ IRBuilder<> Builder(Orig->getParent());
+ Builder.SetInsertPoint(Orig);
+
+ auto *Log2Call =
----------------
bob80905 wrote:
These edge cases may be addressed elsewhere, but do we want special cases for when X is 0?
Logs probably won't work when the input base parameter is 0, since it's mathematically undefined to take the log of 0. But, 0^3 should be 0 from a power op point of view. So I wonder if this implementation is sufficient for that edge case.
https://github.com/llvm/llvm-project/pull/86733
More information about the llvm-commits
mailing list