Fix flt to 32 bit int conversion in ILP32 aarch64
Commit Message
Here is a patch to fix two of the failures in the glibc testsuite for
ILP32 aarch64. The basic problem was that the code was doing conversions
from float to 64 bits in some cases where it should have been targeting
a 32 bit result.
This fixes the math/test-float and math/test-float-finite failures in
32 bit mode. It does not fix math/test-double or math/test-double-finite,
but it reduced the individual failures in each test from 133 to 11. The
remaining failures all involve the Inexact bit being set.
This patch can be checked in separately from the full ILP32 patchset and
does not cause any regressions in LP64 testing.
OK to checkin?
2016-11-29 Steve Ellcey <sellcey@caviumnetworks.com>
* sysdeps/aarch64/fpu/s_llrint.c (OREGS): Add define to match OTYPE.
* sysdeps/aarch64/fpu/s_llrintf.c (OREGS): Ditto.
* sysdeps/aarch64/fpu/s_llround.c (OREGS): Ditto.
* sysdeps/aarch64/fpu/s_llroundf.c (OREGS): Ditto.
* sysdeps/aarch64/fpu/s_lrint.c (OREGS): Set based on __ILP32__ if
it is not already set.
* sysdeps/aarch64/fpu/s_lround.c (OREGS): Ditto.
@@ -18,4 +18,5 @@
#define FUNC llrint
#define OTYPE long long int
+#define OREGS "x"
#include <s_lrint.c>
@@ -20,4 +20,5 @@
#define ITYPE float
#define IREGS "s"
#define OTYPE long long int
+#define OREGS "x"
#include <s_lrint.c>
@@ -18,4 +18,5 @@
#define FUNC llround
#define OTYPE long long int
+#define OREGS "x"
#include <s_lround.c>
@@ -20,4 +20,5 @@
#define ITYPE float
#define IREGS "s"
#define OTYPE long long int
+#define OREGS "x"
#include <s_lround.c>
@@ -33,9 +33,17 @@
#ifndef OTYPE
# define OTYPE long int
+# ifndef __ILP32__
+# define OREGS "x"
+# else
+# define OREGS "w"
+# endif
+#else
+# ifndef OREGS
+# error OREGS not defined
+# endif
#endif
-#define OREGS "x"
#define __CONCATX(a,b) __CONCAT(a,b)
@@ -33,10 +33,17 @@
#ifndef OTYPE
# define OTYPE long int
+# ifndef __ILP32__
+# define OREGS "x"
+# else
+# define OREGS "w"
+# endif
+#else
+# ifndef OREGS
+# error OREGS not defined
+# endif
#endif
-#define OREGS "x"
-
#define __CONCATX(a,b) __CONCAT(a,b)
OTYPE