mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
c-b: Sort conversion function definitinos by input size
This commit is contained in:
@@ -208,6 +208,8 @@ mod int_to_float {
|
||||
|
||||
// Conversions from unsigned integers to floats.
|
||||
intrinsics! {
|
||||
/* u32 -> fN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_ui2f]
|
||||
pub extern "C" fn __floatunsisf(i: u32) -> f32 {
|
||||
f32::from_bits(int_to_float::u32_to_f32_bits(i))
|
||||
@@ -218,6 +220,14 @@ intrinsics! {
|
||||
f64::from_bits(int_to_float::u32_to_f64_bits(i))
|
||||
}
|
||||
|
||||
#[ppc_name = __floatunsikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatunsitf(i: u32) -> f128 {
|
||||
f128::from_bits(int_to_float::u32_to_f128_bits(i))
|
||||
}
|
||||
|
||||
/* u64 -> fN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_ul2f]
|
||||
pub extern "C" fn __floatundisf(i: u64) -> f32 {
|
||||
f32::from_bits(int_to_float::u64_to_f32_bits(i))
|
||||
@@ -228,6 +238,14 @@ intrinsics! {
|
||||
f64::from_bits(int_to_float::u64_to_f64_bits(i))
|
||||
}
|
||||
|
||||
#[ppc_name = __floatundikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatunditf(i: u64) -> f128 {
|
||||
f128::from_bits(int_to_float::u64_to_f128_bits(i))
|
||||
}
|
||||
|
||||
/* u128 -> fN */
|
||||
|
||||
#[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))]
|
||||
pub extern "C" fn __floatuntisf(i: u128) -> f32 {
|
||||
f32::from_bits(int_to_float::u128_to_f32_bits(i))
|
||||
@@ -248,18 +266,6 @@ intrinsics! {
|
||||
f64::from_bits(int_to_float::u128_to_f64_bits((u128::from(hi) << 64) | u128::from(lo)))
|
||||
}
|
||||
|
||||
#[ppc_name = __floatunsikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatunsitf(i: u32) -> f128 {
|
||||
f128::from_bits(int_to_float::u32_to_f128_bits(i))
|
||||
}
|
||||
|
||||
#[ppc_name = __floatundikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatunditf(i: u64) -> f128 {
|
||||
f128::from_bits(int_to_float::u64_to_f128_bits(i))
|
||||
}
|
||||
|
||||
#[ppc_name = __floatuntikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatuntitf(i: u128) -> f128 {
|
||||
@@ -269,6 +275,8 @@ intrinsics! {
|
||||
|
||||
// Conversions from signed integers to floats.
|
||||
intrinsics! {
|
||||
/* i32 -> fN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_i2f]
|
||||
pub extern "C" fn __floatsisf(i: i32) -> f32 {
|
||||
int_to_float::signed(i, int_to_float::u32_to_f32_bits)
|
||||
@@ -279,6 +287,14 @@ intrinsics! {
|
||||
int_to_float::signed(i, int_to_float::u32_to_f64_bits)
|
||||
}
|
||||
|
||||
#[ppc_name = __floatsikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatsitf(i: i32) -> f128 {
|
||||
int_to_float::signed(i, int_to_float::u32_to_f128_bits)
|
||||
}
|
||||
|
||||
/* i64 -> fN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_l2f]
|
||||
pub extern "C" fn __floatdisf(i: i64) -> f32 {
|
||||
int_to_float::signed(i, int_to_float::u64_to_f32_bits)
|
||||
@@ -289,6 +305,14 @@ intrinsics! {
|
||||
int_to_float::signed(i, int_to_float::u64_to_f64_bits)
|
||||
}
|
||||
|
||||
#[ppc_name = __floatdikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatditf(i: i64) -> f128 {
|
||||
int_to_float::signed(i, int_to_float::u64_to_f128_bits)
|
||||
}
|
||||
|
||||
/* i128 -> fN */
|
||||
|
||||
#[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))]
|
||||
pub extern "C" fn __floattisf(i: i128) -> f32 {
|
||||
int_to_float::signed(i, int_to_float::u128_to_f32_bits)
|
||||
@@ -309,18 +333,6 @@ intrinsics! {
|
||||
int_to_float::signed((i128::from(hi) << 64) | i128::from(lo), int_to_float::u128_to_f64_bits)
|
||||
}
|
||||
|
||||
#[ppc_name = __floatsikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatsitf(i: i32) -> f128 {
|
||||
int_to_float::signed(i, int_to_float::u32_to_f128_bits)
|
||||
}
|
||||
|
||||
#[ppc_name = __floatdikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floatditf(i: i64) -> f128 {
|
||||
int_to_float::signed(i, int_to_float::u64_to_f128_bits)
|
||||
}
|
||||
|
||||
#[ppc_name = __floattikf]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __floattitf(i: i128) -> f128 {
|
||||
@@ -411,6 +423,8 @@ where
|
||||
|
||||
// Conversions from floats to unsigned integers.
|
||||
intrinsics! {
|
||||
/* f32 -> uN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_f2uiz]
|
||||
pub extern "C" fn __fixunssfsi(f: f32) -> u32 {
|
||||
float_to_unsigned_int(f)
|
||||
@@ -425,6 +439,8 @@ intrinsics! {
|
||||
float_to_unsigned_int(f)
|
||||
}
|
||||
|
||||
/* f64 -> uN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_d2uiz]
|
||||
pub extern "C" fn __fixunsdfsi(f: f64) -> u32 {
|
||||
float_to_unsigned_int(f)
|
||||
@@ -439,6 +455,8 @@ intrinsics! {
|
||||
float_to_unsigned_int(f)
|
||||
}
|
||||
|
||||
/* f128 -> uN */
|
||||
|
||||
#[ppc_name = __fixunskfsi]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __fixunstfsi(f: f128) -> u32 {
|
||||
@@ -460,6 +478,8 @@ intrinsics! {
|
||||
|
||||
// Conversions from floats to signed integers.
|
||||
intrinsics! {
|
||||
/* f32 -> iN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_f2iz]
|
||||
pub extern "C" fn __fixsfsi(f: f32) -> i32 {
|
||||
float_to_signed_int(f)
|
||||
@@ -474,6 +494,8 @@ intrinsics! {
|
||||
float_to_signed_int(f)
|
||||
}
|
||||
|
||||
/* f64 -> iN */
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_d2iz]
|
||||
pub extern "C" fn __fixdfsi(f: f64) -> i32 {
|
||||
float_to_signed_int(f)
|
||||
@@ -488,6 +510,8 @@ intrinsics! {
|
||||
float_to_signed_int(f)
|
||||
}
|
||||
|
||||
/* f128 -> iN */
|
||||
|
||||
#[ppc_name = __fixkfsi]
|
||||
#[cfg(f128_enabled)]
|
||||
pub extern "C" fn __fixtfsi(f: f128) -> i32 {
|
||||
|
||||
Reference in New Issue
Block a user