diff --git a/README.md b/README.md index 823877b..cef2fb0 100644 --- a/README.md +++ b/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/src/float/cmp.rs b/src/float/cmp.rs index 16b059e..01dd890 100644 --- a/src/float/cmp.rs +++ b/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/testcrate/build.rs b/testcrate/build.rs index d3850cc..92e0b5d 100644 --- a/testcrate/build.rs +++ b/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;