-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please review, i'll commit it.

Btw, what is mingw_getsp meant to do? return the stackpointer or the frame 
pointer?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQGcBAEBAgAGBQJTjj1RAAoJEGm5GZTakYssIEAL/ibFDp4l0FDKMyqZrO6lh1pI
6EKQiekydFYrMnYROx2tddO6e8o8uFQfV5KpwF5Uxe+RhMAt7wTHisH/MPR6GI6t
TGfqXUkkRiZFDNR+JvcItrvmKKNmK6uCERvRHA9bTVNPR2XcLVdDpEeT21p0CfjP
J0W4yNbogXUmDvkO6AMt+tI5hIQC+aWOGzsQFohyoSRxxCbiZH+mz0mJZSouBmtN
WCH1qVTiUe++1FfBX/vbYeJ7NKo51xJ5XytM8oaKGksPHmy13FchiBbHzoGvXIwm
7Fpd28fIc74fF5kItBbMxhfjQ1WBS5GWmOlLxMmfQShkulc3qv8Vp7wGG+iHGDWt
wx9VkVCcLZ8A6CtT/UqGc+I1Ktu6AbyWMPRoIs/89XHMy8plQVa7hlRib6IK43at
T0zXd7gmQs4NeVHja0qlg16Jkb+/ysFAm/YmGhj1EWBThhEeQMXMM2HdQ5IePZoE
cLHzvVGtdP8xfogtGpq9cIGI4RbI1GvqDvZFoX3lRA==
=5XF4
-----END PGP SIGNATURE-----
 Use gcc fabs builtins on ARM

diff --git a/mingw-w64-crt/math/fabs.c b/mingw-w64-crt/math/fabs.c
index f5e4dbe..cf2e6ef 100644
--- a/mingw-w64-crt/math/fabs.c
+++ b/mingw-w64-crt/math/fabs.c
@@ -9,12 +9,12 @@
 double
 fabs (double x)
 {
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_)
   return __builtin_fabs (x);
-#else
+#elif defined(__i386__) || defined(_X86_)
   double res = 0.0;
 
   asm ("fabs;" : "=t" (res) : "0" (x));
   return res;
-#endif
+#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) */
 }
diff --git a/mingw-w64-crt/math/fabsf.c b/mingw-w64-crt/math/fabsf.c
index 0a8fddb..5431c96 100644
--- a/mingw-w64-crt/math/fabsf.c
+++ b/mingw-w64-crt/math/fabsf.c
@@ -8,11 +8,11 @@ float fabsf (float x);
 float
 fabsf (float x)
 {
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_)
   return __builtin_fabsf (x);
-#else
+#elif defined(__i386__) || defined(_X86_)
   float res = 0.0F;
   asm ("fabs;" : "=t" (res) : "0" (x));
   return res;
-#endif
+#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) */
 }
diff --git a/mingw-w64-crt/math/fabsl.c b/mingw-w64-crt/math/fabsl.c
index 5ffbe41..2dfdfaa 100644
--- a/mingw-w64-crt/math/fabsl.c
+++ b/mingw-w64-crt/math/fabsl.c
@@ -8,7 +8,11 @@ long double fabsl (long double x);
 long double
 fabsl (long double x)
 {
+#if defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_)
   long double res = 0.0L;
   asm ("fabs;" : "=t" (res) : "0" (x));
   return res;
+#elif defined(__arm__) || defined(_ARM_)
+  return __builtin_fabsl (x);
+#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
 }

Attachment: tmp.diff.sig
Description: PGP signature

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to