-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[HLSL] vector float to int and vec int to float are asserting #82826
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
Comments
There are two issues here. first ICK_Floating_Integral were always defaulting to CK_FloatingToIntegral for vectors regardless of direction of cast. Check was scalar only so added a vec float check to the conditional. Second issue was float to int casts were resolving to ICK_Integral_Promotion when they need to be resolving to CK_FloatingToIntegral. This was fixed by changing the ordering of conversion checks. This fixes llvm#82826
There are two issues here. first ICK_Floating_Integral were always defaulting to CK_FloatingToIntegral for vectors regardless of direction of cast. Check was scalar only so added a vec float check to the conditional. Second issue was float to int casts were resolving to ICK_Integral_Promotion when they need to be resolving to CK_FloatingToIntegral. This was fixed by changing the ordering of conversion checks. This fixes llvm#82826
There are two issues here. first `ICK_Floating_Integral` were always defaulting to `CK_FloatingToIntegral` for vectors regardless of direction of cast. Check was scalar only so added a vec float check to the conditional. Second issue was float to int casts were resolving to ICK_Integral_Promotion when they need to be resolving to CK_FloatingToIntegral. This was fixed by changing the ordering of conversion checks. This fixes #82826
@llvm/issue-subscribers-clang-frontend Author: Farzon Lotfi (farzonl)
```hlsl
void Fn( int64_t2 p0);
void Call1(half2 p0) { void Call2(float2 p0) {
static CastInst llvm::CastInst::Create(Instruction::CastOps, Value , Type , const Twine &, Instruction ): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
Need to be doing an int to float cast but we are doing a float to int
|
doing an int cast when we need to be doing sitofp
Need to be doing an int to float cast but we are doing a float to int
The text was updated successfully, but these errors were encountered: