Open farzonl opened 4 months ago
ldexp
hlsl_intrinsics.h
CheckHLSLBuiltinFunctionCall
SemaChecking.cpp
EmitHLSLBuiltinExpr
CGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/ldexp.hlsl
clang/test/SemaHLSL/BuiltIns/ldexp-errors.hlsl
int_dx_ldexp
IntrinsicsDirectX.td
DXILOpMapping
21
DXIL.td
ldexp.ll
ldexp_errors.ll
llvm/test/CodeGen/DirectX/
int_spv_ldexp
IntrinsicsSPIRV.td
SPIRVInstructionSelector::selectIntrinsic
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/ldexp.ll
Exp2
Result is 2 raised to the x power; 2x.
The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of x must be the same type. Results are computed per component.
29
<id> x
//dxc ldexp_test.hlsl -T lib_6_8 -enable-16bit-types -O0 export float4 fn(float4 p1, float4 p2) { return ldexp(p1, p2); }
Returns the result of multiplying the specified value by two, raised to the power of the specified exponent.
This function uses the following formula: x * 2exp
The result of multiplying the x parameter by two, raised to the power of the exp parameter.
This function is supported in the following shader models.
@farzonl another with a global intrinsic
ldexp
clang builtin,ldexp
clang builtin withhlsl_intrinsics.h
ldexp
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
ldexp
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/ldexp.hlsl
clang/test/SemaHLSL/BuiltIns/ldexp-errors.hlsl
int_dx_ldexp
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_ldexp
to21
inDXIL.td
ldexp.ll
andldexp_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_ldexp
intrinsic inIntrinsicsSPIRV.td
ldexp
lowering and map it toint_spv_ldexp
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/ldexp.ll
DirectX
SPIR-V
Exp2:
Description:
Exp2
Result is 2 raised to the x power; 2x.
The operand x must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of x must be the same type. Results are computed per component.
29
<id>
x
Test Case(s)
Example 1
HLSL:
Returns the result of multiplying the specified value by two, raised to the power of the specified exponent.
This function uses the following formula: x * 2exp
Parameters
Return Value
The result of multiplying the x parameter by two, raised to the power of the exp parameter.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
Requirements
See also