lib.rs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #![cfg_attr(not(stage0), deny(warnings))]
  2. #![cfg_attr(not(test), no_std)]
  3. #![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
  4. #![crate_name = "compiler_builtins"]
  5. #![crate_type = "rlib"]
  6. #![doc(
  7. html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
  8. html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
  9. html_root_url = "https://doc.rust-lang.org/nightly/",
  10. html_playground_url = "https://play.rust-lang.org/",
  11. test(attr(deny(warnings)))
  12. )]
  13. #![feature(asm)]
  14. #![feature(compiler_builtins)]
  15. #![feature(core_intrinsics)]
  16. #![feature(naked_functions)]
  17. #![feature(repr_simd)]
  18. #![feature(abi_unadjusted)]
  19. #![feature(linkage)]
  20. #![feature(lang_items)]
  21. #![allow(unused_features)]
  22. #![no_builtins]
  23. #![cfg_attr(feature = "compiler-builtins", feature(staged_api))]
  24. #![cfg_attr(
  25. feature = "compiler-builtins",
  26. unstable(
  27. feature = "compiler_builtins_lib",
  28. reason = "Compiler builtins. Will never become stable.",
  29. issue = "0"
  30. )
  31. )]
  32. // We disable #[no_mangle] for tests so that we can verify the test results
  33. // against the native compiler-rt implementations of the builtins.
  34. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  35. // implementation of that intrinsic and we'll prefer to use that
  36. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  37. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  38. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  39. #[cfg(test)]
  40. extern crate core;
  41. fn abort() -> ! {
  42. unsafe { core::intrinsics::abort() }
  43. }
  44. #[macro_use]
  45. mod macros;
  46. pub mod float;
  47. pub mod int;
  48. #[cfg(any(
  49. all(target_arch = "wasm32", target_os = "unknown"),
  50. all(target_arch = "arm", target_os = "none"),
  51. all(target_vendor = "fortanix", target_env = "sgx")
  52. ))]
  53. pub mod math;
  54. pub mod mem;
  55. #[cfg(target_arch = "arm")]
  56. pub mod arm;
  57. #[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
  58. pub mod arm_linux;
  59. #[cfg(any(target_arch = "riscv32"))]
  60. pub mod riscv32;
  61. #[cfg(target_arch = "x86")]
  62. pub mod x86;
  63. #[cfg(target_arch = "x86_64")]
  64. pub mod x86_64;
  65. pub mod probestack;