Skip to content
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

HLSL half type not allowed as parameter #57100

Closed
llvm-beanz opened this issue Aug 11, 2022 · 2 comments
Closed

HLSL half type not allowed as parameter #57100

llvm-beanz opened this issue Aug 11, 2022 · 2 comments
Assignees
Labels
HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

Given the following code:
half fn(half f);

Clang produces the following diagnostic:

./bin/clang -cc1 -x hlsl ../half-param.hlsl
../half-param.hlsl:1:8: error: function return value cannot have __fp16 type; did you forget * ?
half fn(half f);
^
../half-param.hlsl:1:16: error: parameters cannot have __fp16 type; did you forget * ?
half fn(half f);
^
2 errors generated.

@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label Aug 11, 2022
@llvm-beanz llvm-beanz self-assigned this Aug 12, 2022
@llvm-beanz
Copy link
Collaborator Author

This may be user error. Need to double check.

@llvm-beanz
Copy link
Collaborator Author

Nope. This is caused by HLSL not implying NativeHalfArgsAndReturns. There was a change to always pass -fallow-half-arguments-and-returns to cc1 when invoked through the DXC driver mode. This doesn't accurately reflect that this is a feature always supported by the language. The preferred approach would be to make the HLSL language mode imply that flag.

I will include this fix in https://reviews.llvm.org/D131718 because it is trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HLSL HLSL Language Support
Projects
Status: Done
Development

No branches or pull requests

1 participant