From patchwork Sun May 13 20:30:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 912586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92485-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Fe1xN+k2"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40kb7c2Mk9z9s0w for ; Mon, 14 May 2018 06:30:50 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= HiwHKYvSvVqqekPGG9/Hx4Zp5oFMP385yR6J3YjLZy/4+1mjDqeNuJRLt9+/mq02 99IBYusE3zcZhwjH6JQXfaIwPgoudbQvAUbWgh6g22mbaT3DDVa71APsdvcAm+Ba Vp26KcRgw1a7kjc9/Uxw048I3VFxPobY0mwqE2+5wiE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=8v7PrI zGHE7k40Dhw6AJVMZpxaI=; b=Fe1xN+k2rVTp1TSTVgkn2WLWHcOryFKTWFGExG lSkCPh+1zdoBbIhb0qB4749sBLZE80xosourA2ZErm8KiTMqUwJdyJTfy5nCNPFz kjQS63j94DjXgI6iQwtdxsd1eXQkf0Yrf5YQBzKuZVCPOgGOV7iq+vZKNfU3WpyT cmQIk= Received: (qmail 9657 invoked by alias); 13 May 2018 20:30:38 -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 9519 invoked by uid 89); 13 May 2018 20:30:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=binaries, along, HX-Greylist:Sun, ab X-HELO: mx1.redhat.com Date: Sun, 13 May 2018 22:30:19 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] math: Merge strtod_nam_*.h into math-type-macros-*.h User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20180513203019.C0C2A4016D681@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) This change will eventually make it possible to compile stdlib/strtod_nan_main.c as part of math/s_nan_template.c. Tested on ppc64, ppc64le, x86_64, with no differences in stripped binaries. 2018-05-13 Florian Weimer * stdlib/strtod_nan.c: Include instead of . * stdlib/strtof_nan.c: Include instead of include . * stdlib/strtold_nan.c: Include instead of . * stdlib/strtod_nan_double.h: Move to ... * sysdeps/generic/math-mantissa-double.h: ... here. (FLOAT): Remove definition. * stdlib/strtod_nan_float.h: Move to ... * sysdeps/generic/math-mantissa-float.h: ... here. (FLOAT): Remove definition. * sysdeps/generic/math-type-macros-double.h: Include . Include instead of . * sysdeps/generic/math-type-macros-float.h: Include . Include instead of . * sysdeps/generic/math-type-macros-float128.h: Include . * sysdeps/generic/math-type-macros-ldouble.h: Include . Include instead of . * sysdeps/generic/math-type-macros.h: Document SET_MANTISSA and check for definition. * sysdeps/ieee754/float128/strtod_nan_float128.h: Move to ... * sysdeps/ieee754/float128/math-mantissa-float128.h: ... here. Include . (FLOAT): Remove definition. * sysdeps/ieee754/float128/strtof128_nan.c: Include instead of . Do not include . * sysdeps/ieee754/float128/wcstof128_nan.c: Likewise. * sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h: Move to ... * sysdeps/ieee754/ldbl-128/math-mantissa-ldouble.h: ... here. (FLOAT): Remove definition. * sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h: Move to ... * sysdeps/ieee754/ldbl-128ibm/math-mantissa-ldouble.h: ... here. (FLOAT): Remove definition. * sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h: Move to ... * sysdeps/ieee754/ldbl-96/math-mantissa-ldouble.h: ... here. (FLOAT): Remove definition. * wcsmbs/wcstod_nan.c: Include instead of "../stdlib/strtod_nan_double.h". * wcsmbs/wcstof_nan.c: Include instead of "../stdlib/strtod_nan_float.h". * wcsmbs/wcstold_nan.c: Include instead of "../stdlib/strtod_nan_ldouble.h". diff --git a/stdlib/strtod_nan.c b/stdlib/strtod_nan.c index f64fec1897..c5876b59a0 100644 --- a/stdlib/strtod_nan.c +++ b/stdlib/strtod_nan.c @@ -18,7 +18,7 @@ . */ #include -#include +#include #define STRTOD_NAN __strtod_nan #include diff --git a/stdlib/strtof_nan.c b/stdlib/strtof_nan.c index ea3decb729..f085c5b4fb 100644 --- a/stdlib/strtof_nan.c +++ b/stdlib/strtof_nan.c @@ -18,7 +18,7 @@ . */ #include -#include +#include #define STRTOD_NAN __strtof_nan #include diff --git a/stdlib/strtold_nan.c b/stdlib/strtold_nan.c index d4bbcc0a8b..eadfe546e2 100644 --- a/stdlib/strtold_nan.c +++ b/stdlib/strtold_nan.c @@ -23,7 +23,7 @@ representation. */ #ifndef __NO_LONG_DOUBLE_MATH # include -# include +# include # define STRTOD_NAN __strtold_nan # include diff --git a/stdlib/strtod_nan_double.h b/sysdeps/generic/math-mantissa-double.h similarity index 92% rename from stdlib/strtod_nan_double.h rename to sysdeps/generic/math-mantissa-double.h +++ b/sysdeps/generic/math-mantissa-double.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For double. +/* Mantissa handling for double. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT double #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/stdlib/strtod_nan_float.h b/sysdeps/generic/math-mantissa-float.h similarity index 92% rename from stdlib/strtod_nan_float.h rename to sysdeps/generic/math-mantissa-float.h +++ b/sysdeps/generic/math-mantissa-float.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For float. +/* Mantissa handling for float. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT float #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h index 1af4c74e4b..f2c569c63b 100644 --- a/sysdeps/generic/math-type-macros-double.h +++ b/sysdeps/generic/math-type-macros-double.h @@ -27,6 +27,7 @@ #define CFLOAT _Complex double #define M_STRTO_NAN __strtod_nan +#include #include #ifndef declare_mgen_alias @@ -42,7 +43,7 @@ /* Do not use the type-generic wrapper templates if compatibility with SVID error handling is needed. */ -#include +#include #define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT #endif diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h index 9273bdee0e..fc2bc736f7 100644 --- a/sysdeps/generic/math-type-macros-float.h +++ b/sysdeps/generic/math-type-macros-float.h @@ -30,6 +30,7 @@ the double macro constants. */ #define M_MLIT(c) c +#include #include #ifndef declare_mgen_alias @@ -45,7 +46,7 @@ /* Do not use the type-generic wrapper templates if compatibility with SVID error handling is needed. */ -#include +#include #define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT #endif diff --git a/sysdeps/generic/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h index 485c13bb88..f2ce3c5a92 100644 --- a/sysdeps/generic/math-type-macros-float128.h +++ b/sysdeps/generic/math-type-macros-float128.h @@ -29,6 +29,7 @@ #define M_MLIT(c) c ## f128 +#include #include #ifndef declare_mgen_alias diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h index 5fe1600231..a4f577099c 100644 --- a/sysdeps/generic/math-type-macros-ldouble.h +++ b/sysdeps/generic/math-type-macros-ldouble.h @@ -27,6 +27,7 @@ #define CFLOAT _Complex long double #define M_STRTO_NAN __strtold_nan +#include #include #ifndef declare_mgen_alias @@ -42,7 +43,7 @@ /* Do not use the type-generic wrapper templates if compatibility with SVID error handling is needed. */ -#include +#include #define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT #endif diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h index ffcf7b80b6..330ea64d25 100644 --- a/sysdeps/generic/math-type-macros.h +++ b/sysdeps/generic/math-type-macros.h @@ -40,7 +40,10 @@ declare_mgen_alias_r(from,to) This exposes the appropriate symbol(s) for a - function f_r of type FLOAT. */ + function f_r of type FLOAT. + + SET_MANTISSA(flt, mant) + Set the variable FLT of type FLOAT to the mantissa MANT. */ #ifndef M_PFX # error "M_PFX must be defined." @@ -66,6 +69,9 @@ #ifndef declare_mgen_alias_r # error "declare_mgen_alias_r must be defined." #endif +#ifndef SET_MANTISSA +# error "SET_MANTISSA must be defined." +#endif #define __M_CONCAT(a,b) a ## b #define __M_CONCATX(a,b) __M_CONCAT(a,b) diff --git a/sysdeps/ieee754/float128/strtod_nan_float128.h b/sysdeps/ieee754/float128/math-mantissa-float128.h similarity index 92% rename from sysdeps/ieee754/float128/strtod_nan_float128.h rename to sysdeps/ieee754/float128/math-mantissa-float128.h +++ b/sysdeps/ieee754/float128/math-mantissa-float128.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For _Float128. +/* Mantissa handling for _Float128. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,8 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT _Float128 +#include + #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/sysdeps/ieee754/float128/strtof128_nan.c b/sysdeps/ieee754/float128/strtof128_nan.c index 36a9bfffed..37a7f4e02e 100644 --- a/sysdeps/ieee754/float128/strtof128_nan.c +++ b/sysdeps/ieee754/float128/strtof128_nan.c @@ -19,10 +19,8 @@ #include -#include - #include -#include +#include #define STRTOD_NAN __strtof128_nan #include diff --git a/sysdeps/ieee754/float128/wcstof128_nan.c b/sysdeps/ieee754/float128/wcstof128_nan.c index ffc72a016a..f504809dcf 100644 --- a/sysdeps/ieee754/float128/wcstof128_nan.c +++ b/sysdeps/ieee754/float128/wcstof128_nan.c @@ -18,7 +18,6 @@ . */ #include -#include -#include +#include #define STRTOD_NAN __wcstof128_nan #include diff --git a/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128/math-mantissa-ldouble.h similarity index 92% rename from sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h rename to sysdeps/ieee754/ldbl-128/math-mantissa-ldouble.h +++ b/sysdeps/ieee754/ldbl-128/math-mantissa-ldouble.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For ldbl-128. +/* Mantissa handling for ldbl-128. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT long double #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128ibm/math-mantissa-ldouble.h similarity index 91% rename from sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h rename to sysdeps/ieee754/ldbl-128ibm/math-mantissa-ldouble.h +++ b/sysdeps/ieee754/ldbl-128ibm/math-mantissa-ldouble.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For ldbl-128ibm. +/* Mantissa handling or ldbl-128ibm. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT long double #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-96/math-mantissa-ldouble.h similarity index 91% rename from sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h rename to sysdeps/ieee754/ldbl-96/math-mantissa-ldouble.h +++ b/sysdeps/ieee754/ldbl-96/math-mantissa-ldouble.h @@ -1,4 +1,4 @@ -/* Convert string for NaN payload to corresponding NaN. For ldbl-96. +/* Mantissa handling for ldbl-96. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define FLOAT long double #define SET_MANTISSA(flt, mant) \ do \ { \ diff --git a/wcsmbs/wcstod_nan.c b/wcsmbs/wcstod_nan.c index 1aee82d844..1423f3e8aa 100644 --- a/wcsmbs/wcstod_nan.c +++ b/wcsmbs/wcstod_nan.c @@ -17,7 +17,7 @@ . */ #include "../stdlib/strtod_nan_wide.h" -#include "../stdlib/strtod_nan_double.h" +#include #define STRTOD_NAN __wcstod_nan #include "../stdlib/strtod_nan_main.c" diff --git a/wcsmbs/wcstof_nan.c b/wcsmbs/wcstof_nan.c index 9c89e24370..96f2198667 100644 --- a/wcsmbs/wcstof_nan.c +++ b/wcsmbs/wcstof_nan.c @@ -17,7 +17,7 @@ . */ #include "../stdlib/strtod_nan_wide.h" -#include "../stdlib/strtod_nan_float.h" +#include #define STRTOD_NAN __wcstof_nan #include "../stdlib/strtod_nan_main.c" diff --git a/wcsmbs/wcstold_nan.c b/wcsmbs/wcstold_nan.c index a4d274f37f..66793ec459 100644 --- a/wcsmbs/wcstold_nan.c +++ b/wcsmbs/wcstold_nan.c @@ -23,7 +23,7 @@ representation. */ #ifndef __NO_LONG_DOUBLE_MATH # include "../stdlib/strtod_nan_wide.h" -# include +# include # define STRTOD_NAN __wcstold_nan # include "../stdlib/strtod_nan_main.c"