| 1 | |
| 2 |
|
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | #![allow(internal_features)]
|
| 23 | #![feature(compiler_builtins)]
|
| 24 | #![compiler_builtins]
|
| 25 | #![no_builtins]
|
| 26 | #![no_std]
|
| 27 |
|
| 28 | macro_rules! define_panicking_intrinsics(
|
| 29 | ($reason: tt, { $($ident: ident, )* }) => {
|
| 30 | $(
|
| 31 | #[doc(hidden)]
|
| 32 | #[export_name = concat!("__rust", stringify!($ident))]
|
| 33 | pub extern "C" fn $ident() {
|
| 34 | panic!($reason);
|
| 35 | }
|
| 36 | )*
|
| 37 | }
|
| 38 | );
|
| 39 |
|
| 40 | define_panicking_intrinsics!("`f32` should not be used", {
|
| 41 | __addsf3,
|
| 42 | __eqsf2,
|
| 43 | __extendsfdf2,
|
| 44 | __gesf2,
|
| 45 | __lesf2,
|
| 46 | __ltsf2,
|
| 47 | __mulsf3,
|
| 48 | __nesf2,
|
| 49 | __truncdfsf2,
|
| 50 | __unordsf2,
|
| 51 | });
|
| 52 |
|
| 53 | define_panicking_intrinsics!("`f64` should not be used", {
|
| 54 | __adddf3,
|
| 55 | __eqdf2,
|
| 56 | __ledf2,
|
| 57 | __ltdf2,
|
| 58 | __muldf3,
|
| 59 | __unorddf2,
|
| 60 | });
|
| 61 |
|
| 62 | define_panicking_intrinsics!("`i128` should not be used", {
|
| 63 | __ashrti3,
|
| 64 | __muloti4,
|
| 65 | __multi3,
|
| 66 | });
|
| 67 |
|
| 68 | define_panicking_intrinsics!("`u128` should not be used", {
|
| 69 | __ashlti3,
|
| 70 | __lshrti3,
|
| 71 | __udivmodti4,
|
| 72 | __udivti3,
|
| 73 | __umodti3,
|
| 74 | });
|
| 75 |
|
| 76 | #[cfg(target_arch = "arm")]
|
| 77 | define_panicking_intrinsics!("`f32` should not be used", {
|
| 78 | __aeabi_fadd,
|
| 79 | __aeabi_fmul,
|
| 80 | __aeabi_fcmpeq,
|
| 81 | __aeabi_fcmple,
|
| 82 | __aeabi_fcmplt,
|
| 83 | __aeabi_fcmpun,
|
| 84 | });
|
| 85 |
|
| 86 | #[cfg(target_arch = "arm")]
|
| 87 | define_panicking_intrinsics!("`f64` should not be used", {
|
| 88 | __aeabi_dadd,
|
| 89 | __aeabi_dmul,
|
| 90 | __aeabi_dcmple,
|
| 91 | __aeabi_dcmplt,
|
| 92 | __aeabi_dcmpun,
|
| 93 | });
|
| 94 |
|
| 95 | #[cfg(target_arch = "arm")]
|
| 96 | define_panicking_intrinsics!("`u64` division/modulo should not be used", {
|
| 97 | __aeabi_uldivmod,
|
| 98 | });
|
| 99 |
|
| 100 | #[cfg(target_arch = "powerpc")]
|
| 101 | define_panicking_intrinsics!("`u64` division/modulo should not be used", {
|
| 102 | __udivdi3,
|
| 103 | __umoddi3,
|
| 104 | });
|
| 105 |
|
| 106 | |
| 107 | |