-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
aarch64: Use LDP/STP if FEAT_LSE2 is available #11
Conversation
568ac2c
to
6ddf9be
Compare
@@ -26,6 +26,7 @@ test_task: | |||
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -- -Z unstable-options --report-time | |||
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24 | |||
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time | |||
# TODO: lse2 is not available on Graviton2 (armv8.2-a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Cirrus CI moved to Graviton3 (armv8.5-a? IIRC EDIT: armv8.4-a) we can test this with real aarsh64 machines on CI.
@@ -62,3 +63,4 @@ valgrind_task: | |||
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time | |||
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24 | |||
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time | |||
# TODO: lse2 is not available on Graviton2 (armv8.2-a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not confirmed if valgrind can handle CPU features not supported by the host.
Multithreaded tests using QEMU with cpu=a64fx failed due to torn reads, but a64fx is armv8.2-a so this is fine. However, considering that QEMU with cpu=max also failed, it is also possible that QEMU has not yet properly implemented FEAT_LSE2. (Singlethread tests using QEMU succeed) |
// As of rustc nightly-2022-04-30, target_feature "lse2" is not available on rustc side: | ||
// https://github.com/rust-lang/rust/blob/d201c812d40932509b2b5307c0b20c1ce78d21da/compiler/rustc_codegen_ssa/src/target_features.rs#L45 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVM (and std_detect) support it, so using it is not a problem, but we need to parse rustflags in the build script.
cc @ibraheemdev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (from my limited knowledge), thanks!
7cdbb66
to
96f80c6
Compare
aarch64 part of #10