From 20de84d127eeb07fa4bae34960dcaa35a6124aac Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sun, 25 Feb 2018 17:50:56 +0100 Subject: [PATCH 1/4] Add __ledf2vfp and __lesf2vfp Now that `73884ae` is in some nightly release We can add ledf2vfp/leds2vfp and so these two functions be aliased to aeabi_fcmple/aeabi_dcmple on soft-float targets. --- library/compiler-builtins/README.md | 4 ++-- library/compiler-builtins/src/float/cmp.rs | 8 ++++++++ library/compiler-builtins/testcrate/build.rs | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/README.md b/library/compiler-builtins/README.md index 823877b8f5d6..cef2fb0974a7 100644 --- a/library/compiler-builtins/README.md +++ b/library/compiler-builtins/README.md @@ -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) diff --git a/library/compiler-builtins/src/float/cmp.rs b/library/compiler-builtins/src/float/cmp.rs index 16b059e157d3..01dd890550bc 100644 --- a/library/compiler-builtins/src/float/cmp.rs +++ b/library/compiler-builtins/src/float/cmp.rs @@ -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 } diff --git a/library/compiler-builtins/testcrate/build.rs b/library/compiler-builtins/testcrate/build.rs index d3850cc5cb5c..92e0b5d4c012 100644 --- a/library/compiler-builtins/testcrate/build.rs +++ b/library/compiler-builtins/testcrate/build.rs @@ -276,6 +276,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; From 6fedebb1661bdc027e360ac935020d28c969e349 Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sun, 25 Feb 2018 18:35:36 +0100 Subject: [PATCH 2/4] Add missing test cases for __unordsf2/__unorddf2 --- library/compiler-builtins/testcrate/build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/compiler-builtins/testcrate/build.rs b/library/compiler-builtins/testcrate/build.rs index 92e0b5d4c012..d50dc5623f54 100644 --- a/library/compiler-builtins/testcrate/build.rs +++ b/library/compiler-builtins/testcrate/build.rs @@ -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() { From 9fbdac0e38b7caedbbcf56a60dd977ea915216c0 Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sun, 25 Feb 2018 19:23:30 +0100 Subject: [PATCH 3/4] TravisCI: remove allow_failures for thumb* targets --- library/compiler-builtins/.travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/library/compiler-builtins/.travis.yml b/library/compiler-builtins/.travis.yml index efd0b1738e3e..898a600eb417 100644 --- a/library/compiler-builtins/.travis.yml +++ b/library/compiler-builtins/.travis.yml @@ -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 From ad3a5b682613b106c706b28ad1bf34444a419e17 Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sun, 25 Feb 2018 19:49:31 +0100 Subject: [PATCH 4/4] Remove ledf2vfp.S and lesf2vfp.S from build list --- library/compiler-builtins/build.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 9eca26c1dd9b..789311051de4 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -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", ],