lib.rs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // `mem::swap` cannot be used because it may generate references to memcpy in unoptimized code.
  20. #![allow(clippy::manual_swap)]
  21. // We disable #[no_mangle] for tests so that we can verify the test results
  22. // against the native compiler-rt implementations of the builtins.
  23. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  24. // implementation of that intrinsic and we'll prefer to use that
  25. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  26. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  27. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  28. #[cfg(test)]
  29. extern crate core;
  30. #[macro_use]
  31. mod macros;
  32. pub mod float;
  33. pub mod int;
  34. #[cfg(any(
  35. all(target_family = "wasm", target_os = "unknown"),
  36. all(target_arch = "x86_64", target_os = "uefi"),
  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(
  45. kernel_user_helpers,
  46. any(target_os = "linux", target_os = "android"),
  47. target_arch = "arm"
  48. ))]
  49. pub mod arm_linux;
  50. #[cfg(any(target_arch = "riscv32"))]
  51. pub mod riscv32;
  52. #[cfg(target_arch = "x86")]
  53. pub mod x86;
  54. #[cfg(target_arch = "x86_64")]
  55. pub mod x86_64;
  56. pub mod probestack;