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

Use const {} for the immediate args of _mm*_cmp_* #1442

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jun 23, 2023

Rustc_codegen_cranelift requires immediates to already be constant in MIR unlike LLVM which only needs them constant after optimizations.

Rustc_codegen_cranelift requires immediates to already be constant in
MIR unlike LLVM which only needs them constant after optimizations.
@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2023

r? @Amanieu

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

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 23, 2023

Required for some of the intrinsics in https://github.com/bjorn3/rustc_codegen_cranelift/pull/1380

@lu-zero
Copy link
Contributor

lu-zero commented Jun 23, 2023

Wouldn't be better to make a shorthand macro const_as!(var, ty) or such?

Copy link
Contributor

@lu-zero lu-zero left a comment

Choose a reason for hiding this comment

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

Either way it looks fine to me.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 23, 2023

That would be nice if this pattern happened more. Right now I'm not sure if it is worth it.

@lu-zero
Copy link
Contributor

lu-zero commented Jun 23, 2023

On powerpc there are few more places, but that is probably far in the future :)

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 23, 2023

Yeah, Cranelift doesn't support PowerPC yet: bytecodealliance/wasmtime#1183. It does support s390x though.

@lu-zero
Copy link
Contributor

lu-zero commented Jun 23, 2023

I might contribute support for those intrinsics as well, but again, it can wait for later :)

@Amanieu Amanieu merged commit b20a92a into rust-lang:master Jun 23, 2023
@bjorn3 bjorn3 deleted the constify_avx_cmp branch June 23, 2023 13:21
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.

4 participants