edition 2018
This commit is contained in:
@@ -7,6 +7,7 @@ readme = "README.md"
|
|||||||
repository = "https://github.com/rust-lang/compiler-builtins"
|
repository = "https://github.com/rust-lang/compiler-builtins"
|
||||||
homepage = "https://github.com/rust-lang/compiler-builtins"
|
homepage = "https://github.com/rust-lang/compiler-builtins"
|
||||||
documentation = "https://docs.rs/compiler_builtins"
|
documentation = "https://docs.rs/compiler_builtins"
|
||||||
|
edition = "2018"
|
||||||
description = """
|
description = """
|
||||||
Compiler intrinsics used by the Rust compiler. Also available for other targets
|
Compiler intrinsics used by the Rust compiler. Also available for other targets
|
||||||
if necessary!
|
if necessary!
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ intrinsics! {
|
|||||||
#[weak]
|
#[weak]
|
||||||
#[cfg(not(target_os = "ios"))]
|
#[cfg(not(target_os = "ios"))]
|
||||||
pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
|
pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
|
||||||
::mem::memcpy(dest, src, n);
|
crate::mem::memcpy(dest, src, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[weak]
|
#[weak]
|
||||||
@@ -121,7 +121,7 @@ intrinsics! {
|
|||||||
#[weak]
|
#[weak]
|
||||||
#[cfg(not(target_os = "ios"))]
|
#[cfg(not(target_os = "ios"))]
|
||||||
pub unsafe extern "aapcs" fn __aeabi_memmove(dest: *mut u8, src: *const u8, n: usize) {
|
pub unsafe extern "aapcs" fn __aeabi_memmove(dest: *mut u8, src: *const u8, n: usize) {
|
||||||
::mem::memmove(dest, src, n);
|
crate::mem::memmove(dest, src, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[weak]
|
#[weak]
|
||||||
@@ -140,7 +140,7 @@ intrinsics! {
|
|||||||
#[cfg(not(target_os = "ios"))]
|
#[cfg(not(target_os = "ios"))]
|
||||||
pub unsafe extern "aapcs" fn __aeabi_memset(dest: *mut u8, n: usize, c: i32) {
|
pub unsafe extern "aapcs" fn __aeabi_memset(dest: *mut u8, n: usize, c: i32) {
|
||||||
// Note the different argument order
|
// Note the different argument order
|
||||||
::mem::memset(dest, c, n);
|
crate::mem::memset(dest, c, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[weak]
|
#[weak]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::{CastInto, Int};
|
use crate::int::{CastInto, Int};
|
||||||
|
|
||||||
/// Returns `a + b`
|
/// Returns `a + b`
|
||||||
fn add<F: Float>(a: F, b: F) -> F
|
fn add<F: Float>(a: F, b: F) -> F
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
|
|
||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::Int;
|
use crate::int::Int;
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
enum Result {
|
enum Result {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// `return`s makes it clear where function exit points are
|
// `return`s makes it clear where function exit points are
|
||||||
#![allow(clippy::needless_return)]
|
#![allow(clippy::needless_return)]
|
||||||
|
|
||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::{CastInto, DInt, HInt, Int};
|
use crate::int::{CastInto, DInt, HInt, Int};
|
||||||
|
|
||||||
fn div32<F: Float>(a: F, b: F) -> F
|
fn div32<F: Float>(a: F, b: F) -> F
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::{CastInto, Int};
|
use crate::int::{CastInto, Int};
|
||||||
|
|
||||||
/// Generic conversion from a narrower to a wider IEEE-754 floating-point type
|
/// Generic conversion from a narrower to a wider IEEE-754 floating-point type
|
||||||
fn extend<F: Float, R: Float>(a: F) -> R
|
fn extend<F: Float, R: Float>(a: F) -> R
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::{CastInto, DInt, HInt, Int};
|
use crate::int::{CastInto, DInt, HInt, Int};
|
||||||
|
|
||||||
fn mul<F: Float>(a: F, b: F) -> F
|
fn mul<F: Float>(a: F, b: F) -> F
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::Int;
|
use crate::int::Int;
|
||||||
|
|
||||||
/// Returns `a` raised to the power `b`
|
/// Returns `a` raised to the power `b`
|
||||||
fn pow<F: Float>(a: F, b: i32) -> F {
|
fn pow<F: Float>(a: F, b: i32) -> F {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use float::add::__adddf3;
|
use crate::float::add::__adddf3;
|
||||||
use float::add::__addsf3;
|
use crate::float::add::__addsf3;
|
||||||
use float::Float;
|
use crate::float::Float;
|
||||||
|
|
||||||
intrinsics! {
|
intrinsics! {
|
||||||
#[arm_aeabi_alias = __aeabi_fsub]
|
#[arm_aeabi_alias = __aeabi_fsub]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use float::Float;
|
use crate::float::Float;
|
||||||
use int::{CastInto, Int};
|
use crate::int::{CastInto, Int};
|
||||||
|
|
||||||
fn trunc<F: Float, R: Float>(a: F) -> R
|
fn trunc<F: Float, R: Float>(a: F) -> R
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use int::{DInt, Int};
|
use crate::int::{DInt, Int};
|
||||||
|
|
||||||
trait UAddSub: DInt {
|
trait UAddSub: DInt {
|
||||||
fn uadd(self, other: Self) -> Self {
|
fn uadd(self, other: Self) -> Self {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use int::{DInt, HInt, Int};
|
use crate::int::{DInt, HInt, Int};
|
||||||
|
|
||||||
trait Mul: DInt
|
trait Mul: DInt
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use int::udiv::*;
|
use crate::int::udiv::*;
|
||||||
|
|
||||||
macro_rules! sdivmod {
|
macro_rules! sdivmod {
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use int::{DInt, HInt, Int};
|
use crate::int::{DInt, HInt, Int};
|
||||||
|
|
||||||
trait Ashl: DInt {
|
trait Ashl: DInt {
|
||||||
/// Returns `a << b`, requires `b < Self::BITS`
|
/// Returns `a << b`, requires `b < Self::BITS`
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#[cfg(not(feature = "public-test-deps"))]
|
#[cfg(not(feature = "public-test-deps"))]
|
||||||
pub(crate) use int::specialized_div_rem::*;
|
pub(crate) use crate::int::specialized_div_rem::*;
|
||||||
|
|
||||||
#[cfg(feature = "public-test-deps")]
|
#[cfg(feature = "public-test-deps")]
|
||||||
pub use int::specialized_div_rem::*;
|
pub use crate::int::specialized_div_rem::*;
|
||||||
|
|
||||||
intrinsics! {
|
intrinsics! {
|
||||||
#[maybe_use_optimized_c_shim]
|
#[maybe_use_optimized_c_shim]
|
||||||
|
|||||||
@@ -321,10 +321,10 @@ macro_rules! intrinsics {
|
|||||||
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
||||||
#[cfg_attr(feature = "weak-intrinsics", linkage = "weak")]
|
#[cfg_attr(feature = "weak-intrinsics", linkage = "weak")]
|
||||||
pub extern $abi fn $name( $($argname: $ty),* )
|
pub extern $abi fn $name( $($argname: $ty),* )
|
||||||
-> ::macros::win64_128bit_abi_hack::U64x2
|
-> $crate::macros::win64_128bit_abi_hack::U64x2
|
||||||
{
|
{
|
||||||
let e: $($ret)? = super::$name($($argname),*);
|
let e: $($ret)? = super::$name($($argname),*);
|
||||||
::macros::win64_128bit_abi_hack::U64x2::from(e)
|
$crate::macros::win64_128bit_abi_hack::U64x2::from(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ pub mod win64_128bit_abi_hack {
|
|||||||
|
|
||||||
impl From<i128> for U64x2 {
|
impl From<i128> for U64x2 {
|
||||||
fn from(i: i128) -> U64x2 {
|
fn from(i: i128) -> U64x2 {
|
||||||
use int::DInt;
|
use crate::int::DInt;
|
||||||
let j = i as u128;
|
let j = i as u128;
|
||||||
U64x2(j.lo(), j.hi())
|
U64x2(j.lo(), j.hi())
|
||||||
}
|
}
|
||||||
@@ -548,7 +548,7 @@ pub mod win64_128bit_abi_hack {
|
|||||||
|
|
||||||
impl From<u128> for U64x2 {
|
impl From<u128> for U64x2 {
|
||||||
fn from(i: u128) -> U64x2 {
|
fn from(i: u128) -> U64x2 {
|
||||||
use int::DInt;
|
use crate::int::DInt;
|
||||||
U64x2(i.lo(), i.hi())
|
U64x2(i.lo(), i.hi())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#[path = "../libm/src/math/mod.rs"]
|
#[path = "../libm/src/math/mod.rs"]
|
||||||
mod libm;
|
mod libm;
|
||||||
|
|
||||||
|
#[allow(unused_macros)]
|
||||||
macro_rules! no_mangle {
|
macro_rules! no_mangle {
|
||||||
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
|
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
|
||||||
intrinsics! {
|
intrinsics! {
|
||||||
|
|||||||
Reference in New Issue
Block a user