-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Implement the fmod
intrinsic
#130320
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
Merged
Merged
Implement the fmod
intrinsic
#130320
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
73ec3fa
start implementation
kmpeng f7cee38
finished implementation, working on fmod.hlsl tests
kmpeng 67cdd8c
tweaked implementation to exclude vec1 & restrict to vec4, created ne…
kmpeng c1b03d7
fixed hlsl_intrinsics header return types, disabled llvm passes in sp…
kmpeng 8b1b2a4
Modified implementation after reorganization of instrinsics, finished…
kmpeng 5a131ae
Added fmod Sema error checks
kmpeng 1d71437
Merge fmod-directx.hlsl tests back into fmod.hlsl
kmpeng fc0d9f0
Added SPVCHECK prefix & changed function definition checks in fmod.hl…
kmpeng 567d8bb
Modify fmod.hlsl tests to include operands of each instruction
kmpeng f31cae5
updated fmod.hlsl test cases following feedback, move fmod hlsl_detai…
kmpeng 8aeb5bd
wild card out ambiguous registers, simplify fmod algorithm
kmpeng 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify | ||
|
||
float test_no_second_arg(float2 p0) { | ||
return fmod(p0); | ||
// expected-error@-1 {{no matching function for call to 'fmod'}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} | ||
} | ||
|
||
float test_too_many_arg(float2 p0) { | ||
return fmod(p0, p0, p0); | ||
// expected-error@-1 {{no matching function for call to 'fmod'}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} | ||
} | ||
|
||
float test_double_inputs(double p0, double p1) { | ||
return fmod(p0, p1); | ||
// expected-error@-1 {{call to 'fmod' is ambiguous}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} | ||
} | ||
|
||
float test_int_inputs(int p0, int p1) { | ||
return fmod(p0, p1); | ||
// expected-error@-1 {{call to 'fmod' is ambiguous}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} | ||
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.