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