[clang] [llvm] [HLSL] implement exp intrinsic (PR #83832)

Xiang Li via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 08:05:23 PST 2024


================
@@ -218,6 +218,9 @@ class DXILOpMapping<int opCode, DXILOpClass opClass, Intrinsic intrinsic, string
 // Concrete definition of DXIL Operation mapping to corresponding LLVM intrinsic
 def Sin  : DXILOpMapping<13, unary, int_sin,
                          "Returns sine(theta) for theta in radians.">;
+def Exp : DXILOpMapping<21, unary, int_exp,
+                         "Returns the base-e exponential of the x parameter."
----------------
python3kgae wrote:

DXIL exp is 2^x instead of e^x.
For hlsl, there're exp and exp2(https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-exp2).
exp2 is the one mapped to DXIL exp directly.


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


More information about the cfe-commits mailing list