From patchwork Fri Oct 27 22:44:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 831532 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-86502-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="E/UXlJPA"; 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 3yNzTV4FHGz9t3Z for ; Sat, 28 Oct 2017 09:44:46 +1100 (AEDT) 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:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=OD7OoohxYgejJsMxHmx0c49OuAxCO OyOpotWgZET96p4S9t+EbS1HdqRktTcl/R4WHURsS0d66WVGpJQLOehWnQUdNtvO G3YWQrv2E3IOtgmmY5OlocUWwxDK1gdkJ3bMDEyLFflSJKMMVAXfNgHqxdM3VOFl y8SdfPxlEfsbj4= 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:from:to:subject:message-id:mime-version :content-type; s=default; bh=faNsZZMnNzXpUbRqPOzOLACHsWg=; b=E/U XlJPAnCtixnABBcLLq9MP0l2hlXQPv/C06gT2ApusMujYPgzYRP7mznwdLN9LRXV UYnCuSm6Z1E458uJKfQYvpexbU0F/JExlOcMbExDBXR6VFh7TNk/3OcmxRdREYmd wmk1aRtK69ntt55NGEPvANSqJ+bGIQujhC9iV//4= Received: (qmail 30602 invoked by alias); 27 Oct 2017 22:44:39 -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 29853 invoked by uid 89); 27 Oct 2017 22:44:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Fri, 27 Oct 2017 22:44:28 +0000 From: Joseph Myers To: Subject: Include bits/mathcalls.h for more _FloatN, _FloatNx types [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Continuing the preparation for additional _FloatN / _FloatNx type support, this patch arranges for and to be included for each such type under conditions and with macros defined corresponding to those already present for _Float128. Tested for x86_64. Committed. 2017-10-27 Joseph Myers * math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]: Include and with appropriate macros defined and undefined. [__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise. [__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise. [__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise. [__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise. [__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise. diff --git a/math/math.h b/math/math.h index 22ff23b..3263042 100644 --- a/math/math.h +++ b/math/math.h @@ -363,8 +363,68 @@ extern long double __REDIRECT_NTH (nexttowardl, #endif /* Use ISO C99. */ -/* Include the file of declarations again, this time using `_Float128' - instead of `double' and appending f128 to each function name. */ +/* Include the file of declarations for _FloatN and _FloatNx + types. */ + +#if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC) +# ifndef _Mfloat16_ +# define _Mfloat16_ _Float16 +# endif +# define _Mdouble_ _Mfloat16_ +# define __MATH_PRECNAME(name,r) name##f16##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT16 +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */ + +#if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC) +# ifndef _Mfloat32_ +# define _Mfloat32_ _Float32 +# endif +# define _Mdouble_ _Mfloat32_ +# define __MATH_PRECNAME(name,r) name##f32##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT32 +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */ + +#if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC) +# ifndef _Mfloat64_ +# define _Mfloat64_ _Float64 +# endif +# define _Mdouble_ _Mfloat64_ +# define __MATH_PRECNAME(name,r) name##f64##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT64 +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC) # ifndef _Mfloat128_ @@ -384,7 +444,67 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN -#endif /* __HAVE_DISTINCT_FLOAT128. */ +#endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */ + +#if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC) +# ifndef _Mfloat32x_ +# define _Mfloat32x_ _Float32x +# endif +# define _Mdouble_ _Mfloat32x_ +# define __MATH_PRECNAME(name,r) name##f32x##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT32X +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */ + +#if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC) +# ifndef _Mfloat64x_ +# define _Mfloat64x_ _Float64x +# endif +# define _Mdouble_ _Mfloat64x_ +# define __MATH_PRECNAME(name,r) name##f64x##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT64X +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */ + +#if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC) +# ifndef _Mfloat128x_ +# define _Mfloat128x_ _Float128x +# endif +# define _Mdouble_ _Mfloat128x_ +# define __MATH_PRECNAME(name,r) name##f128x##r +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# if __HAVE_DISTINCT_FLOAT128X +# include +# endif +# if __GLIBC_USE (IEC_60559_TYPES_EXT) +# include +# endif +# undef _Mdouble_ +# undef __MATH_PRECNAME +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +#endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ #undef __MATHDECL_1 #undef __MATHDECL