lib.rs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
  2. #![feature(abi_unadjusted)]
  3. #![feature(llvm_asm)]
  4. #![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)]
  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. fn abort() -> ! {
  29. unsafe { core::intrinsics::abort() }
  30. }
  31. #[macro_use]
  32. mod macros;
  33. pub mod float;
  34. pub mod int;
  35. #[cfg(any(
  36. all(target_arch = "wasm32", target_os = "unknown"),
  37. all(target_arch = "arm", target_os = "none"),
  38. all(target_vendor = "fortanix", target_env = "sgx")
  39. ))]
  40. pub mod math;
  41. pub mod mem;
  42. #[cfg(target_arch = "arm")]
  43. pub mod arm;
  44. #[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
  45. pub mod arm_linux;
  46. #[cfg(any(target_arch = "riscv32"))]
  47. pub mod riscv32;
  48. #[cfg(target_arch = "x86")]
  49. pub mod x86;
  50. #[cfg(target_arch = "x86_64")]
  51. pub mod x86_64;
  52. pub mod probestack;