From 020167a4ce53f7dd8d5b1912a42163bd1077e6c5 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 18 Sep 2015 16:39:08 +0100 Subject: Use the GCC builtin functions for the non-inlined signbit implementations. 2015-09-18 Wilco Dijkstra * sysdeps/ieee754/dbl-64/s_signbit.c (__signbit): Use __builtin_signbit. * sysdeps/ieee754/flt-32/s_signbitf.c (__signbitf): Use __builtin_signbitf. * sysdeps/ieee754/ldbl-128/s_signbitl.c (__signbitl): Use __builtin_signbitl. * sysdeps/ieee754/ldbl-128ibm/s_signbitl.c (___signbitl): Likewise. * sysdeps/ieee754/ldbl-96/s_signbitl.c (__signbitl): Likewise. --- sysdeps/ieee754/dbl-64/s_signbit.c | 7 +------ sysdeps/ieee754/flt-32/s_signbitf.c | 7 +------ sysdeps/ieee754/ldbl-128/s_signbitl.c | 7 +------ sysdeps/ieee754/ldbl-128ibm/s_signbitl.c | 8 +------- sysdeps/ieee754/ldbl-96/s_signbitl.c | 7 +------ 5 files changed, 5 insertions(+), 31 deletions(-) (limited to 'sysdeps/ieee754') diff --git a/sysdeps/ieee754/dbl-64/s_signbit.c b/sysdeps/ieee754/dbl-64/s_signbit.c index 764f11a2d2..91797eecdd 100644 --- a/sysdeps/ieee754/dbl-64/s_signbit.c +++ b/sysdeps/ieee754/dbl-64/s_signbit.c @@ -19,13 +19,8 @@ #include -#include - int __signbit (double x) { - int32_t hx; - - GET_HIGH_WORD (hx, x); - return hx & 0x80000000; + return __builtin_signbit (x); } diff --git a/sysdeps/ieee754/flt-32/s_signbitf.c b/sysdeps/ieee754/flt-32/s_signbitf.c index 169820e9df..034c17529c 100644 --- a/sysdeps/ieee754/flt-32/s_signbitf.c +++ b/sysdeps/ieee754/flt-32/s_signbitf.c @@ -19,13 +19,8 @@ #include -#include - int __signbitf (float x) { - int32_t hx; - - GET_FLOAT_WORD (hx, x); - return hx & 0x80000000; + return __builtin_signbitf (x); } diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c index acfe859a2e..ea689a6fe5 100644 --- a/sysdeps/ieee754/ldbl-128/s_signbitl.c +++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c @@ -19,13 +19,8 @@ #include -#include - int __signbitl (long double x) { - int64_t e; - - GET_LDOUBLE_MSW64 (e, x); - return e < 0; + return __builtin_signbitl (x); } diff --git a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c index e95ad55e32..5e2bd90704 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c @@ -18,18 +18,12 @@ . */ #include -#include #include int ___signbitl (long double x) { - int64_t e; - double xhi; - - xhi = ldbl_high (x); - EXTRACT_WORDS64 (e, xhi); - return e < 0; + return __builtin_signbitl (x); } #if IS_IN (libm) long_double_symbol (libm, ___signbitl, __signbitl); diff --git a/sysdeps/ieee754/ldbl-96/s_signbitl.c b/sysdeps/ieee754/ldbl-96/s_signbitl.c index bbe72a62ea..ea689a6fe5 100644 --- a/sysdeps/ieee754/ldbl-96/s_signbitl.c +++ b/sysdeps/ieee754/ldbl-96/s_signbitl.c @@ -19,13 +19,8 @@ #include -#include - int __signbitl (long double x) { - int32_t e; - - GET_LDOUBLE_EXP (e, x); - return e & 0x8000; + return __builtin_signbitl (x); } -- cgit 1.4.1