lib.rs 2.2 KB

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