2016-10-11 08:05:21 +08:00
|
|
|
#![cfg_attr(not(stage0), deny(warnings))]
|
2016-10-11 05:45:24 +08:00
|
|
|
#![cfg_attr(not(test), no_std)]
|
2017-06-25 01:22:49 +08:00
|
|
|
#![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
|
2016-10-11 05:43:38 +08:00
|
|
|
#![crate_name = "compiler_builtins"]
|
|
|
|
#![crate_type = "rlib"]
|
2016-10-11 08:05:21 +08:00
|
|
|
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
|
|
|
|
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
|
|
|
|
html_root_url = "https://doc.rust-lang.org/nightly/",
|
|
|
|
html_playground_url = "https://play.rust-lang.org/",
|
|
|
|
test(attr(deny(warnings))))]
|
2016-08-08 04:58:05 +08:00
|
|
|
#![feature(asm)]
|
2016-10-11 05:45:24 +08:00
|
|
|
#![feature(compiler_builtins)]
|
2016-08-16 10:08:04 +08:00
|
|
|
#![feature(core_intrinsics)]
|
2016-08-08 04:58:05 +08:00
|
|
|
#![feature(naked_functions)]
|
2017-01-04 09:42:03 +08:00
|
|
|
#![feature(repr_simd)]
|
|
|
|
#![feature(abi_unadjusted)]
|
2017-06-30 11:40:58 +08:00
|
|
|
#![feature(linkage)]
|
2017-11-25 20:21:05 +08:00
|
|
|
#![feature(lang_items)]
|
2017-01-04 09:42:03 +08:00
|
|
|
#![allow(unused_features)]
|
2016-08-14 01:16:52 +08:00
|
|
|
#![no_builtins]
|
2018-02-01 02:04:01 +08:00
|
|
|
#![cfg_attr(feature = "compiler-builtins", feature(staged_api))]
|
|
|
|
#![cfg_attr(feature = "compiler-builtins",
|
|
|
|
unstable(feature = "compiler_builtins_lib",
|
|
|
|
reason = "Compiler builtins. Will never become stable.",
|
|
|
|
issue = "0"))]
|
2016-08-08 04:58:05 +08:00
|
|
|
|
2016-08-13 16:51:54 +08:00
|
|
|
// We disable #[no_mangle] for tests so that we can verify the test results
|
|
|
|
// against the native compiler-rt implementations of the builtins.
|
|
|
|
|
2016-09-27 04:55:11 +08:00
|
|
|
// NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
|
|
|
|
// implementation of that intrinsic and we'll prefer to use that
|
|
|
|
|
2017-02-07 22:41:26 +08:00
|
|
|
// NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
|
|
|
|
// that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
|
|
|
|
// AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
|
|
|
|
|
2016-08-14 05:58:44 +08:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate core;
|
|
|
|
|
2017-06-23 14:09:28 +08:00
|
|
|
fn abort() -> ! {
|
|
|
|
unsafe { core::intrinsics::abort() }
|
|
|
|
}
|
|
|
|
|
2017-06-23 13:03:07 +08:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
|
2016-08-18 04:50:24 +08:00
|
|
|
pub mod int;
|
2016-08-18 04:51:37 +08:00
|
|
|
pub mod float;
|
2016-08-18 04:50:24 +08:00
|
|
|
|
2018-07-25 05:57:22 +08:00
|
|
|
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
|
|
|
|
all(target_arch = "arm", target_os = "none")))]
|
2018-07-13 09:40:30 +08:00
|
|
|
pub mod math;
|
2018-07-25 02:26:50 +08:00
|
|
|
pub mod mem;
|
2016-12-18 12:01:47 +08:00
|
|
|
|
2016-08-08 04:58:05 +08:00
|
|
|
#[cfg(target_arch = "arm")]
|
|
|
|
pub mod arm;
|
|
|
|
|
2017-12-26 23:01:02 +08:00
|
|
|
#[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
|
2016-11-01 00:03:46 +08:00
|
|
|
pub mod arm_linux;
|
|
|
|
|
2018-07-27 01:30:26 +08:00
|
|
|
#[cfg(any(target_arch = "riscv32"))]
|
|
|
|
pub mod riscv32;
|
|
|
|
|
2017-09-16 06:18:54 +08:00
|
|
|
#[cfg(target_arch = "x86")]
|
|
|
|
pub mod x86;
|
|
|
|
|
2016-08-17 06:46:46 +08:00
|
|
|
#[cfg(target_arch = "x86_64")]
|
|
|
|
pub mod x86_64;
|
2017-07-06 13:18:19 +08:00
|
|
|
|
|
|
|
pub mod probestack;
|