mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 01:24:03 +00:00
x86: on targets that requires SSE, use those registers for ABI Now that https://github.com/llvm/llvm-project/issues/142321 is fixed, we can use the vector ABI without re-introducing https://github.com/rust-lang/rust/issues/139029. So this effectively reverts https://github.com/rust-lang/rust/pull/141309. Since this means we are relying on the SSE target feature for the Rust ABI, we also need to turn the ABI target feature check into a hard error. If we don't do that, we'll get post-mono errors in some situations and plain miscompilations in others. Also this will cause performance regressions on LLVM 22 and 21 as those don't have the fix for https://github.com/llvm/llvm-project/issues/142321. IMO that's fine. Programs will do the right thing, they will just be a bit slower due to https://github.com/rust-lang/rust/issues/139029. r? @nikic Cc @tgross35
The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.
One extension worth noting is the use of revisions as custom prefixes for FileCheck. If your codegen test has different behavior based on the chosen target or different compiler flags that you want to exercise, you can use a revisions annotation, like so:
// revisions: aaa bbb
// [bbb] compile-flags: -Csomething=true
After specifying those variations, you can write different expected, or
explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:,
like so:
// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT: emitted-only-for-bbb
// bbb-NOT: emitted-only-for-aaa
// bbb-SAME: emitted-only-for-bbb
If multiple test revisions want to share some annotations, you can use a setup like this:
// revisions: aaa bbb ccc
// [bbb] filecheck-flags: --check-prefix=both
// [ccc] filecheck-flags: --check-prefix=both
Now aaa:, bbb:, ccc: annotations are only checked for those specific revisions,
and both: annotations are checked for revisions bbb and ccc.