{"id":834143,"url":"http://patchwork.ozlabs.org/api/1.2/patches/834143/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1711032350300.24252@digraph.polyomino.org.uk/","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.2/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<alpine.DEB.2.20.1711032350300.24252@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-11-03T23:50:49","name":"Handle more _FloatN, _FloatNx types in __MATH_TG [committed]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6317ccb2f04f3fe609bbd5a535551d8aedaf10bb","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/1.2/people/4349/?format=json","name":"Joseph Myers","email":"joseph@codesourcery.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1711032350300.24252@digraph.polyomino.org.uk/mbox/","series":[{"id":11859,"url":"http://patchwork.ozlabs.org/api/1.2/series/11859/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/list/?series=11859","date":"2017-11-03T23:50:49","name":"Handle more _FloatN, _FloatNx types in __MATH_TG [committed]","version":1,"mbox":"http://patchwork.ozlabs.org/series/11859/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/834143/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/834143/checks/","tags":{},"related":[],"headers":{"Return-Path":"<libc-alpha-return-86758-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-86758-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"F7dLCeSp\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yTJcp4WG7z9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  4 Nov 2017 10:51:06 +1100 (AEDT)","(qmail 88791 invoked by alias); 3 Nov 2017 23:50:59 -0000","(qmail 88782 invoked by uid 89); 3 Nov 2017 23:50:59 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; q=dns; s=default; b=gclb0wLrIYSsfoI0WmyxMP7duztx9\n\tPrrDZH1dR24V8skb6gjFuM9Wpfo6gxQdSY1xMBdn/SOj1pILztXBMxihwTjv/03Q\n\tFgrx31h6R3RJWJBOAzkmdp+USNSC7igv9ISxLqjEUqgRuhVZM++6x2vip/B8BsXs\n\tQ8irv9f+CiEKdA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; s=default; bh=ctQlWqCNgyuwfkglvDR/qGi3TXk=; b=F7d\n\tLCeSpkAU2lIX4TM0noS1i7FDlYCiptugvGqs3OfSreWEIV3DHSP80dzjuEm1GFVy\n\tqkgLhcOvIP2GAVVTUkNkHEXwjzNjteVZjLUJQ3xadKXIKnbvY40vdDSXcYq4mW2t\n\t6a9H1so2mjJTSlWdFl4thZl3YEsE1CPdiZ7biVos=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=","X-HELO":"relay1.mentorg.com","Date":"Fri, 3 Nov 2017 23:50:49 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"<libc-alpha@sourceware.org>","Subject":"Handle more _FloatN, _FloatNx types in __MATH_TG [committed]","Message-ID":"<alpine.DEB.2.20.1711032350300.24252@digraph.polyomino.org.uk>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tSVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3)"},"content":"Continuing the preparation for additional _FloatN / _FloatNx type\nsupport, this patch prepares __MATH_TG to handle more such types.\n\nVarious unhandled cases, which do not correspond to any current glibc\nconfiguration, have explicit #errors added.  _Float32 and _Float64x\nare then handled appropriately in the _Generic case, which is the only\none, other than the cases where use of sizeof is sufficient, where\nthey should ever be explicit types at the language level instead of\ntypedefs.  There is no need to handle _Float64 or _Float32x explicitly\nthere because the default case calling a double function is correct\nfor those types.\n\nTested for x86_64.  Committed.\n\n2017-11-03  Joseph Myers  <joseph@codesourcery.com>\n\n\t* math/math.h [__HAVE_DISTINCT_FLOAT16\n\t|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64\n\t|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X\n\t|| __HAVE_DISTINCT_FLOAT128X]: Use #error.\n\t[__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise.\n\t[__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION\n\t&& __HAVE_FLOATN_NOT_TYPEDEF]: Likewise.\n\t[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]\n\t(__MATH_TG_F32): New macro.\n\t[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]\n\t(__MATH_TG_F64X): Likewise.\n\t[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]\n\t(__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.","diff":"diff --git a/math/math.h b/math/math.h\nindex 326fd8e..f6d1fee 100644\n--- a/math/math.h\n+++ b/math/math.h\n@@ -489,6 +489,14 @@ extern long double __REDIRECT_NTH (nexttowardl,\n extern int signgam;\n #endif\n \n+#if (__HAVE_DISTINCT_FLOAT16\t\t\t\\\n+     || __HAVE_DISTINCT_FLOAT32\t\t\t\\\n+     || __HAVE_DISTINCT_FLOAT64\t\t\t\\\n+     || __HAVE_DISTINCT_FLOAT32X\t\t\\\n+     || __HAVE_DISTINCT_FLOAT64X\t\t\\\n+     || __HAVE_DISTINCT_FLOAT128X)\n+# error \"Unsupported _FloatN or _FloatNx types for <math.h>.\"\n+#endif\n \n /* Depending on the type of TG_ARG, call an appropriately suffixed\n    version of FUNC with arguments (including parentheses) ARGS.\n@@ -500,17 +508,39 @@ extern int signgam;\n    return the same type (FUNC may include a cast if necessary rather\n    than being a single identifier).  */\n #ifdef __NO_LONG_DOUBLE_MATH\n+# if __HAVE_DISTINCT_FLOAT128\n+#  error \"Distinct _Float128 without distinct long double not supported.\"\n+# endif\n # define __MATH_TG(TG_ARG, FUNC, ARGS)\t\t\t\t\t\\\n   (sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS)\n #elif __HAVE_DISTINCT_FLOAT128\n # if __HAVE_GENERIC_SELECTION\n-#  define __MATH_TG(TG_ARG, FUNC, ARGS)\t\t\\\n+#  if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT32\n+#   define __MATH_TG_F32(FUNC, ARGS) _Float32: FUNC ## f ARGS,\n+#  else\n+#   define __MATH_TG_F32(FUNC, ARGS)\n+#  endif\n+#  if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT64X\n+#   if __HAVE_FLOAT64X_LONG_DOUBLE\n+#    define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## l ARGS,\n+#   else\n+#    define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## f128 ARGS,\n+#   endif\n+#  else\n+#   define __MATH_TG_F64X(FUNC, ARGS)\n+#  endif\n+#  define __MATH_TG(TG_ARG, FUNC, ARGS)\t\\\n      _Generic ((TG_ARG),\t\t\t\\\n \t       float: FUNC ## f ARGS,\t\t\\\n+\t       __MATH_TG_F32 (FUNC, ARGS)\t\\\n \t       default: FUNC ARGS,\t\t\\\n \t       long double: FUNC ## l ARGS,\t\\\n+\t       __MATH_TG_F64X (FUNC, ARGS)\t\\\n \t       _Float128: FUNC ## f128 ARGS)\n # else\n+#  if __HAVE_FLOATN_NOT_TYPEDEF\n+#   error \"Non-typedef _FloatN but no _Generic.\"\n+#  endif\n #  define __MATH_TG(TG_ARG, FUNC, ARGS)\t\t\t\t\t\\\n      __builtin_choose_expr\t\t\t\t\t\t\\\n      (__builtin_types_compatible_p (__typeof (TG_ARG), float),\t\t\\\n","prefixes":[]}