lib.rs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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(repr_simd)]
  16. #![feature(abi_unadjusted)]
  17. #![feature(linkage)]
  18. #![feature(lang_items)]
  19. #![allow(unused_features)]
  20. #![allow(stable_features)] // FIXME(mark-i-m): remove after i128 stabilizes
  21. #![feature(i128_type)]
  22. #![no_builtins]
  23. #![cfg_attr(feature = "compiler-builtins", feature(staged_api))]
  24. #![cfg_attr(feature = "compiler-builtins",
  25. unstable(feature = "compiler_builtins_lib",
  26. reason = "Compiler builtins. Will never become stable.",
  27. issue = "0"))]
  28. // We disable #[no_mangle] for tests so that we can verify the test results
  29. // against the native compiler-rt implementations of the builtins.
  30. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  31. // implementation of that intrinsic and we'll prefer to use that
  32. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  33. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  34. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  35. #[cfg(test)]
  36. extern crate core;
  37. fn abort() -> ! {
  38. unsafe { core::intrinsics::abort() }
  39. }
  40. #[macro_use]
  41. mod macros;
  42. pub mod int;
  43. pub mod float;
  44. pub mod mem;
  45. #[cfg(target_arch = "arm")]
  46. pub mod arm;
  47. #[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
  48. pub mod arm_linux;
  49. #[cfg(target_arch = "x86")]
  50. pub mod x86;
  51. #[cfg(target_arch = "x86_64")]
  52. pub mod x86_64;
  53. pub mod probestack;