We already have a C based copysign function which is used on arm.
On arm, long double is equal to double, so just call the normal
double function instead of using the handwritten assembly.

The C based copysign function ends up at 5 instructions including
"bx lr", which is significantly shorter than this version.
---
 mingw-w64-crt/math/copysignl.S | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/mingw-w64-crt/math/copysignl.S b/mingw-w64-crt/math/copysignl.S
index 1ee4a45..5194330 100644
--- a/mingw-w64-crt/math/copysignl.S
+++ b/mingw-w64-crt/math/copysignl.S
@@ -33,19 +33,7 @@ __MINGW_USYMBOL(copysignl):
        movq    %rcx, %rax
        ret
 #elif defined(_ARM_) || defined(__arm__)
-       fcmpzd  d1
-       fmstat
-       bmi     1f /* jump if d1 is negative */
-       fcmpzd  d0
-       fmstat
-       it mi
-       vnegmi.f64      d0, d0 /* negate d0 if it is negative */
-       bx      lr
-       1: fcmpzd       d0
-       fmstat
-       it pl
-       vnegpl.f64      d0, d0 /* negate d0 if it is positive */
-       bx      lr
+       b       copysign
 #elif defined(_X86_) || defined(__i386__)
        movl    24(%esp),%edx
        movl    12(%esp),%eax
-- 
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