-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Implement the distance
HLSL Function
#99107
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
Comments
@farzonl - please rework issue to describe it being fully implemented in the header. |
farzonl
added a commit
that referenced
this issue
Jan 6, 2025
- Update pr labeler so new SPIRV files get properly labeled. - Add distance target builtin to BuiltinsSPIRV.td. - Update TargetBuiltins.h to account for spirv builtins. - Update clang basic CMakeLists.txt to build spirv builtin tablegen. - Hook up sema for SPIRV in Sema.h|cpp, SemaSPIRV.h|cpp, and SemaChecking.cpp. - Hookup sprv target builtins to SPIR.h|SPIR.cpp target. - Update GBuiltin.cpp to emit spirv intrinsics when we get the expected spirv target builtin. Consensus was reach in this RFC to add both target builtins and pattern matching: https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329. pattern matching will come in a separate pr this one just sets up the groundwork to do target builtins for spirv. partially resolves [#99107](#99107)
github-actions bot
pushed a commit
to arm/arm-toolchain
that referenced
this issue
Jan 10, 2025
…le (#121598) - Update pr labeler so new SPIRV files get properly labeled. - Add distance target builtin to BuiltinsSPIRV.td. - Update TargetBuiltins.h to account for spirv builtins. - Update clang basic CMakeLists.txt to build spirv builtin tablegen. - Hook up sema for SPIRV in Sema.h|cpp, SemaSPIRV.h|cpp, and SemaChecking.cpp. - Hookup sprv target builtins to SPIR.h|SPIR.cpp target. - Update GBuiltin.cpp to emit spirv intrinsics when we get the expected spirv target builtin. Consensus was reach in this RFC to add both target builtins and pattern matching: https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329. pattern matching will come in a separate pr this one just sets up the groundwork to do target builtins for spirv. partially resolves [#99107](llvm/llvm-project#99107)
fixed by #122357 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
distance
in thehlsl_intrinsics.h
clang/include/clang/Basic/BuiltinsSPIRV.td
hlsl_detail.h
in the formdistance
builtin toEmitSPIRVBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/distance.hlsl
clang/test/CodeGenSPIRV/Builtins/distance.c
clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl
clang/test/CodeGenSPIRV/Builtins/distance-errors.c
int_spv_distance
intrinsic inIntrinsicsSPIRV.td
distance
lowering and map it toint_spv_distance
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/distance.ll
llvm/test/CodeGen/SPIRV/opencl/distance.ll
DirectX
There are no DXIL opcodes found for
distance
.SPIR-V
Distance:
Description:
Distance
Result is the distance between p0 and p1, i.e., length(p0 -
p1).
The operands must all be a scalar or vector whose component type is
floating-point.
Result Type must be a scalar of the same type as the component type of
the operands.
67
<id>
p0
<id>
p1
Test Case(s)
Example 1
HLSL:
Returns a distance scalar between two vectors.
Parameters
Return Value
A floating-point, scalar value that represents the distance between the x parameter and the y parameter.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
See also
Intrinsic Functions (DirectX HLSL)
The text was updated successfully, but these errors were encountered: