aarch64 fp_load/fp_save do not need to be naked

There is a bug with LLVM and Rust causing naked functions to not support
target_enable directives.

https://github.com/rust-lang/rust/issues/136280
This commit is contained in:
Jeremy Soller
2025-04-12 08:14:38 -06:00
parent 551443d641
commit a926baefaf
+2 -6
View File
@@ -204,9 +204,8 @@ pub unsafe fn empty_cr3() -> rmm::PhysicalAddress {
}
#[target_feature(enable = "neon")]
#[naked]
unsafe extern "C" fn fp_save(float_regs: &mut FloatRegisters) {
core::arch::naked_asm!(
core::arch::asm!(
"stp q0, q1, [x0, {0} + 16 * 0]",
"stp q2, q3, [x0, {0} + 16 * 2]",
"stp q4, q5, [x0, {0} + 16 * 4]",
@@ -228,7 +227,6 @@ unsafe extern "C" fn fp_save(float_regs: &mut FloatRegisters) {
"str x9, [x0]",
"mrs x9, fpsr",
"str x9, [x0, {2} - {1}]",
"ret",
const mem::offset_of!(FloatRegisters, fp_simd_regs),
const mem::offset_of!(FloatRegisters, fpcr),
const mem::offset_of!(FloatRegisters, fpsr),
@@ -236,9 +234,8 @@ unsafe extern "C" fn fp_save(float_regs: &mut FloatRegisters) {
}
#[target_feature(enable = "neon")]
#[naked]
unsafe extern "C" fn fp_load(float_regs: &mut FloatRegisters) {
core::arch::naked_asm!(
core::arch::asm!(
"ldp q0, q1, [x0, {0} + 16 * 0]",
"ldp q2, q3, [x0, {0} + 16 * 2]",
"ldp q4, q5, [x0, {0} + 16 * 4]",
@@ -260,7 +257,6 @@ unsafe extern "C" fn fp_load(float_regs: &mut FloatRegisters) {
"msr fpcr, x9",
"ldr x9, [x0, {2} - {1}]",
"msr fpsr, x9",
"ret",
const mem::offset_of!(FloatRegisters, fp_simd_regs),
const mem::offset_of!(FloatRegisters, fpcr),
const mem::offset_of!(FloatRegisters, fpsr),