Skip to content

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

Queued
nazar-pc wants to merge 2 commits into
Rust-GPU:mainfrom
nazar-pc:fix-integer-casts
Queued

nazar-pc wants to merge 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

This branch has not been deployed

No deployments
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