-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[HLSL] half
overloads and typedefs are supported when 16-bit types are not enabled
#81049
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
Labels
HLSL
HLSL Language Support
Comments
llvm-beanz
added a commit
to llvm-beanz/llvm-project
that referenced
this issue
Feb 7, 2024
This addresses feedback from @rjmcall. The main updates are: * Added asserts and todos about handling constrained intrinsics. * Fixed sufflevector code generation (and updated tests) * Fixed shadowed promotion casts. Writing a test for this revealed another issue. * Added Element conversion to conversion rank checking, and added test to verify promotion is preferred over conversion. * Added HLSL integral promotion check. There are still at least two outstanding bugs that are exposed by this change which I've added an XFAIL'd test for (llvm#81047 & llvm#81049). HLSL's promotion rules are not well written down, but specifically in overload resolution integer and floating point values can implicitly cast to larger types and the smallest of the larger types is the best match.
half
should alias float
when 16-bit types are not enabledhalf
overloads and typedefs are supported when 16-bit types are not enabled
llvm-beanz
added a commit
to llvm-beanz/llvm-project
that referenced
this issue
Feb 14, 2024
We previously made an implmenetation error when adding `half` overloads for HLSL library functionalitly. The `half` type is always defined in HLSL and `half` intrinsics should not be conditionally included. When native 16-bit types are disabled `half` is a unique 32-bit float type with lesser promotion rank than `float`. Fixes llvm#81049
llvm-beanz
added a commit
that referenced
this issue
Feb 15, 2024
We previously made an implmenetation error when adding `half` overloads for HLSL library functionalitly. The `half` type is always defined in HLSL and `half` intrinsics should not be conditionally included. When native 16-bit types are disabled `half` is a unique 32-bit float type with lesser promotion rank than `float`. Fixes #81049
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In HLSL when 16-bit types are not enabled, half overloads are all supported. DXC currently treats
half
as a distinct type fromfloat
in all contexts even if they are both 32-bit float types. This behavior can be preserved in Clang.Acceptance Criteria
Clean up the existing test cases to allow
half
overloads and typedefs to be resolved without any additional flags required.The text was updated successfully, but these errors were encountered: