Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-crt/math/arm/nearbyint.S  | 17 +++++------------
 mingw-w64-crt/math/arm/nearbyintf.S | 17 +++++------------
 mingw-w64-crt/math/arm/nearbyintl.S | 17 +++++------------
 3 files changed, 15 insertions(+), 36 deletions(-)

diff --git a/mingw-w64-crt/math/arm/nearbyint.S 
b/mingw-w64-crt/math/arm/nearbyint.S
index dc66a9787..4754d9d66 100644
--- a/mingw-w64-crt/math/arm/nearbyint.S
+++ b/mingw-w64-crt/math/arm/nearbyint.S
@@ -11,15 +11,8 @@
        .globl __MINGW_USYMBOL(nearbyint)
        .def    __MINGW_USYMBOL(nearbyint);     .scl    2;      .type   32;     
.endef
 __MINGW_USYMBOL(nearbyint):
-       vmov    r2, r3, d0
-       lsr             r3, r3, #20
-       bic             r3, r3, #0x800
-       movw    r2, #0x7ff
-       cmp             r2, r3 /* Check for INF/NAN, just return the input in 
those cases */
-       it              eq
-       bxeq    lr
-       vmrs    r1, fpscr
-       vcvtr.s32.f64   s0, d0
-       vcvt.f64.s32    d0, s0
-       vmsr    fpscr, r1
-       bx      lr
+       push    {r4, lr}
+       vmrs    r4, fpscr
+       bl      rint
+       vmsr    fpscr, r4
+       pop     {r4, pc}
diff --git a/mingw-w64-crt/math/arm/nearbyintf.S 
b/mingw-w64-crt/math/arm/nearbyintf.S
index b880c7110..00236cedc 100644
--- a/mingw-w64-crt/math/arm/nearbyintf.S
+++ b/mingw-w64-crt/math/arm/nearbyintf.S
@@ -11,15 +11,8 @@
        .globl __MINGW_USYMBOL(nearbyintf)
        .def    __MINGW_USYMBOL(nearbyintf);    .scl    2;      .type   32;     
.endef
 __MINGW_USYMBOL(nearbyintf):
-       vmov    r2, r3, d0
-       lsr             r3, r3, #20
-       bic             r3, r3, #0x800
-       movw    r2, #0x7ff
-       cmp             r2, r3 /* Check for INF/NAN, just return the input in 
those cases */
-       it              eq
-       bxeq    lr
-       vmrs    r1, fpscr
-       vcvtr.s32.f32   s0, s0
-       vcvt.f32.s32    s0, s0
-       vmsr    fpscr, r1
-       bx      lr
+       push    {r4, lr}
+       vmrs    r4, fpscr
+       bl      rintf
+       vmsr    fpscr, r4
+       pop     {r4, pc}
diff --git a/mingw-w64-crt/math/arm/nearbyintl.S 
b/mingw-w64-crt/math/arm/nearbyintl.S
index bceda5e40..a552d14e1 100644
--- a/mingw-w64-crt/math/arm/nearbyintl.S
+++ b/mingw-w64-crt/math/arm/nearbyintl.S
@@ -11,15 +11,8 @@
        .globl __MINGW_USYMBOL(nearbyintl)
        .def    __MINGW_USYMBOL(nearbyintl);    .scl    2;      .type   32;     
.endef
 __MINGW_USYMBOL(nearbyintl):
-       vmov    r2, r3, d0
-       lsr             r3, r3, #20
-       bic             r3, r3, #0x800
-       movw    r2, #0x7ff
-       cmp             r2, r3 /* Check for INF/NAN, just return the input in 
those cases */
-       it              eq
-       bxeq    lr
-       vmrs    r1, fpscr
-       vcvtr.s32.f64   s0, d0
-       vcvt.f64.s32    d0, s0
-       vmsr    fpscr, r1
-       bx      lr
+       push    {r4, lr}
+       vmrs    r4, fpscr
+       bl      rintl
+       vmsr    fpscr, r4
+       pop     {r4, pc}
-- 
2.17.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to