lib.rs 2.0 KB

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