aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-09-26 19:52:55 +0200
committerDario Nieuwenhuis <[email protected]>2022-09-26 19:53:22 +0200
commit1e95c4fcfff3edf87a6c4cdacb228cb08e6d4e50 (patch)
tree057e0fb17cfb688369450911ece317b06ca76c29
parent49070c75b6de7581e418f00e37540a34e0bf1dab (diff)
rp: Disable intrinsics by default.
-rwxr-xr-xci.sh1
-rw-r--r--embassy-rp/Cargo.toml2
-rw-r--r--embassy-rp/src/intrinsics.rs18
3 files changed, 11 insertions, 10 deletions
diff --git a/ci.sh b/ci.sh
index ae1b44281..69440ec36 100755
--- a/ci.sh
+++ b/ci.sh
@@ -58,6 +58,7 @@ cargo batch \
58 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \ 58 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \
59 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ 59 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \
60 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ 60 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \
61 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \
61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \ 62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \
62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \ 63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \
63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,unstable-traits \ 64 --- 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 df0af8dfb..c43fd7e72 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -23,7 +23,7 @@ unstable-pac = []
23time-driver = [] 23time-driver = []
24 24
25rom-func-cache = [] 25rom-func-cache = []
26disable-intrinsics = [] 26intrinsics = []
27rom-v2-intrinsics = [] 27rom-v2-intrinsics = []
28 28
29# Enable nightly-only features 29# Enable nightly-only features
diff --git a/embassy-rp/src/intrinsics.rs b/embassy-rp/src/intrinsics.rs
index ac1f54800..3e75fb7fc 100644
--- a/embassy-rp/src/intrinsics.rs
+++ b/embassy-rp/src/intrinsics.rs
@@ -17,7 +17,7 @@ macro_rules! intrinsics_aliases {
17 $alias:ident 17 $alias:ident
18 $($rest:ident)* 18 $($rest:ident)*
19 ) => { 19 ) => {
20 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 20 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
21 intrinsics! { 21 intrinsics! {
22 extern $abi fn $alias( $($argname: $ty),* ) -> $ret { 22 extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
23 $name($($argname),*) 23 $name($($argname),*)
@@ -35,7 +35,7 @@ macro_rules! intrinsics_aliases {
35 $alias:ident 35 $alias:ident
36 $($rest:ident)* 36 $($rest:ident)*
37 ) => { 37 ) => {
38 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 38 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
39 intrinsics! { 39 intrinsics! {
40 unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret { 40 unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
41 $name($($argname),*) 41 $name($($argname),*)
@@ -55,7 +55,7 @@ macro_rules! intrinsics_aliases {
55/// is to abstract anything special that needs to be done to override an 55/// is to abstract anything special that needs to be done to override an
56/// intrinsic function. Intrinsic generation is disabled for non-ARM targets 56/// intrinsic function. Intrinsic generation is disabled for non-ARM targets
57/// so things like CI and docs generation do not have problems. Additionally 57/// so things like CI and docs generation do not have problems. Additionally
58/// they can be disabled with the crate feature `disable-intrinsics` for 58/// they can be disabled by disabling the crate feature `intrinsics` for
59/// testing or comparing performance. 59/// testing or comparing performance.
60/// 60///
61/// Like the compiler-builtins macro, it accepts a series of functions that 61/// Like the compiler-builtins macro, it accepts a series of functions that
@@ -214,13 +214,13 @@ macro_rules! intrinsics {
214 214
215 $($rest:tt)* 215 $($rest:tt)*
216 ) => { 216 ) => {
217 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 217 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
218 $(#[$($attr)*])* 218 $(#[$($attr)*])*
219 extern $abi fn $name( $($argname: $ty),* ) -> $ret { 219 extern $abi fn $name( $($argname: $ty),* ) -> $ret {
220 $($body)* 220 $($body)*
221 } 221 }
222 222
223 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 223 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
224 mod $name { 224 mod $name {
225 #[no_mangle] 225 #[no_mangle]
226 $(#[$($attr)*])* 226 $(#[$($attr)*])*
@@ -231,7 +231,7 @@ macro_rules! intrinsics {
231 231
232 // Not exported, but defined so the actual implementation is 232 // Not exported, but defined so the actual implementation is
233 // considered used 233 // considered used
234 #[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] 234 #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))]
235 #[allow(dead_code)] 235 #[allow(dead_code)]
236 fn $name( $($argname: $ty),* ) -> $ret { 236 fn $name( $($argname: $ty),* ) -> $ret {
237 $($body)* 237 $($body)*
@@ -248,13 +248,13 @@ macro_rules! intrinsics {
248 248
249 $($rest:tt)* 249 $($rest:tt)*
250 ) => { 250 ) => {
251 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 251 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
252 $(#[$($attr)*])* 252 $(#[$($attr)*])*
253 unsafe extern $abi fn $name( $($argname: $ty),* ) -> $ret { 253 unsafe extern $abi fn $name( $($argname: $ty),* ) -> $ret {
254 $($body)* 254 $($body)*
255 } 255 }
256 256
257 #[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))] 257 #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
258 mod $name { 258 mod $name {
259 #[no_mangle] 259 #[no_mangle]
260 $(#[$($attr)*])* 260 $(#[$($attr)*])*
@@ -265,7 +265,7 @@ macro_rules! intrinsics {
265 265
266 // Not exported, but defined so the actual implementation is 266 // Not exported, but defined so the actual implementation is
267 // considered used 267 // considered used
268 #[cfg(not(all(target_arch = "arm", not(feature = "disable-intrinsics"))))] 268 #[cfg(not(all(target_arch = "arm", feature = "intrinsics")))]
269 #[allow(dead_code)] 269 #[allow(dead_code)]
270 unsafe fn $name( $($argname: $ty),* ) -> $ret { 270 unsafe fn $name( $($argname: $ty),* ) -> $ret {
271 $($body)* 271 $($body)*