From 1e95c4fcfff3edf87a6c4cdacb228cb08e6d4e50 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 26 Sep 2022 19:52:55 +0200 Subject: [PATCH] rp: Disable intrinsics by default. --- ci.sh | 1 + embassy-rp/Cargo.toml | 2 +- embassy-rp/src/intrinsics.rs | 18 +++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ci.sh b/ci.sh index ae1b4428..69440ec3 100755 --- a/ci.sh +++ b/ci.sh @@ -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 \ --- 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,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 \ diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index df0af8df..c43fd7e7 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml @@ -23,7 +23,7 @@ unstable-pac = [] time-driver = [] rom-func-cache = [] -disable-intrinsics = [] +intrinsics = [] rom-v2-intrinsics = [] # Enable nightly-only features diff --git a/embassy-rp/src/intrinsics.rs b/embassy-rp/src/intrinsics.rs index ac1f5480..3e75fb7f 100644 --- a/embassy-rp/src/intrinsics.rs +++ b/embassy-rp/src/intrinsics.rs @@ -17,7 +17,7 @@ macro_rules! intrinsics_aliases { $alias:ident $($rest:ident)* ) => { - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] intrinsics! { extern $abi fn $alias( $($argname: $ty),* ) -> $ret { $name($($argname),*) @@ -35,7 +35,7 @@ macro_rules! intrinsics_aliases { $alias:ident $($rest:ident)* ) => { - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] intrinsics! { unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret { $name($($argname),*) @@ -55,7 +55,7 @@ macro_rules! intrinsics_aliases { /// is to abstract anything special that needs to be done to override an /// intrinsic function. Intrinsic generation is disabled for non-ARM targets /// 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. /// /// Like the compiler-builtins macro, it accepts a series of functions that @@ -214,13 +214,13 @@ macro_rules! intrinsics { $($rest:tt)* ) => { - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] $(#[$($attr)*])* extern $abi fn $name( $($argname: $ty),* ) -> $ret { $($body)* } - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] mod $name { #[no_mangle] $(#[$($attr)*])* @@ -231,7 +231,7 @@ macro_rules! intrinsics { // Not exported, but defined so the actual implementation is // considered used - #[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] + #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))] #[allow(dead_code)] fn $name( $($argname: $ty),* ) -> $ret { $($body)* @@ -248,13 +248,13 @@ macro_rules! intrinsics { $($rest:tt)* ) => { - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] $(#[$($attr)*])* unsafe extern $abi fn $name( $($argname: $ty),* ) -> $ret { $($body)* } - #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] + #[cfg(all(target_arch = "arm", feature = "intrinsics"))] mod $name { #[no_mangle] $(#[$($attr)*])* @@ -265,7 +265,7 @@ macro_rules! intrinsics { // Not exported, but defined so the actual implementation is // considered used - #[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] + #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))] #[allow(dead_code)] unsafe fn $name( $($argname: $ty),* ) -> $ret { $($body)*