]> git.lizzy.rs Git - rust.git/commit
fix `extern "aapcs" fn`
authorJorge Aparicio <japaricious@gmail.com>
Wed, 16 Nov 2016 22:33:23 +0000 (17:33 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Wed, 16 Nov 2016 23:38:32 +0000 (18:38 -0500)
commit456ceba13784f2f88f7f21239e308a0f195967a1
treead2048d80fcb67035927c5168c199a3c979004c8
parent9d4b6fa51d86ad6141679a5a157fcd9bca48064c
fix `extern "aapcs" fn`

to actually use the AAPCS calling convention

closes #37810

This is technically a [breaking-change] because it changes the ABI of
`extern "aapcs"` functions that (a) involve `f32`/`f64` arguments/return
values and (b) are compiled for arm-eabihf targets from
"aapcs-vfp" (wrong) to "aapcs" (correct).

Appendix:

What these ABIs mean?

- In the "aapcs-vfp" ABI or "hard float" calling convention: Floating
point values are passed/returned through FPU registers (s0, s1, d0, etc.)

- Whereas, in the "aapcs" ABI or "soft float" calling convention:
Floating point values are passed/returned through general purpose
registers (r0, r1, etc.)

Mixing these ABIs can cause problems if the caller assumes that the
routine is using one of these ABIs but it's actually using the other
one.
src/librustc_llvm/ffi.rs
src/librustc_trans/abi.rs