lib.rs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
  7. html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
  8. html_root_url = "https://doc.rust-lang.org/nightly/",
  9. html_playground_url = "https://play.rust-lang.org/",
  10. test(attr(deny(warnings))))]
  11. #![feature(asm)]
  12. #![feature(compiler_builtins)]
  13. #![feature(core_intrinsics)]
  14. #![feature(naked_functions)]
  15. #![feature(staged_api)]
  16. #![feature(i128_type)]
  17. #![feature(repr_simd)]
  18. #![feature(abi_unadjusted)]
  19. #![allow(unused_features)]
  20. #![no_builtins]
  21. #![unstable(feature = "compiler_builtins_lib",
  22. reason = "Compiler builtins. Will never become stable.",
  23. issue = "0")]
  24. // We disable #[no_mangle] for tests so that we can verify the test results
  25. // against the native compiler-rt implementations of the builtins.
  26. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  27. // implementation of that intrinsic and we'll prefer to use that
  28. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  29. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  30. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  31. #[cfg(test)]
  32. extern crate core;
  33. fn abort() -> ! {
  34. unsafe { core::intrinsics::abort() }
  35. }
  36. #[macro_use]
  37. mod macros;
  38. pub mod int;
  39. pub mod float;
  40. #[cfg(feature = "mem")]
  41. pub mod mem;
  42. #[cfg(target_arch = "arm")]
  43. pub mod arm;
  44. #[cfg(target_arch = "x86_64")]
  45. pub mod x86_64;