From patchwork Mon Oct 30 22:16:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 832193 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-86563-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="LeReslu8"; 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 3yQpk51Bqsz9sRg for ; Tue, 31 Oct 2017 09:17:00 +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=rcoVdn8hfgsM2neHFTG0WrJ/LOJus Cb1KqDVV6egSIhlDyjdQaZMD5SP+6ZXnKxFdT0g2OfWWOEDz+uPRH/lDn8qj+dTZ mdrJyMb/DiBKao7faEqoiMSPnFrqo6G9D5X/+5emlvaN2r9nmdsc6VsnTjfAyLi5 aQBJQXRuP/+bLw= 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=kkMjLn67FW7ps7I1WIYkXKN7q0w=; b=LeR eslu8HOoWit30acTlshyVR8fz26iM2ybiwNgSHyVjyb49DP5C3ZTQGF+8PGVNpSe g3xci4QTTN9nIni5KMhF7AyULtUnCUW4j3QI7AVDFPyuHTdy+MT3HPV/jExZX4Ry ZXH1MVI14Xu7sbBl2ChSKeRd7Op0LIIsXs/pCgCk= Received: (qmail 68564 invoked by alias); 30 Oct 2017 22:16:50 -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 68522 invoked by uid 89); 30 Oct 2017 22:16:50 -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: Mon, 30 Oct 2017 22:16:39 +0000 From: Joseph Myers To: Subject: Include bits/math-finite.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 extends the includes of to cover all such types, under conditions analogous to those for _Float128. Tested for x86_64. Committed. 2017-10-30 Joseph Myers * math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]: Include 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 88fd4bc..125d845 100644 --- a/math/math.h +++ b/math/math.h @@ -978,8 +978,74 @@ iszero (__T __val) # endif /* __USE_ISOC99. */ -/* Include bits/math-finite.h for float128. */ -# if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \ +/* Include bits/math-finite.h for _FloatN and _FloatNx. */ + +# if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float16 +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f16 ## reentrant +# if __HAVE_DISTINCT_FLOAT16 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f16 ## reentrant ## _finite +# else +# error "non-disinct _Float16" +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + +# if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float32 +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f32 ## reentrant +# if __HAVE_DISTINCT_FLOAT32 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f32 ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f ## reentrant ## _finite +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + +# if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float64 +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f64 ## reentrant +# if __HAVE_DISTINCT_FLOAT64 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f64 ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + +# if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # define _Mdouble_ _Float128 # define __MATH_DECLARING_DOUBLE 0 @@ -1000,6 +1066,75 @@ iszero (__T __val) # undef __REDIRFROM_X # undef __REDIRTO_X # endif + +# if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float32x +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f32x ## reentrant +# if __HAVE_DISTINCT_FLOAT32X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f32x ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + +# if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float64x +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f64x ## reentrant +# if __HAVE_DISTINCT_FLOAT64X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f64x ## reentrant ## _finite +# elif __HAVE_FLOAT64X_LONG_DOUBLE +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## l ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128 ## reentrant ## _finite +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + +# if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \ + && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define _Mdouble_ _Float128x +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 1 +# define __REDIRFROM_X(function, reentrant) \ + function ## f128x ## reentrant +# if __HAVE_DISTINCT_FLOAT128X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128x ## reentrant ## _finite +# else +# error "non-disinct _Float128x" +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# endif + #endif /* __FINITE_MATH_ONLY__ > 0. */ #if __GLIBC_USE (IEC_60559_BFP_EXT)