From patchwork Mon Mar 13 18:11:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 738325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vhmCD31Gyz9s03 for ; Tue, 14 Mar 2017 05:11:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kYr+e4dU"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=Le5hp hpPhh5YFXCzMdHOvEPO5n7fMm3evAcrjFA/TUlnLRoIy5ljf1NGvntGprvB0UN9T tsnzcZd3IeG/8OBMJMfp4jPopNZsPNM9s88U+fFGwal/VLQxTFIk/cx/zyLbUBq+ 4X6Cx4H5vaWD7BPeqydX5lNlD2yQdSypVhQBOk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=hiKu84UuPmm 15p3cD2icY8P6c3Q=; b=kYr+e4dUJyroF4E0g9uZgT0wfTDb8UgDxBOEMtMBiSr TWmgv/LiFJiRCj0Ns7uObYBSY4ARrTGAWUrMnDLgByidAR8eNM81NWTk9PuJnNt3 2QHtmcaFOxqPsGNdepcITtga2JAgjNQhcRodLXnUIotNLE9vrE9NKlIgOIvSQStQ = Received: (qmail 105872 invoked by alias); 13 Mar 2017 18:11:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105860 invoked by uid 89); 13 Mar 2017 18:11:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*Ad:U*wschmidt X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Mar 2017 18:11:08 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2DI98nF141071 for ; Mon, 13 Mar 2017 14:11:08 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 294enc85ef-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Mar 2017 14:11:07 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Mar 2017 14:11:06 -0400 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Mar 2017 14:11:03 -0400 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2DIB2eR10551576; Mon, 13 Mar 2017 11:11:02 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1F8C6E038; Mon, 13 Mar 2017 12:11:02 -0600 (MDT) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.201]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 6BAEF6E03A; Mon, 13 Mar 2017 12:11:02 -0600 (MDT) To: GCC Patches Cc: Joseph Myers , Segher Boessenkool From: Bill Schmidt Subject: [PATCH v2, doc] Revise GCC manual section 6.11, Additional Floating Types Date: Mon, 13 Mar 2017 13:11:01 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17031318-0040-0000-0000-000002DD5603 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006776; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00833312; UDB=6.00409109; IPR=6.00610970; BA=6.00005207; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014632; XFM=3.00000013; UTC=2017-03-13 18:11:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031318-0041-0000-0000-000006D17D06 Message-Id: <241ab5bd-6fe5-96ad-2ee6-fa6ce0eb2ced@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-13_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703130142 X-IsSubscribed: yes Hi Joseph, Thanks for the review! Re-sending this patch to gcc-patches as I ran into MIME problems with my previous reply. I've made corrections as suggested, and chosen to just remove the paragraph describing machine modes. The typedef descriptions can stand on their own well enough. Revised patch below. Is this ok for trunk? Thanks, Bill 2017-03-13 Bill Schmidt * doc/extend.texi (6.11 Additional Floating Types): Revise. Index: gcc/doc/extend.texi =================================================================== --- gcc/doc/extend.texi (revision 246014) +++ gcc/doc/extend.texi (working copy) @@ -948,10 +948,28 @@ names can be used together with @code{_Complex} to types. As an extension, GNU C and GNU C++ support additional floating -types, @code{__float80} and @code{__float128} to support 80-bit -(@code{XFmode}) and 128-bit (@code{TFmode}) floating types; these are -aliases for the type names @code{_Float64x} and @code{_Float128}. -Support for additional types includes the arithmetic operators: +types, which are not supported by all targets. +@itemize @bullet +@item @code{__float128} is available on i386, x86_64, IA-64, and +hppa HP-UX, as well as on PowerPC 64-bit GNU/Linux targets that enable +the vector scalar (VSX) instruction set. @code{__float128} supports +the 128-bit floating type. On i386, x86_64, PowerPC, and IA-64 +other than HP-UX, @code{__float128} is an alias for @code{_Float128}. +On hppa and IA-64 HP-UX, @code{__float128} is an alias for @code{long +double}. + +@item @code{__float80} is available on the i386, x86_64, and IA-64 +targets, and supports the 80-bit (@code{XFmode}) floating type. It is +an alias for the type name @code{_Float64x} on these targets. + +@item @code{__ibm128} is available on PowerPC targets, and provides +access to the IBM extended double format which is the current format +used for @code{long double}. When @code{long double} transitions to +@code{__float128} on PowerPC in the future, @code{__ibm128} will remain +for use in conversions between the two types. +@end itemize + +Support for these additional types includes the arithmetic operators: add, subtract, multiply, divide; unary arithmetic operators; relational operators; equality operators; and conversions to and from integer and other floating types. Use a suffix @samp{w} or @samp{W} @@ -958,6 +976,22 @@ integer and other floating types. Use a suffix @s in a literal constant of type @code{__float80} or type @code{__ibm128}. Use a suffix @samp{q} or @samp{Q} for @code{_float128}. +In order to use @code{_Float128}, @code{__float128}, and @code{__ibm128} +on PowerPC Linux systems, you must use the @option{-mfloat128} option. It is +expected in future versions of GCC that @code{_Float128} and @code{__float128} +will be enabled automatically. + +The @code{_Float128} type is supported on all systems where +@code{__float128} is supported or where @code{long double} has the +IEEE binary128 format. The @code{_Float64x} type is supported on all +systems where @code{__float128} is supported. The @code{_Float32} +type is supported on all systems supporting IEEE binary32; the +@code{_Float64} and @code{_Float32x} types are supported on all systems +supporting IEEE binary64. The @code{_Float16} type is supported on AArch64 +systems by default, and on ARM systems when the IEEE format for 16-bit +floating-point types is selected with @option{-mfp16-format=ieee}. +GCC does not currently support @code{_Float128x} on any systems. + On the i386, x86_64, IA-64, and HP-UX targets, you can declare complex types using the corresponding internal complex type, @code{XCmode} for @code{__float80} type and @code{TCmode} for @code{__float128} type: @@ -967,16 +1001,6 @@ typedef _Complex float __attribute__((mode(TC))) _ typedef _Complex float __attribute__((mode(XC))) _Complex80; @end smallexample -In order to use @code{_Float128}, @code{__float128} and -@code{__ibm128} on PowerPC Linux -systems, you must use the @option{-mfloat128}. It is expected in -future versions of GCC that @code{_Float128} and @code{__float128} -will be enabled -automatically. In addition, there are currently problems in using the -complex @code{__float128} type. When these problems are fixed, you -would use the following syntax to declare @code{_Complex128} to be a -complex @code{__float128} type: - On the PowerPC Linux VSX targets, you can declare complex types using the corresponding internal complex type, @code{KCmode} for @code{__float128} type and @code{ICmode} for @code{__ibm128} type: @@ -986,27 +1010,6 @@ typedef _Complex float __attribute__((mode(KC))) _ typedef _Complex float __attribute__((mode(IC))) _Complex_ibm128; @end smallexample -Not all targets support additional floating-point types. -@code{__float80} and @code{__float128} types are supported on x86 and -IA-64 targets. The @code{__float128} type is supported on hppa HP-UX. -The @code{__float128} type is supported on PowerPC 64-bit Linux -systems by default if the vector scalar instruction set (VSX) is -enabled. The @code{_Float128} type is supported on all systems where -@code{__float128} is supported or where @code{long double} has the -IEEE binary128 format. The @code{_Float64x} type is supported on all -systems where @code{__float128} is supported. The @code{_Float32} -type is supported on all systems supporting IEEE binary32; the -@code{_Float64} and @code{Float32x} types are supported on all systems -supporting IEEE binary64. The @code{_Float16} type is supported on AArch64 -systems by default, and on ARM systems when the IEEE format for 16-bit -floating-point types is selected with @option{-mfp16-format=ieee}. -GCC does not currently support @code{_Float128x} on any systems. - -On the PowerPC, @code{__ibm128} provides access to the IBM extended -double format, and it is intended to be used by the library functions -that handle conversions if/when long double is changed to be IEEE -128-bit floating point. - @node Half-Precision @section Half-Precision Floating Point @cindex half-precision floating point