-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[HLSL] Implementation of tan intrinsic #79948
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ | ||
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ | ||
// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s | ||
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ | ||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ | ||
// RUN: -D__HLSL_ENABLE_16_BIT -o - | FileCheck %s --check-prefix=NO_HALF | ||
|
||
// CHECK: define noundef half @ | ||
// CHECK: call half @llvm.tan.f16( | ||
// NO_HALF: define noundef float @"?test_tan_half@@YA$halff@$halff@@Z"( | ||
// NO_HALF: call float @llvm.tan.f32( | ||
half test_tan_half ( half p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <2 x half> @ | ||
// CHECK: call <2 x half> @llvm.tan.v2f16 | ||
// NO_HALF: define noundef <2 x float> @"?test_tan_float2@@YAT?$__vector@M$01@__clang@@T12@@Z"( | ||
// NO_HALF: call <2 x float> @llvm.tan.v2f32( | ||
half2 test_tan_half2 ( half2 p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <3 x half> @ | ||
// CHECK: call <3 x half> @llvm.tan.v3f16 | ||
// NO_HALF: define noundef <3 x float> @"?test_tan_float3@@YAT?$__vector@M$02@__clang@@T12@@Z"( | ||
// NO_HALF: call <3 x float> @llvm.tan.v3f32( | ||
half3 test_tan_half3 ( half3 p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <4 x half> @ | ||
// CHECK: call <4 x half> @llvm.tan.v4f16 | ||
// NO_HALF: define noundef <4 x float> @"?test_tan_float4@@YAT?$__vector@M$03@__clang@@T12@@Z"( | ||
// NO_HALF: call <4 x float> @llvm.tan.v4f32( | ||
half4 test_tan_half4 ( half4 p0 ) { | ||
return tan ( p0 ); | ||
} | ||
|
||
// CHECK: define noundef float @ | ||
// CHECK: call float @llvm.tan.f32( | ||
float test_tan_float ( float p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <2 x float> @ | ||
// CHECK: call <2 x float> @llvm.tan.v2f32 | ||
float2 test_tan_float2 ( float2 p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <3 x float> @ | ||
// CHECK: call <3 x float> @llvm.tan.v3f32 | ||
float3 test_tan_float3 ( float3 p0 ) { | ||
return tan ( p0 ); | ||
} | ||
// CHECK: define noundef <4 x float> @ | ||
// CHECK: call <4 x float> @llvm.tan.v4f32 | ||
float4 test_tan_float4 ( float4 p0 ) { | ||
return tan ( p0 ); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
@llvm.tan
is a significant change; if you need this, please post a proposal on Discourse explaining what you're adding an why.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sorry, accidentally wrote Discord instead of Discourse initially.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will pull the pr for now as I investigate alternatives.