Correct f128 extend and truncate symbol names on powerpc
PowerPC uses `kf` instead of `tf`: <https://gcc.gnu.org/wiki/Ieee128PowerPC>
This commit is contained in:
parent
aaa5260748
commit
a82491ed54
3 changed files with 56 additions and 8 deletions
|
|
@ -100,19 +100,37 @@ intrinsics! {
|
|||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __extendhftf2(a: f16) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
pub extern "C" fn __extendsftf2(a: f32) -> f128 {
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __extendhfkf2(a: f16) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __extendsftf2(a: f32) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __extendsfkf2(a: f32) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __extenddftf2(a: f64) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __extenddfkf2(a: f64) -> f128 {
|
||||
extend(a)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,19 +155,37 @@ intrinsics! {
|
|||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __trunctfhf2(a: f128) -> f16 {
|
||||
trunc(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
pub extern "C" fn __trunctfsf2(a: f128) -> f32 {
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __trunckfhf2(a: f128) -> f16 {
|
||||
trunc(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __trunctfsf2(a: f128) -> f32 {
|
||||
trunc(a)
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __trunckfsf2(a: f128) -> f32 {
|
||||
trunc(a)
|
||||
}
|
||||
|
||||
#[avr_skip]
|
||||
#[aapcs_on_arm]
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
pub extern "C" fn __trunctfdf2(a: f128) -> f64 {
|
||||
trunc(a)
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
pub extern "C" fn __trunckfdf2(a: f128) -> f64 {
|
||||
trunc(a)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,9 +187,15 @@ fn float_extend() {
|
|||
conv!(f32, f64, __extendsfdf2, Single, Double);
|
||||
#[cfg(not(feature = "no-f16-f128"))]
|
||||
{
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
use compiler_builtins::float::extend::{
|
||||
__extenddftf2, __extendhfsf2, __extendhftf2, __extendsftf2, __gnu_h2f_ieee,
|
||||
__extenddfkf2 as __extenddftf2, __extendhfkf2 as __extendhftf2,
|
||||
__extendsfkf2 as __extendsftf2,
|
||||
};
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
use compiler_builtins::float::extend::{__extenddftf2, __extendhftf2, __extendsftf2};
|
||||
use compiler_builtins::float::extend::{__extendhfsf2, __gnu_h2f_ieee};
|
||||
|
||||
// FIXME(f16_f128): Also do extend!() for `f16` and `f128` when builtins are in nightly
|
||||
conv!(f16, f32, __extendhfsf2, Half, Single);
|
||||
conv!(f16, f32, __gnu_h2f_ieee, Half, Single);
|
||||
|
|
@ -234,9 +240,15 @@ fn float_trunc() {
|
|||
conv!(f64, f32, __truncdfsf2, Double, Single);
|
||||
#[cfg(not(feature = "no-f16-f128"))]
|
||||
{
|
||||
use compiler_builtins::float::trunc::{__gnu_f2h_ieee, __truncdfhf2, __truncsfhf2};
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
|
||||
use compiler_builtins::float::trunc::{
|
||||
__gnu_f2h_ieee, __truncdfhf2, __truncsfhf2, __trunctfdf2, __trunctfhf2, __trunctfsf2,
|
||||
__trunckfdf2 as __trunctfdf2, __trunckfhf2 as __trunctfhf2,
|
||||
__trunckfsf2 as __trunctfsf2,
|
||||
};
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
|
||||
use compiler_builtins::float::trunc::{__trunctfdf2, __trunctfhf2, __trunctfsf2};
|
||||
|
||||
// FIXME(f16_f128): Also do trunc!() for `f16` and `f128` when builtins are in nightly
|
||||
conv!(f32, f16, __truncsfhf2, Single, Half);
|
||||
conv!(f32, f16, __gnu_f2h_ieee, Single, Half);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue