Skip to content

Implement the dst HLSL Function #99108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks
Tracked by #99235
farzonl opened this issue Jul 16, 2024 · 3 comments · Fixed by #133828
Closed
3 tasks
Tracked by #99235

Implement the dst HLSL Function #99108

farzonl opened this issue Jul 16, 2024 · 3 comments · Fixed by #133828
Assignees
Labels
bot:HLSL HLSL HLSL Language Support metabug Issue to collect references to a group of similar or related issues.

Comments

@farzonl
Copy link
Member

farzonl commented Jul 16, 2024

  • implement dst algorithm in the hlsl_intrinsics.h
  • Add HLSL codegen tests to clang/test/CodeGenHLSL/builtins/dst.hlsl
  • Add sema tests to clang/test/SemaHLSL/BuiltIns/dst-errors.hlsl

DirectX

There were no DXIL opcodes found for dst.

SPIR-V

There were no SPIRV GL ext opcodes found for dst.

OpFMul:

Description:

Floating-point multiplication of Operand 1 and Operand 2.

Result Type must be a scalar or vector of floating-point
type
.

The types of Operand 1 and Operand 2 both must be the same as
Result Type.

Results are computed per component.

Word Count Opcode Results Operands

5

133

<id>
Result Type

Result <id>

<id>
Operand 1

<id>
Operand 2

Test Case(s)

Example 1

//dxc dst_test.hlsl -T lib_6_8 -enable-16bit-types -O0

export float4 fn(float4 p1, float4 p2) {
    return dst(p1, p2);
}

HLSL:

Calculates a distance vector.

Syntax

fVector dst(
  in fVector src0,
  in fVector src1
);

Parameters

src0 [in]

Type: fVector

The first vector.

src1 [in]

Type: fVector

The second vector.

Return value

Type: fVector

The computed distance vector.

Remarks

This intrinsic function provides the same functionality as the Vertex Shader instruction dst.

See also

Intrinsic Functions

@farzonl farzonl added backend:SPIR-V bot:HLSL HLSL HLSL Language Support metabug Issue to collect references to a group of similar or related issues. labels Jul 16, 2024
@damyanp damyanp moved this to Ready in HLSL Support Oct 30, 2024
@damyanp damyanp moved this from Ready to Planning in HLSL Support Oct 30, 2024
@davidcook-msft davidcook-msft moved this from Planning to Designing in HLSL Support Nov 12, 2024
@davidcook-msft
Copy link

@farzonl to outline the header implementation.

@farzonl farzonl moved this from Designing to Planning in HLSL Support Jan 10, 2025
@farzonl
Copy link
Member Author

farzonl commented Jan 10, 2025

@davidcook-msft this ready for planning.

@damyanp damyanp moved this from Planning to Ready in HLSL Support Jan 21, 2025
@metkarpoonam
Copy link
Contributor

I'll get started on this.

@damyanp damyanp moved this from Ready to Active in HLSL Support Mar 24, 2025
@damyanp damyanp moved this from Active to Needs Review in HLSL Support Apr 1, 2025
@V-FEXrt V-FEXrt closed this as completed in 3ef2bb6 Apr 9, 2025
@github-project-automation github-project-automation bot moved this from Needs Review to Closed in HLSL Support Apr 9, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this issue Apr 9, 2025
fixes: llvm/llvm-project#99108
Implement dst algorithm in the hlsl_intrinsics.h and added test cases
for HLSL codegen and sema

- [x] implement dst algorithm in the hlsl_intrinsics.h

- [x] Add HLSL codegen tests to clang/test/CodeGenHLSL/builtins/dst.hlsl

- [x] Add sema tests to clang/test/SemaHLSL/BuiltIns/dst-errors.hlsl
AllinLeeYL pushed a commit to AllinLeeYL/llvm-project that referenced this issue Apr 10, 2025
fixes: llvm#99108
Implement dst algorithm in the hlsl_intrinsics.h and added test cases
for HLSL codegen and sema


- [x] implement dst algorithm in the hlsl_intrinsics.h

- [x] Add HLSL codegen tests to clang/test/CodeGenHLSL/builtins/dst.hlsl

- [x] Add sema tests to clang/test/SemaHLSL/BuiltIns/dst-errors.hlsl
var-const pushed a commit to ldionne/llvm-project that referenced this issue Apr 17, 2025
fixes: llvm#99108
Implement dst algorithm in the hlsl_intrinsics.h and added test cases
for HLSL codegen and sema


- [x] implement dst algorithm in the hlsl_intrinsics.h

- [x] Add HLSL codegen tests to clang/test/CodeGenHLSL/builtins/dst.hlsl

- [x] Add sema tests to clang/test/SemaHLSL/BuiltIns/dst-errors.hlsl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:HLSL HLSL HLSL Language Support metabug Issue to collect references to a group of similar or related issues.
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants