lib.rs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_intrinsics)]
  8. #![feature(lang_items)]
  9. #![feature(linkage)]
  10. #![feature(naked_functions)]
  11. #![feature(repr_simd)]
  12. #![no_builtins]
  13. #![no_std]
  14. #![allow(unused_features)]
  15. // We use `u128` in a whole bunch of places which we currently agree with the
  16. // compiler on ABIs and such, so we should be "good enough" for now and changes
  17. // to the `u128` ABI will be reflected here.
  18. #![allow(improper_ctypes, improper_ctypes_definitions)]
  19. // We disable #[no_mangle] for tests so that we can verify the test results
  20. // against the native compiler-rt implementations of the builtins.
  21. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  22. // implementation of that intrinsic and we'll prefer to use that
  23. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  24. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  25. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  26. #[cfg(test)]
  27. extern crate core;
  28. #[allow(unused_unsafe)]
  29. fn abort() -> ! {
  30. unsafe { core::intrinsics::abort() }
  31. }
  32. #[macro_use]
  33. mod macros;
  34. pub mod float;
  35. pub mod int;
  36. #[cfg(any(
  37. all(target_arch = "wasm32", target_os = "unknown"),
  38. all(target_arch = "arm", target_os = "none"),
  39. all(target_vendor = "fortanix", target_env = "sgx")
  40. ))]
  41. pub mod math;
  42. pub mod mem;
  43. #[cfg(target_arch = "arm")]
  44. pub mod arm;
  45. #[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
  46. pub mod arm_linux;
  47. #[cfg(any(target_arch = "riscv32"))]
  48. pub mod riscv32;
  49. #[cfg(target_arch = "x86")]
  50. pub mod x86;
  51. #[cfg(target_arch = "x86_64")]
  52. pub mod x86_64;
  53. pub mod probestack;