1#![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
2#![cfg_attr(not(feature = "no-asm"), feature(asm))]
3#![feature(abi_unadjusted)]
4#![feature(asm_experimental_arch)]
5#![cfg_attr(not(feature = "no-asm"), feature(global_asm))]
6#![feature(cfg_target_has_atomic)]
7#![feature(compiler_builtins)]
8#![feature(core_ffi_c)]
9#![feature(core_intrinsics)]
10#![feature(inline_const)]
11#![feature(lang_items)]
12#![feature(linkage)]
13#![feature(naked_functions)]
14#![feature(repr_simd)]
15#![no_builtins]
16#![no_std]
17#![allow(unused_features)]
18#![allow(internal_features)]
19// We use `u128` in a whole bunch of places which we currently agree with the
20// compiler on ABIs and such, so we should be "good enough" for now and changes
21// to the `u128` ABI will be reflected here.
22#![allow(improper_ctypes, improper_ctypes_definitions)]
23// `mem::swap` cannot be used because it may generate references to memcpy in unoptimized code.
24#![allow(clippy::manual_swap)]
25// Support compiling on both stage0 and stage1 which may differ in supported stable features.
26#![allow(stable_features)]
27
28// We disable #[no_mangle] for tests so that we can verify the test results
29// against the native compiler-rt implementations of the builtins.
30
31// NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
32// implementation of that intrinsic and we'll prefer to use that
33
34// NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
35// that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
36// AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
37
38#[cfg(test)]
39extern crate core;
40
41#[macro_use]
42mod macros;
43
44pub mod float;
45pub mod int;
46
47#[cfg(any(
48 all(target_family = "wasm", target_os = "unknown"),
49 target_os = "uefi",
50 target_os = "none",
51 target_os = "xous",
52 all(target_vendor = "fortanix", target_env = "sgx"),
53 target_os = "windows"
54))]
55pub mod math;
56pub mod mem;
57
58#[cfg(target_arch = "arm")]
59pub mod arm;
60
61#[cfg(target_arch = "aarch64")]
62pub mod aarch64;
63
64#[cfg(all(target_arch = "aarch64", target_os = "linux", not(feature = "no-asm"),))]
65pub mod aarch64_linux;
66
67#[cfg(all(
68 kernel_user_helpers,
69 any(target_os = "linux", target_os = "android"),
70 target_arch = "arm"
71))]
72pub mod arm_linux;
73
74#[cfg(target_arch = "hexagon")]
75pub mod hexagon;
76
77#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
78pub mod riscv;
79
80#[cfg(target_arch = "x86")]
81pub mod x86;
82
83#[cfg(target_arch = "x86_64")]
84pub mod x86_64;
85
86pub mod probestack;
87