-
Notifications
You must be signed in to change notification settings - Fork 15k
[HLSL] Implement ddx/ddy_coarse intrinsics #164831
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
Open
Alexander-Johnston
wants to merge
6
commits into
llvm:main
Choose a base branch
from
Alexander-Johnston:dd_coarse
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
120e889
[HLSL] Implement ddx/ddy_coarse intrinsics
202b09c
Revert unneeded SPIR-V target changes
a1938a7
Change hlsl ddx/y_coarse intrinsic to alias
c170300
Update ddx/y_coarse tests
aba4b5b
[SPIRV] Don't add FP Encoding to OpTypeFloat by default
994c99b
Wrap OpDPdx/yCoarse with OpFConvert where needed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-pc-vulkan-compute %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK-SPIRV | ||
|
|
||
| // CHECK-LABEL: half @_Z19test_f16_ddx_coarseDh | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} half @llvm.dx.ddx.coarse.f16(half %{{.*}}) | ||
| // CHECK: ret half %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: half @_Z19test_f16_ddx_coarseDh | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} half @llvm.spv.ddx.coarse.f16(half %{{.*}}) | ||
| // CHECK-SPIRV: ret half %hlsl.ddx.coarse | ||
| half test_f16_ddx_coarse(half val) { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: float @_Z19test_f32_ddx_coarsef | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} float @llvm.dx.ddx.coarse.f32(float %{{.*}}) | ||
| // CHECK: ret float %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: float @_Z19test_f32_ddx_coarsef | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} float @llvm.spv.ddx.coarse.f32(float %{{.*}}) | ||
| // CHECK-SPIRV: ret float %hlsl.ddx.coarse | ||
| float test_f32_ddx_coarse(float val) { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(val); | ||
| } |
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,86 @@ | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-pc-vulkan-compute %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK-SPIRV | ||
|
|
||
| // CHECK-LABEL: half @_Z19test_f16_ddx_coarseDh | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} half @llvm.dx.ddx.coarse.f16(half %{{.*}}) | ||
| // CHECK: ret half %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: half @_Z19test_f16_ddx_coarseDh | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} half @llvm.spv.ddx.coarse.f16(half %{{.*}}) | ||
| // CHECK-SPIRV: ret half %hlsl.ddx.coarse | ||
| half test_f16_ddx_coarse(half val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <2 x half> @_Z20test_f16_ddx_coarse2Dv2_Dh | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <2 x half> @llvm.dx.ddx.coarse.v2f16(<2 x half> %{{.*}}) | ||
| // CHECK: ret <2 x half> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <2 x half> @_Z20test_f16_ddx_coarse2Dv2_Dh | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <2 x half> @llvm.spv.ddx.coarse.v2f16(<2 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <2 x half> %hlsl.ddx.coarse | ||
| half2 test_f16_ddx_coarse2(half2 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <3 x half> @_Z20test_f16_ddx_coarse3Dv3_Dh | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <3 x half> @llvm.dx.ddx.coarse.v3f16(<3 x half> %{{.*}}) | ||
| // CHECK: ret <3 x half> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <3 x half> @_Z20test_f16_ddx_coarse3Dv3_Dh | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <3 x half> @llvm.spv.ddx.coarse.v3f16(<3 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <3 x half> %hlsl.ddx.coarse | ||
| half3 test_f16_ddx_coarse3(half3 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <4 x half> @_Z20test_f16_ddx_coarse4Dv4_Dh | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <4 x half> @llvm.dx.ddx.coarse.v4f16(<4 x half> %{{.*}}) | ||
| // CHECK: ret <4 x half> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <4 x half> @_Z20test_f16_ddx_coarse4Dv4_Dh | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <4 x half> @llvm.spv.ddx.coarse.v4f16(<4 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <4 x half> %hlsl.ddx.coarse | ||
| half4 test_f16_ddx_coarse4(half4 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: float @_Z19test_f32_ddx_coarsef | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} float @llvm.dx.ddx.coarse.f32(float %{{.*}}) | ||
| // CHECK: ret float %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: float @_Z19test_f32_ddx_coarsef | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} float @llvm.spv.ddx.coarse.f32(float %{{.*}}) | ||
| // CHECK-SPIRV: ret float %hlsl.ddx.coarse | ||
| float test_f32_ddx_coarse(float val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <2 x float> @_Z20test_f32_ddx_coarse2Dv2_f | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <2 x float> @llvm.dx.ddx.coarse.v2f32(<2 x float> %{{.*}}) | ||
| // CHECK: ret <2 x float> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <2 x float> @_Z20test_f32_ddx_coarse2Dv2_f | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <2 x float> @llvm.spv.ddx.coarse.v2f32(<2 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <2 x float> %hlsl.ddx.coarse | ||
| float2 test_f32_ddx_coarse2(float2 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <3 x float> @_Z20test_f32_ddx_coarse3Dv3_f | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <3 x float> @llvm.dx.ddx.coarse.v3f32(<3 x float> %{{.*}}) | ||
| // CHECK: ret <3 x float> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <3 x float> @_Z20test_f32_ddx_coarse3Dv3_f | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <3 x float> @llvm.spv.ddx.coarse.v3f32(<3 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <3 x float> %hlsl.ddx.coarse | ||
| float3 test_f32_ddx_coarse3(float3 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <4 x float> @_Z20test_f32_ddx_coarse4Dv4_f | ||
| // CHECK: %hlsl.ddx.coarse = call {{.*}} <4 x float> @llvm.dx.ddx.coarse.v4f32(<4 x float> %{{.*}}) | ||
| // CHECK: ret <4 x float> %hlsl.ddx.coarse | ||
| // CHECK-LABEL-SPIRV: <4 x float> @_Z20test_f32_ddx_coarse4Dv4_f | ||
| // CHECK-SPIRV: %hlsl.ddx.coarse = call {{.*}} <4 x float> @llvm.spv.ddx.coarse.v4f32(<4 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <4 x float> %hlsl.ddx.coarse | ||
| float4 test_f32_ddx_coarse4(float4 val) { | ||
| return ddx_coarse(val); | ||
| } | ||
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,26 @@ | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-pc-vulkan-compute %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK-SPIRV | ||
|
|
||
| // CHECK-LABEL: half @_Z19test_f16_ddy_coarseDh | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} half @llvm.dx.ddy.coarse.f16(half %{{.*}}) | ||
| // CHECK: ret half %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: half @_Z19test_f16_ddy_coarseDh | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} half @llvm.spv.ddy.coarse.f16(half %{{.*}}) | ||
| // CHECK-SPIRV: ret half %hlsl.ddy.coarse | ||
| half test_f16_ddy_coarse(half val) { | ||
| return __builtin_hlsl_elementwise_ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: float @_Z19test_f32_ddy_coarsef | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} float @llvm.dx.ddy.coarse.f32(float %{{.*}}) | ||
| // CHECK: ret float %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: float @_Z19test_f32_ddy_coarsef | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} float @llvm.spv.ddy.coarse.f32(float %{{.*}}) | ||
| // CHECK-SPIRV: ret float %hlsl.ddy.coarse | ||
| float test_f32_ddy_coarse(float val) { | ||
| return __builtin_hlsl_elementwise_ddy_coarse(val); | ||
| } |
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,86 @@ | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like the ddx test case add a spirv target triple run line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-pc-vulkan-compute %s \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -fnative-half-type -o - | \ | ||
| // RUN: FileCheck %s --check-prefixes=CHECK-SPIRV | ||
|
|
||
| // CHECK-LABEL: half @_Z19test_f16_ddy_coarseDh | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} half @llvm.dx.ddy.coarse.f16(half %{{.*}}) | ||
| // CHECK: ret half %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: half @_Z19test_f16_ddy_coarseDh | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} half @llvm.spv.ddy.coarse.f16(half %{{.*}}) | ||
| // CHECK-SPIRV: ret half %hlsl.ddy.coarse | ||
| half test_f16_ddy_coarse(half val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <2 x half> @_Z20test_f16_ddy_coarse2Dv2_Dh | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <2 x half> @llvm.dx.ddy.coarse.v2f16(<2 x half> %{{.*}}) | ||
| // CHECK: ret <2 x half> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <2 x half> @_Z20test_f16_ddy_coarse2Dv2_Dh | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <2 x half> @llvm.spv.ddy.coarse.v2f16(<2 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <2 x half> %hlsl.ddy.coarse | ||
| half2 test_f16_ddy_coarse2(half2 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <3 x half> @_Z20test_f16_ddy_coarse3Dv3_Dh | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <3 x half> @llvm.dx.ddy.coarse.v3f16(<3 x half> %{{.*}}) | ||
| // CHECK: ret <3 x half> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <3 x half> @_Z20test_f16_ddy_coarse3Dv3_Dh | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <3 x half> @llvm.spv.ddy.coarse.v3f16(<3 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <3 x half> %hlsl.ddy.coarse | ||
| half3 test_f16_ddy_coarse3(half3 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <4 x half> @_Z20test_f16_ddy_coarse4Dv4_Dh | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <4 x half> @llvm.dx.ddy.coarse.v4f16(<4 x half> %{{.*}}) | ||
| // CHECK: ret <4 x half> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <4 x half> @_Z20test_f16_ddy_coarse4Dv4_Dh | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <4 x half> @llvm.spv.ddy.coarse.v4f16(<4 x half> %{{.*}}) | ||
| // CHECK-SPIRV: ret <4 x half> %hlsl.ddy.coarse | ||
| half4 test_f16_ddy_coarse4(half4 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: float @_Z19test_f32_ddy_coarsef | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} float @llvm.dx.ddy.coarse.f32(float %{{.*}}) | ||
| // CHECK: ret float %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: float @_Z19test_f32_ddy_coarsef | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} float @llvm.spv.ddy.coarse.f32(float %{{.*}}) | ||
| // CHECK-SPIRV: ret float %hlsl.ddy.coarse | ||
| float test_f32_ddy_coarse(float val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <2 x float> @_Z20test_f32_ddy_coarse2Dv2_f | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <2 x float> @llvm.dx.ddy.coarse.v2f32(<2 x float> %{{.*}}) | ||
| // CHECK: ret <2 x float> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <2 x float> @_Z20test_f32_ddy_coarse2Dv2_f | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <2 x float> @llvm.spv.ddy.coarse.v2f32(<2 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <2 x float> %hlsl.ddy.coarse | ||
| float2 test_f32_ddy_coarse2(float2 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <3 x float> @_Z20test_f32_ddy_coarse3Dv3_f | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <3 x float> @llvm.dx.ddy.coarse.v3f32(<3 x float> %{{.*}}) | ||
| // CHECK: ret <3 x float> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <3 x float> @_Z20test_f32_ddy_coarse3Dv3_f | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <3 x float> @llvm.spv.ddy.coarse.v3f32(<3 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <3 x float> %hlsl.ddy.coarse | ||
| float3 test_f32_ddy_coarse3(float3 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
|
|
||
| // CHECK-LABEL: <4 x float> @_Z20test_f32_ddy_coarse4Dv4_f | ||
| // CHECK: %hlsl.ddy.coarse = call {{.*}} <4 x float> @llvm.dx.ddy.coarse.v4f32(<4 x float> %{{.*}}) | ||
| // CHECK: ret <4 x float> %hlsl.ddy.coarse | ||
| // CHECK-LABEL-SPIRV: <4 x float> @_Z20test_f32_ddy_coarse4Dv4_f | ||
| // CHECK-SPIRV: %hlsl.ddy.coarse = call {{.*}} <4 x float> @llvm.spv.ddy.coarse.v4f32(<4 x float> %{{.*}}) | ||
| // CHECK-SPIRV: ret <4 x float> %hlsl.ddy.coarse | ||
| float4 test_f32_ddy_coarse4(float4 val) { | ||
| return ddy_coarse(val); | ||
| } | ||
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,23 @@ | ||
| // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -verify | ||
|
|
||
| typedef float float2 __attribute__((ext_vector_type(2))); | ||
|
|
||
| float no_arg() { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(); | ||
| // expected-error@-1 {{too few arguments to function call, expected 1, have 0}} | ||
| } | ||
|
|
||
| float too_many_args(float val) { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(val, val); | ||
| // expected-error@-1 {{too many arguments to function call, expected 1, have 2}} | ||
| } | ||
|
|
||
| float test_integer_scalar_input(int val) { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(val); | ||
| // expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}} | ||
| } | ||
|
|
||
| double test_double_scalar_input(double val) { | ||
| return __builtin_hlsl_elementwise_ddx_coarse(val); | ||
| // expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}} | ||
| } |
Oops, something went wrong.
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.
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.
once you update the code add a second run line to test the spirv target you should see the intrinsic change to
llvm.spv.ddx.coarseThere 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.
Added a second run line with spirv target to each of the 4 tests in this folder, all checking for the
llvm.spv.variant