~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/rust/compiler_builtins.rs

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /rust/compiler_builtins.rs (Version linux-6.12-rc7) and /rust/compiler_builtins.rs (Version linux-6.6.60)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2                                                     2 
  3 //! Our own `compiler_builtins`.                    3 //! Our own `compiler_builtins`.
  4 //!                                                 4 //!
  5 //! Rust provides [`compiler_builtins`] as a p      5 //! Rust provides [`compiler_builtins`] as a port of LLVM's [`compiler-rt`].
  6 //! Since we do not need the vast majority of       6 //! Since we do not need the vast majority of them, we avoid the dependency
  7 //! by providing this file.                         7 //! by providing this file.
  8 //!                                                 8 //!
  9 //! At the moment, some builtins are required       9 //! At the moment, some builtins are required that should not be. For instance,
 10 //! [`core`] has 128-bit integers functionalit     10 //! [`core`] has 128-bit integers functionality which we should not be compiling
 11 //! in. We will work with upstream [`core`] to     11 //! in. We will work with upstream [`core`] to provide feature flags to disable
 12 //! the parts we do not need. For the moment,      12 //! the parts we do not need. For the moment, we define them to [`panic!`] at
 13 //! runtime for simplicity to catch mistakes,      13 //! runtime for simplicity to catch mistakes, instead of performing surgery
 14 //! on `core.o`.                                   14 //! on `core.o`.
 15 //!                                                15 //!
 16 //! In any case, all these symbols are weakene     16 //! In any case, all these symbols are weakened to ensure we do not override
 17 //! those that may be provided by the rest of      17 //! those that may be provided by the rest of the kernel.
 18 //!                                                18 //!
 19 //! [`compiler_builtins`]: https://github.com/     19 //! [`compiler_builtins`]: https://github.com/rust-lang/compiler-builtins
 20 //! [`compiler-rt`]: https://compiler-rt.llvm.     20 //! [`compiler-rt`]: https://compiler-rt.llvm.org/
 21                                                    21 
 22 #![allow(internal_features)]                       22 #![allow(internal_features)]
 23 #![feature(compiler_builtins)]                     23 #![feature(compiler_builtins)]
 24 #![compiler_builtins]                              24 #![compiler_builtins]
 25 #![no_builtins]                                    25 #![no_builtins]
 26 #![no_std]                                         26 #![no_std]
 27                                                    27 
 28 macro_rules! define_panicking_intrinsics(          28 macro_rules! define_panicking_intrinsics(
 29     ($reason: tt, { $($ident: ident, )* }) =>      29     ($reason: tt, { $($ident: ident, )* }) => {
 30         $(                                         30         $(
 31             #[doc(hidden)]                         31             #[doc(hidden)]
 32             #[export_name = concat!("__rust",      32             #[export_name = concat!("__rust", stringify!($ident))]
 33             pub extern "C" fn $ident() {           33             pub extern "C" fn $ident() {
 34                 panic!($reason);                   34                 panic!($reason);
 35             }                                      35             }
 36         )*                                         36         )*
 37     }                                              37     }
 38 );                                                 38 );
 39                                                    39 
 40 define_panicking_intrinsics!("`f32` should not     40 define_panicking_intrinsics!("`f32` should not be used", {
 41     __addsf3,                                      41     __addsf3,
 42     __eqsf2,                                       42     __eqsf2,
 43     __extendsfdf2,                             << 
 44     __gesf2,                                       43     __gesf2,
 45     __lesf2,                                       44     __lesf2,
 46     __ltsf2,                                       45     __ltsf2,
 47     __mulsf3,                                      46     __mulsf3,
 48     __nesf2,                                       47     __nesf2,
 49     __truncdfsf2,                              << 
 50     __unordsf2,                                    48     __unordsf2,
 51 });                                                49 });
 52                                                    50 
 53 define_panicking_intrinsics!("`f64` should not     51 define_panicking_intrinsics!("`f64` should not be used", {
 54     __adddf3,                                      52     __adddf3,
 55     __eqdf2,                                   << 
 56     __ledf2,                                       53     __ledf2,
 57     __ltdf2,                                       54     __ltdf2,
 58     __muldf3,                                      55     __muldf3,
 59     __unorddf2,                                    56     __unorddf2,
 60 });                                                57 });
 61                                                    58 
 62 define_panicking_intrinsics!("`i128` should no     59 define_panicking_intrinsics!("`i128` should not be used", {
 63     __ashrti3,                                     60     __ashrti3,
 64     __muloti4,                                     61     __muloti4,
 65     __multi3,                                      62     __multi3,
 66 });                                                63 });
 67                                                    64 
 68 define_panicking_intrinsics!("`u128` should no     65 define_panicking_intrinsics!("`u128` should not be used", {
 69     __ashlti3,                                     66     __ashlti3,
 70     __lshrti3,                                     67     __lshrti3,
 71     __udivmodti4,                                  68     __udivmodti4,
 72     __udivti3,                                     69     __udivti3,
 73     __umodti3,                                     70     __umodti3,
 74 });                                                71 });
 75                                                    72 
 76 // NOTE: if you are adding a new intrinsic her     73 // NOTE: if you are adding a new intrinsic here, you should also add it to
 77 // `redirect-intrinsics` in `rust/Makefile`.       74 // `redirect-intrinsics` in `rust/Makefile`.
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php