975: rp: Disable intrinsics by default. r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This commit is contained in:
bors[bot] 2022-09-26 17:57:48 +00:00 committed by GitHub
commit 049c31613b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

1
ci.sh
View File

@ -58,6 +58,7 @@ cargo batch \
--- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \ --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \
--- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \
--- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \
--- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \
--- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \
--- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \
--- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,unstable-traits \ --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,unstable-traits \

View File

@ -23,7 +23,7 @@ unstable-pac = []
time-driver = [] time-driver = []
rom-func-cache = [] rom-func-cache = []
disable-intrinsics = [] intrinsics = []
rom-v2-intrinsics = [] rom-v2-intrinsics = []
# Enable nightly-only features # Enable nightly-only features

View File

@ -17,7 +17,7 @@ macro_rules! intrinsics_aliases {
$alias:ident $alias:ident
$($rest:ident)* $($rest:ident)*
) => { ) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
intrinsics! { intrinsics! {
extern $abi fn $alias( $($argname: $ty),* ) -> $ret { extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
$name($($argname),*) $name($($argname),*)
@ -35,7 +35,7 @@ macro_rules! intrinsics_aliases {
$alias:ident $alias:ident
$($rest:ident)* $($rest:ident)*
) => { ) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
intrinsics! { intrinsics! {
unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret { unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
$name($($argname),*) $name($($argname),*)
@ -55,7 +55,7 @@ macro_rules! intrinsics_aliases {
/// is to abstract anything special that needs to be done to override an /// is to abstract anything special that needs to be done to override an
/// intrinsic function. Intrinsic generation is disabled for non-ARM targets /// intrinsic function. Intrinsic generation is disabled for non-ARM targets
/// so things like CI and docs generation do not have problems. Additionally /// so things like CI and docs generation do not have problems. Additionally
/// they can be disabled with the crate feature `disable-intrinsics` for /// they can be disabled by disabling the crate feature `intrinsics` for
/// testing or comparing performance. /// testing or comparing performance.
/// ///
/// Like the compiler-builtins macro, it accepts a series of functions that /// Like the compiler-builtins macro, it accepts a series of functions that
@ -214,13 +214,13 @@ macro_rules! intrinsics {
$($rest:tt)* $($rest:tt)*
) => { ) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
$(#[$($attr)*])* $(#[$($attr)*])*
extern $abi fn $name( $($argname: $ty),* ) -> $ret { extern $abi fn $name( $($argname: $ty),* ) -> $ret {
$($body)* $($body)*
} }
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
mod $name { mod $name {
#[no_mangle] #[no_mangle]
$(#[$($attr)*])* $(#[$($attr)*])*
@ -231,7 +231,7 @@ macro_rules! intrinsics {
// Not exported, but defined so the actual implementation is // Not exported, but defined so the actual implementation is
// considered used // considered used
#[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))]
#[allow(dead_code)] #[allow(dead_code)]
fn $name( $($argname: $ty),* ) -> $ret { fn $name( $($argname: $ty),* ) -> $ret {
$($body)* $($body)*
@ -248,13 +248,13 @@ macro_rules! intrinsics {
$($rest:tt)* $($rest:tt)*
) => { ) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
$(#[$($attr)*])* $(#[$($attr)*])*
unsafe extern $abi fn $name( $($argname: $ty),* ) -> $ret { unsafe extern $abi fn $name( $($argname: $ty),* ) -> $ret {
$($body)* $($body)*
} }
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
mod $name { mod $name {
#[no_mangle] #[no_mangle]
$(#[$($attr)*])* $(#[$($attr)*])*
@ -265,7 +265,7 @@ macro_rules! intrinsics {
// Not exported, but defined so the actual implementation is // Not exported, but defined so the actual implementation is
// considered used // considered used
#[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))]
#[allow(dead_code)] #[allow(dead_code)]
unsafe fn $name( $($argname: $ty),* ) -> $ret { unsafe fn $name( $($argname: $ty),* ) -> $ret {
$($body)* $($body)*