-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc 1.14.0 beta producing neon instructions on armv7 #38402
Comments
The stack trace suggests this might be an inlined |
Here's a relatively small test-case: //! Reduced neon test case from the mp4parse_capi crate.
pub struct Parser {
state: State,
}
#[derive(Clone)]
pub struct State {
// This struct must have at least two members to trigger
// NEON code generation.
pub u: u32,
pub v: u32,
}
pub unsafe fn parser_new(state: *const State) -> *mut Parser {
let parser = Box::new(Parser {
state: (*state).clone(),
});
Box::into_raw(parser)
} All of rustc 1.13.0-stable, 1.14.0-beta.3, and 1.15.0-nightly generate a |
@rillian hm unfortunately I can't seem to reproduce with your test case. Could you gist the commands you're using to reproduce? Also, what target are you using for this? |
Er, and to be concrete to what I'm seeing:
|
Sorry, I meant to include the command line. I was using:
|
Adding -O makes the vldr disappear. |
@rillian oh for Android it's slightly different. #36933 only touched the Linux targets, not the Android ones. For some reason I thought we still enabled NEON by default on armv7 Android b/c Google said it was required, but that's not the case apparently. In light of that it does indeed seem that we're missing a Note that you can confirm NEON is enabled through:
@rillian want to send a PR to disable neon by default on armv7 Android? |
Aha! Thanks for explaining. I completely missed the android/gnu difference. I'll send a PR. |
We thought Google's ABI for arvm7 required neon, but it is currently optional, perhaps because there is a significant population of Tegra 2 devices still in use. This turns off neon code generation outside #[target-feature] blocks just like we do on armv7-unknown-linux-gnu, but unlike most other armv7 targets. LLVM defaults to +neon for this target, so an explicit disable is necessary. See https://developer.android.com/ndk/guides/abis.html#v7a for instruction set extension requirements. Closes rust-lang#38402.
rustc: Disable NEON on armv7 android. We thought Google's ABI for arvm7 required neon, but it is currently optional, perhaps because there is a significant population of Tegra 2 devices still in use. This turns off neon code generation outside #[target-feature] blocks just like we do on armv7-unknown-linux-gnu, but unlike most other armv7 targets. LLVM defaults to +neon for this target, so an explicit disable is necessary. See https://developer.android.com/ndk/guides/abis.html#v7a for instruction set extension requirements. Closes rust-lang#38402.
We have some SIGILL crashes from Firefox on Tegra 2 devices, apparently in Rust code. See https://bugzilla.mozilla.org/show_bug.cgi?id=1323773 or https://crash-stats.mozilla.com/report/index/c0d43287-b39c-422c-8609-d63c52161215 for a specific example. These are ARM Cortex-A9 SoC without the neon extension.
I didn't find the function in question in our official apk, but when I build the
mp4parse_capi
crate with rust 1.14.0-beta.3, I seevld
andvst
instructions in the rlib disassembly forthe mp4parse_new()
function.I believe from recent commits that armv7 it intended to support non-neon devices like the Tegra 2 with this target triple. Perhaps #36933 was insufficient?
The text was updated successfully, but these errors were encountered: