Skip to content

Fix integer casts extending based on the signedness of the destination - #708

Merged
Firestar99 merged 2 commits into
Rust-GPU:mainfrom
nazar-pc:fix-integer-casts
Nov 18, 2026
Merged

Firestar99 merged 2 commits into
Rust-GPU:mainfrom
nazar-pc:fix-integer-casts

Conversation

@nazar-pc

Copy link
Copy Markdown
Contributor

Found this while working on something quite different, but worth sending separately

@Firestar99

Copy link
Copy Markdown
Member

Let me make you a difftest for this, perfect oppertunity to compare host vs rust-gpu results

@nazar-pc

Copy link
Copy Markdown
Contributor Author

CI seems happy and I have another PR stacked on this one 🙏

Firestar99 and others added 2 commits November 18, 2026 13:36
…estination

`intcast` chose between `OpSConvert` and `OpUConvert` by the signedness of
the destination type and ignored `is_signed`, which describes the source.
So `i8 as u32` zero-extended and `u8 as i32` sign-extended. Extend based on
the source signedness instead. `OpUConvert` requires an unsigned result
type, so zero extension to a signed type converts to the unsigned type of
the same width and bitcasts.
@Firestar99

Copy link
Copy Markdown
Member

rebased it on main, CI should pass now

@Firestar99
Firestar99 added this pull request to the merge queue Nov 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 18, 2026
@Firestar99
Firestar99 merged commit ddc0005 into Rust-GPU:main Nov 18, 2026
24 checks passed
@nazar-pc
nazar-pc deleted the fix-integer-casts branch November 18, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants