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