---
 mingw-w64-crt/math/nearbyint.S  | 7 +++++++
 mingw-w64-crt/math/nearbyintf.S | 7 +++++++
 mingw-w64-crt/math/nearbyintl.S | 7 +++++++
 mingw-w64-crt/math/trunc.S      | 7 +++++++
 mingw-w64-crt/math/truncf.S     | 7 +++++++
 5 files changed, 35 insertions(+)

diff --git a/mingw-w64-crt/math/nearbyint.S b/mingw-w64-crt/math/nearbyint.S
index 8aec9bd..6aa1046 100644
--- a/mingw-w64-crt/math/nearbyint.S
+++ b/mingw-w64-crt/math/nearbyint.S
@@ -34,6 +34,13 @@ __MINGW_USYMBOL(nearbyint):
        movsd   -16(%rsp),%xmm0
        ret
 #elif defined(_ARM_) || defined(__arm__)
+       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
diff --git a/mingw-w64-crt/math/nearbyintf.S b/mingw-w64-crt/math/nearbyintf.S
index f175175..54f64fd 100644
--- a/mingw-w64-crt/math/nearbyintf.S
+++ b/mingw-w64-crt/math/nearbyintf.S
@@ -34,6 +34,13 @@ __MINGW_USYMBOL(nearbyintf):
        movss   -12(%rsp),%xmm0
        ret
 #elif defined(_ARM_) || defined(__arm__)
+       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
diff --git a/mingw-w64-crt/math/nearbyintl.S b/mingw-w64-crt/math/nearbyintl.S
index f4262a2..f0aca0f 100644
--- a/mingw-w64-crt/math/nearbyintl.S
+++ b/mingw-w64-crt/math/nearbyintl.S
@@ -35,6 +35,13 @@ __MINGW_USYMBOL(nearbyintl):
        fstpt   (%r8)
        ret
 #elif defined(_ARM_) || defined(__arm__)
+       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
diff --git a/mingw-w64-crt/math/trunc.S b/mingw-w64-crt/math/trunc.S
index 2430e5f..d2fca29 100755
--- a/mingw-w64-crt/math/trunc.S
+++ b/mingw-w64-crt/math/trunc.S
@@ -76,6 +76,13 @@ __MINGW_USYMBOL(trunc):
        ret
        .seh_endproc
 #elif defined(_ARM_) || defined(__arm__)
+       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
        orr             r0, r1, #0x00c00000 /* Round towards Zero */
        vmsr    fpscr, r0
diff --git a/mingw-w64-crt/math/truncf.S b/mingw-w64-crt/math/truncf.S
index b62d2d2..626b9a5 100755
--- a/mingw-w64-crt/math/truncf.S
+++ b/mingw-w64-crt/math/truncf.S
@@ -56,6 +56,13 @@ __MINGW_USYMBOL(truncf):
        ret
        .seh_endproc
 #elif defined(_ARM_) || defined(__arm__)
+       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
        orr             r0, r1, #0x00c00000 /* Round towards Zero */
        vmsr    fpscr, r0
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to