From patchwork Tue Nov 29 21:04:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 18051 Received: (qmail 113832 invoked by alias); 29 Nov 2016 21:05:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113810 invoked by uid 89); 29 Nov 2016 21:04:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: camailhost.cavium.com Date: Tue, 29 Nov 2016 13:04:47 -0800 From: Steve Ellcey Message-Id: <201611292104.uATL4lGK020856@sellcey-lt.caveonetworks.com> To: libc-alpha@sourceware.org Subject: [PATCH] Fix flt to 32 bit int conversion in ILP32 aarch64 Reply-To: sellcey@cavium.com 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 * 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. diff --git a/sysdeps/aarch64/fpu/s_llrint.c b/sysdeps/aarch64/fpu/s_llrint.c index 9769311..c8833b4 100644 --- a/sysdeps/aarch64/fpu/s_llrint.c +++ b/sysdeps/aarch64/fpu/s_llrint.c @@ -18,4 +18,5 @@ #define FUNC llrint #define OTYPE long long int +#define OREGS "x" #include diff --git a/sysdeps/aarch64/fpu/s_llrintf.c b/sysdeps/aarch64/fpu/s_llrintf.c index 51024a9..8ede339 100644 --- a/sysdeps/aarch64/fpu/s_llrintf.c +++ b/sysdeps/aarch64/fpu/s_llrintf.c @@ -20,4 +20,5 @@ #define ITYPE float #define IREGS "s" #define OTYPE long long int +#define OREGS "x" #include diff --git a/sysdeps/aarch64/fpu/s_llround.c b/sysdeps/aarch64/fpu/s_llround.c index dd2b3a2..7a229a5 100644 --- a/sysdeps/aarch64/fpu/s_llround.c +++ b/sysdeps/aarch64/fpu/s_llround.c @@ -18,4 +18,5 @@ #define FUNC llround #define OTYPE long long int +#define OREGS "x" #include diff --git a/sysdeps/aarch64/fpu/s_llroundf.c b/sysdeps/aarch64/fpu/s_llroundf.c index 8b5d263..9d1beac 100644 --- a/sysdeps/aarch64/fpu/s_llroundf.c +++ b/sysdeps/aarch64/fpu/s_llroundf.c @@ -20,4 +20,5 @@ #define ITYPE float #define IREGS "s" #define OTYPE long long int +#define OREGS "x" #include diff --git a/sysdeps/aarch64/fpu/s_lrint.c b/sysdeps/aarch64/fpu/s_lrint.c index e51de0f..5693784 100644 --- a/sysdeps/aarch64/fpu/s_lrint.c +++ b/sysdeps/aarch64/fpu/s_lrint.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) diff --git a/sysdeps/aarch64/fpu/s_lround.c b/sysdeps/aarch64/fpu/s_lround.c index a14d347..19b0705 100644 --- a/sysdeps/aarch64/fpu/s_lround.c +++ b/sysdeps/aarch64/fpu/s_lround.c @@ -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