From patchwork Thu Oct 26 23:12:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 830977 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-86432-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="KLF+u/yf"; 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 3yNN8b5zqMz9t0F for ; Fri, 27 Oct 2017 10:13:03 +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=UQo+FVA0wtVvo9qsOrJIt1+QVqw3i eEktRuPHpZh6Yk+tWf099zhvFV2FMSJzhSgr9rTdKJIpbs16DtQlMjo6dNv69IC4 5uMBjy+Tbs4EGt9Iklhd+2dxgXu5atWEy0zP7ygQpsQ/GfY6nn47BuGtjDyTSv1b b4phS7Eqi9Rxqs= 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=0ybI8jP7gE+F7d87KJ1Ne8JCVxE=; b=KLF +u/yfnMoZwU0oz8CxaMob4uCKYYwiyWQ90zJJ8v4pA+mSfY1ickMVtfD3Y2nI3eC pxkALW5d1Q9OFAZ+w+dNwoC/08aZKxK/nEXMgz8KhrW5orD57cAv8fcMee8qP6gG J+cBtqZol46ZHHgyrgI5OLWEfvjn/3VSxiwPzjEU= Received: (qmail 127468 invoked by alias); 26 Oct 2017 23:12:58 -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 127452 invoked by uid 89); 26 Oct 2017 23:12:57 -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=Hx-languages-length:1965 X-HELO: relay1.mentorg.com Date: Thu, 26 Oct 2017 23:12:47 +0000 From: Joseph Myers To: Subject: Add HUGE_VAL macros 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) This patch continues the preparation for additional _FloatN / _FloatNx type support by adding appropriately conditional definitions of HUGE_VAL_* macros, corresponding to the HUGE_VAL_F128 definition already present. Tested for x86_64. Committed. 2017-10-26 Joseph Myers * math/math.h [__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F16): New macro. [__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F32): Likewise. [__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F64): Likewise. [__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F32X): Likewise. [__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F64X): Likewise. [__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (HUGE_VAL_F128X): Likewise. diff --git a/math/math.h b/math/math.h index 5ad8156..4affd2a 100644 --- a/math/math.h +++ b/math/math.h @@ -63,9 +63,27 @@ __BEGIN_DECLS # define HUGE_VALL 1e10000L # endif #endif +#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F16 (__builtin_huge_valf16 ()) +#endif +#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F32 (__builtin_huge_valf32 ()) +#endif +#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F64 (__builtin_huge_valf64 ()) +#endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F128 (__builtin_huge_valf128 ()) #endif +#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F32X (__builtin_huge_valf32x ()) +#endif +#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F64X (__builtin_huge_valf64x ()) +#endif +#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) +# define HUGE_VAL_F128X (__builtin_huge_valf128x ()) +#endif #ifdef __USE_ISOC99 /* IEEE positive infinity. */