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

cmov: use ASM XOR for equality comparisons #920

Closed
brxken128 opened this issue Jun 18, 2023 · 3 comments · Fixed by #925
Closed

cmov: use ASM XOR for equality comparisons #920

brxken128 opened this issue Jun 18, 2023 · 3 comments · Fixed by #925

Comments

@brxken128
Copy link
Contributor

This is how we originally did equality comparisons for x86, but for some reason #[inline(always)] caused it to break entirely.

I'd prefer to do the XOR within the ASM block as it's just more consistent, and I'll work on testing this out later today.

@tarcieri
Copy link
Member

We should probably stop using #[inline(always)]: rust-lang/stdarch#306

@brxken128
Copy link
Contributor Author

We should probably stop using #[inline(always)]: rust-lang/stdarch#306

And change to just #[inline]? I thought this was best practice anyway, as LLVM/whatever will decide the rest.

@tarcieri
Copy link
Member

tarcieri commented Jul 8, 2023

Our main usage of #[inline(always)] before was as an alternative to #[target_feature] (which mandates the annotated function must be unsafe), but this lead to a lot of hard-to-debug codegen-related issues.

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 a pull request may close this issue.

2 participants