Skip to content

Use unsigned comparison operators for unsigned SIMD types. #21720

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

Merged
merged 1 commit into from
Jan 31, 2015

Conversation

huonw
Copy link
Member

@huonw huonw commented Jan 28, 2015

Previously comparisons of SIMD types were always signed, even unsigned
comparisons, meaning 0xFFFF_FFFF_u32 < 0 inside a SIMD vector.

Fixes #21719.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@sanxiyn
Copy link
Member

sanxiyn commented Jan 28, 2015

@bors r+ 5487422

@@ -623,7 +623,7 @@ pub fn compare_simd_types<'blk, 'tcx>(
size: uint,
op: ast::BinOp)
-> ValueRef {
match t.sty {
let cmp = match t.sty {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I did something similar in my branch, though I had all the matching in another function and only needed the signedness from this one.

Previously comparisons of SIMD types were always signed, even unsigned
comparisons, meaning 0xFFFF_FFFF_u32 < 0 inside a SIMD vector.

Fixes rust-lang#21719.
@huonw
Copy link
Member Author

huonw commented Jan 28, 2015

@bors r=sanxiyn 76d66ba

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 30, 2015
Previously comparisons of SIMD types were always signed, even unsigned
comparisons, meaning 0xFFFF_FFFF_u32 < 0 inside a SIMD vector.

Fixes rust-lang#21719.
@alexcrichton alexcrichton merged commit 76d66ba into rust-lang:master Jan 31, 2015
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.

SIMD comparison operators are always signed.
6 participants