Skip to content

Add ledf2vfp/leds2vfp, add test cases for __unordsf2/__unorddf2 and re-enable thumb* targets #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ matrix:
- env: TARGET=x86_64-apple-darwin
os: osx
- env: TARGET=x86_64-unknown-linux-gnu
allow_failures:
- env: TARGET=thumbv6m-linux-eabi
- env: TARGET=thumbv7em-linux-eabi
- env: TARGET=thumbv7em-linux-eabihf
- env: TARGET=thumbv7m-linux-eabi

install:
- case $TARGET in
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ features = ["c"]
- [x] arm/gesf2vfp.S
- [x] arm/gtdf2vfp.S
- [x] arm/gtsf2vfp.S
- [ ] arm/ledf2vfp.S
- [ ] arm/lesf2vfp.S
- [x] arm/ledf2vfp.S
- [x] arm/lesf2vfp.S
- [x] arm/ltdf2vfp.S
- [x] arm/ltsf2vfp.S
- [ ] arm/modsi3.S (generic version is done)
Expand Down
2 changes: 0 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,6 @@ mod c {
"arm/floatsisfvfp.S",
"arm/floatunssidfvfp.S",
"arm/floatunssisfvfp.S",
"arm/ledf2vfp.S",
"arm/lesf2vfp.S",
"arm/restore_vfp_d8_d15_regs.S",
"arm/save_vfp_d8_d15_regs.S",
],
Expand Down
8 changes: 8 additions & 0 deletions src/float/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ intrinsics! {
(a < b) as i32
}

pub extern "C" fn __lesf2vfp(a: f32, b: f32) -> i32 {
(a <= b) as i32
}

pub extern "C" fn __ledf2vfp(a: f64, b: f64) -> i32 {
(a <= b) as i32
}

pub extern "C" fn __nesf2vfp(a: f32, b: f32) -> i32 {
(a != b) as i32
}
Expand Down
26 changes: 26 additions & 0 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ fn main() {
},
"compiler_builtins::float::cmp::__lesf2(a, b)");

gen(|(a, b): (MyF32, MyF32)| {
let c = a.0.is_nan() || b.0.is_nan();
Some(c as i32)
},
"compiler_builtins::float::cmp::__unordsf2(a, b)");

gen(|(a, b): (MyF64, MyF64)| {
let c = a.0.is_nan() || b.0.is_nan();
Some(c as i32)
},
"compiler_builtins::float::cmp::__unorddf2(a, b)");

if target_arch_arm {
gen(|(a, b): (MyF32, MyF32)| {
if a.0.is_nan() || b.0.is_nan() {
Expand Down Expand Up @@ -276,6 +288,20 @@ fn main() {
Some((a.0 < b.0) as i32)
},
"compiler_builtins::float::cmp::__ltdf2vfp(a, b)");
gen(|(a, b): (LargeF32, LargeF32)| {
if a.0.is_nan() || b.0.is_nan() {
return None;
}
Some((a.0 <= b.0) as i32)
},
"compiler_builtins::float::cmp::__lesf2vfp(a, b)");
gen(|(a, b): (MyF64, MyF64)| {
if a.0.is_nan() || b.0.is_nan() {
return None;
}
Some((a.0 <= b.0) as i32)
},
"compiler_builtins::float::cmp::__ledf2vfp(a, b)");
gen(|(a, b): (LargeF32, LargeF32)| {
if a.0.is_nan() || b.0.is_nan() {
return None;
Expand Down