-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix target-cpu fpu features on Armv8-R.
This is a follow-up to #123159, but applied to Armv8-R. This required llvm/llvm-project#88287 to work properly. Now that this change exists in rustc's llvm, we can fix Armv8-R's default fpu features. Add a run-make test that target-cpu=cortex-r52 enables double-precision and neon.
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/run-make/arm-target-cpu-fp/armv8r_none_eabihf.checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// CHECK-LABEL: vadd_q: | ||
// CHECK: vld{{.*}} | ||
// CHECK: vld{{.*}} | ||
// CHECK: vadd.f32{{.*}}q | ||
// CHECK: vst{{.*}} [r0] | ||
// CHECK: bx lr | ||
|
||
// CHECK-LABEL: vadd_f64: | ||
// CHECK: vadd.f64 d0, d0, d1 | ||
// CHECK: bx lr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![no_std] | ||
|
||
#[no_mangle] | ||
pub fn vadd_q(x: &mut [f32; 4], y: &[f32; 4]) { | ||
for i in 0..4 { | ||
x[i] += y[i]; | ||
} | ||
} | ||
|
||
#[no_mangle] | ||
pub fn vadd_f64(x: f64, y: f64) -> f64 { | ||
x + y | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This tests that target-cpu=cortex-r52 correctly enables double-precision and neon. | ||
|
||
use run_make_support::{llvm_filecheck, llvm_objdump, rustc, static_lib_name}; | ||
|
||
fn main() { | ||
let lib = static_lib_name("lib"); | ||
|
||
rustc() | ||
.edition("2021") | ||
.arg("--target=armv8r-none-eabihf") | ||
.arg("-Ctarget-cpu=cortex-r52") | ||
.arg("-Copt-level=3") | ||
.crate_type("rlib") | ||
.input("lib.rs") | ||
.output(&lib) | ||
.run(); | ||
|
||
let dis = llvm_objdump() | ||
.arg("--arch-name=arm") | ||
.arg("--mcpu=cortex-r52") | ||
.disassemble() | ||
.input(&lib) | ||
.run() | ||
.stdout_utf8(); | ||
|
||
llvm_filecheck().patterns("armv8r_none_eabihf.checks").stdin_buf(dis).run(); | ||
} |