Skip to content

Commit

Permalink
Remove thumbv6m configuration of intrinsic example
Browse files Browse the repository at this point in the history
It seems that the intrinsics that were generated for the functions in
example/intrinsics.rs where different implementations were given for
thumb6m-none-eabi target, have now been implemented in Rust so
configuration is not needed anymore.
  • Loading branch information
hug-dev committed Mar 14, 2019
1 parent 85101f2 commit 5d683ba
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions examples/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ extern crate panic_handler;
#[link(name = "c")]
extern {}

// NOTE cfg(not(thumbv6m)) means that the operation is not supported on ARMv6-M at all. Not even
// compiler-rt provides a C/assembly implementation.

// Every function in this module maps will be lowered to an intrinsic by LLVM, if the platform
// doesn't have native support for the operation used in the function. ARM has a naming convention
// convention for its intrinsics that's different from other architectures; that's why some function
Expand All @@ -39,70 +36,40 @@ mod intrinsics {
}

// fixdfdi
#[cfg(not(thumbv6m))]
pub fn aeabi_d2l(x: f64) -> i64 {
x as i64
}

#[cfg(thumbv6m)]
pub fn aeabi_d2l(_: f64) -> i64 {
0
}

// fixunsdfsi
pub fn aeabi_d2uiz(x: f64) -> u32 {
x as u32
}

// fixunsdfdi
#[cfg(not(thumbv6m))]
pub fn aeabi_d2ulz(x: f64) -> u64 {
x as u64
}

#[cfg(thumbv6m)]
pub fn aeabi_d2ulz(_: f64) -> u64 {
0
}

// adddf3
pub fn aeabi_dadd(a: f64, b: f64) -> f64 {
a + b
}

// eqdf2
#[cfg(not(thumbv6m))]
pub fn aeabi_dcmpeq(a: f64, b: f64) -> bool {
a == b
}

#[cfg(thumbv6m)]
pub fn aeabi_dcmpeq(_: f64, _: f64) -> bool {
true
}

// gtdf2
#[cfg(not(thumbv6m))]
pub fn aeabi_dcmpgt(a: f64, b: f64) -> bool {
a > b
}

#[cfg(thumbv6m)]
pub fn aeabi_dcmpgt(_: f64, _: f64) -> bool {
true
}

// ltdf2
#[cfg(not(thumbv6m))]
pub fn aeabi_dcmplt(a: f64, b: f64) -> bool {
a < b
}

#[cfg(thumbv6m)]
pub fn aeabi_dcmplt(_: f64, _: f64) -> bool {
true
}

// divdf3
pub fn aeabi_ddiv(a: f64, b: f64) -> f64 {
a / b
Expand All @@ -129,70 +96,40 @@ mod intrinsics {
}

// fixsfdi
#[cfg(not(thumbv6m))]
pub fn aeabi_f2lz(x: f32) -> i64 {
x as i64
}

#[cfg(thumbv6m)]
pub fn aeabi_f2lz(_: f32) -> i64 {
0
}

// fixunssfsi
pub fn aeabi_f2uiz(x: f32) -> u32 {
x as u32
}

// fixunssfdi
#[cfg(not(thumbv6m))]
pub fn aeabi_f2ulz(x: f32) -> u64 {
x as u64
}

#[cfg(thumbv6m)]
pub fn aeabi_f2ulz(_: f32) -> u64 {
0
}

// addsf3
pub fn aeabi_fadd(a: f32, b: f32) -> f32 {
a + b
}

// eqsf2
#[cfg(not(thumbv6m))]
pub fn aeabi_fcmpeq(a: f32, b: f32) -> bool {
a == b
}

#[cfg(thumbv6m)]
pub fn aeabi_fcmpeq(_: f32, _: f32) -> bool {
true
}

// gtsf2
#[cfg(not(thumbv6m))]
pub fn aeabi_fcmpgt(a: f32, b: f32) -> bool {
a > b
}

#[cfg(thumbv6m)]
pub fn aeabi_fcmpgt(_: f32, _: f32) -> bool {
true
}

// ltsf2
#[cfg(not(thumbv6m))]
pub fn aeabi_fcmplt(a: f32, b: f32) -> bool {
a < b
}

#[cfg(thumbv6m)]
pub fn aeabi_fcmplt(_: f32, _: f32) -> bool {
true
}

// divsf3
pub fn aeabi_fdiv(a: f32, b: f32) -> f32 {
a / b
Expand Down

0 comments on commit 5d683ba

Please sign in to comment.