From patchwork Fri Nov 11 15:37:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 81855 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1328669qge; Fri, 11 Nov 2016 07:38:33 -0800 (PST) X-Received: by 10.107.32.204 with SMTP id g195mr10128789iog.214.1478878713039; Fri, 11 Nov 2016 07:38:33 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id yw3si8994034pac.164.2016.11.11.07.38.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 07:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441120-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441120-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441120-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=nsNnm0yYmN5oOzHG BW6GEUEsb7JYshN/6hdOn/vGkQG6BzJw3zmKu65BBYXbjO1n77ktb9Eb4fxWE9gZ JlKSDkdmhUTRRbfLXR1qlYObdWjROkgkEG/2aAXpIUSt0TFUyQUriJThbov/yFqm ilRTQKgwA6KaE2Zst4VQ0XNW4Jw= 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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=83M7/Y29bTTG1OnwLFXyp9 PlMIg=; b=fSaiS6vtL6LFH67zwuQjMgm0PPtKup5+SfpwoqqjfJNAjYrCsgWer5 51og5ypEiWySyJM/t27cJcCMh6273B0DSg5QrWjk9dk52+kh8iNuogqcZ9j/n0wx B6ejUDtYKInlbDjI9b3cVRQm4Dg18ONSQ7b0uAW+lE8OtNWLX6PP4= Received: (qmail 74343 invoked by alias); 11 Nov 2016 15:38:15 -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 74244 invoked by uid 89); 11 Nov 2016 15:38:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=consequence, HX-Exchange-Antispam-Report-CFA-Test:102415395, historical, operate X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0089.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.89) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 15:38:07 +0000 Received: from VI1PR0801CA0044.eurprd08.prod.outlook.com (10.168.60.140) by AM5PR0801MB1779.eurprd08.prod.outlook.com (10.169.247.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Fri, 11 Nov 2016 15:38:04 +0000 Received: from AM1FFO11FD001.protection.gbl (2a01:111:f400:7e00::100) by VI1PR0801CA0044.outlook.office365.com (2603:10a6:800:4d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Fri, 11 Nov 2016 15:38:03 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; codesourcery.com; dkim=none (message not signed) header.d=none; codesourcery.com; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by AM1FFO11FD001.mail.protection.outlook.com (10.174.64.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.707.3 via Frontend Transport; Fri, 11 Nov 2016 15:38:03 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:879; Count:13 Received: from e107456-lin.cambridge.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Fri, 11 Nov 2016 15:37:48 +0000 From: James Greenhalgh To: CC: , , Subject: [Patch 3/17] Implement TARGET_C_EXCESS_PRECISION for s390 Date: Fri, 11 Nov 2016 15:37:20 +0000 Message-ID: <1478878647-22547-4-git-send-email-james.greenhalgh@arm.com> In-Reply-To: <1478878647-22547-1-git-send-email-james.greenhalgh@arm.com> References: <1475254617-10825-1-git-send-email-james.greenhalgh@arm.com> <1478878647-22547-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(377424004)(189002)(199003)(586003)(36756003)(512874002)(2906002)(77096005)(106466001)(8676002)(626004)(26826002)(4610100001)(86362001)(84326002)(87936001)(5890100001)(5000100001)(2351001)(246002)(50986999)(5660300001)(110136003)(8936002)(76176999)(7846002)(2950100002)(6666003)(6916009)(50226002)(104016004)(4326007)(305945005)(92566002)(2476003)(189998001)(568964002)(33646002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1779; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD001; 1:VERNQZ/rZeLB5PkNteW3hZsPIC/2cy9LTZdCDjUOaBnnGh89/bpw/5bC1h37r1AePK24WLBy6Z95RL4/1SeBA7R4uJkc0E4OZATyhQ0o817uQG5hM+Zhg/WaYa22k3+uQLwQqhFal7EwWPwhMTmUWcoM4n08JU/Xb9sIPMKdYgTWSVjsOKF45aTRMZ8j5YQv8EEkDQrkue5RqI2eDGKAyrXtcKtDoiJ00v9FL5o5M2w7FWtMTUejLb1Lgc8EA02bljqdIiTZcjF2V4cPBTqjF9ultZ0nMrbl4iTJVjmbdPJM4uCLRo2A2jSrvbtOcPf/VLHUslwXGuQU3kY5kulk37CUd9kAGVBEsYC2gd4NGtPhePJlHvZCjnBFFjDj8nWGO/1FHLYaPgsCERh7H8AzHfe0diVKq8f9VGrbE9gfkyiiMgHwNIs3dAFtVhAcjNVLEQiOuvOLcmcmJ8m6qLwfFKk5D4zgh5LBQ4QuPxnhDf03TMx4zEGvwI6zOYlWrjypcel2LAqeKCFa6xrIO8qI+s7oTUYXEyvmfnvFPbxbevEOI6upwAI8yeWtjbrsQG9c410hSQMGqS42lk2pUX9A2e9KJ58Q4jLArtpsjlAu+Sk= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1779; 2:60gDe4L3z/FQNzxyh7gFkianoLylrbm495f8Pvi9wqmJDT4VM463/sGlNsXeYJr6VyWfj/IryryTdEgMOMwErj2pTtpsWltdqUgCHCnnBCWV7YCp9tV2WOJ2bPJJvKbsBywIb+4vnww6SYYWZvZFWC0O+MilnE+Yy+IpacSu02Q=; 3:qEx8S4NZtljPRzy7Y7tOfNN/nTryJSy4qthVDpQauTCP7MMzTQHZWnlGfw8EOLp6S/A77TfbGl2unzzrNiPZtysrlNg7VPvSccQE3VlABedj0dx503viMuaLHmWBnw9jp7SjFk6uei4aDRtNLCKexezITwwfkvCqY9A6HA0a0NW5LW5PPi9D6GDxteuJ6Vm5NbomrFdq9hvuqV9mSLtBhbKcCtQW/LSYZzGchMs36hiLWVCWdkuMczESc+3ZbDRrEVoL01nIDzg0EjwwK6EctTsvi6goXkKs5wYnjvcXpBI= X-MS-Office365-Filtering-Correlation-Id: 764bafeb-d560-4755-89c1-08d40a48b9e3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:AM5PR0801MB1779; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1779; 25:sgKIw16znoc5F/tDYbpqEUVCriC8gAzNAWUKt1o?= =?us-ascii?Q?fLs8rHH0XrA5zqbULSapXs8YfCstWkgChxo4cvCjd/3bO+n2sftkn/+2Hx/w?= =?us-ascii?Q?wr6eKyJVKwPAHXDEbqM/Ia41KP8tooS4gI5RtWb6al9cmcX7wLaX18Al9A42?= =?us-ascii?Q?X9BQAGcG8SjDXQADllMuPvqDYePMlK9LEG8waxIzXHSpErjrPrsVJVcBY7TM?= =?us-ascii?Q?OuwpXmPCwjdxURjgotcLc93stPQU2DJzwRV+pul1sIY9PZCMnIURp+tf8uyM?= =?us-ascii?Q?eE92X55puHcc6ag88szK4nsT//Hz0ooag8XRgPs/Kr+IuHH6uk1vM1PiPSLF?= =?us-ascii?Q?OB9xFRaRgsZ1DRCdukjES/qcjVUia/vggraXeTDx6y1zV7cw9+NK7quygpA8?= =?us-ascii?Q?YIh+UZdisYXSzELX0sIdBgeo34yXBcdThjF3KGEQo4Xr5r3uO2vCHax496mf?= =?us-ascii?Q?FL/MS692TywLXuEt8eANExKWpTrAzX+pfpeib9YMQR6ZN+/BEVgrxUFYszcC?= =?us-ascii?Q?4BmQI30LFiG/9PhjQN4SgyX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E7v0WApYDNWP1UIVjo8MC9a83qIM+r4qkb/nvyMynneX5CYEjmbm2tRwbMse2/UxJPp08e68JoxBXj5P4LNRbgPkvX/9zUCq8lnV+C+6cJNn7EDj33YNTjXzmyt3MAlaryl1t20uTeelgFMRpvHq2P27A8O3TgcviNS6RYywdiR25dxn NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(22074186197030)(183786458502308); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040176)(601004)(2401047)(13013025)(13020025)(13024025)(13023025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:AM5PR0801MB1779; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1779; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1779; 4:K4TFnLSGzK/bycLRJImGKEkQWOAT93U0EKsRhMHCAEdE1yvi/ncn/k5a2gvvllwCKJcHv5bSEixvkc2HgJV7DZ23BUCVoStyphRRp/XxW+8q0iwmOvj7TrWxWKr4yDAPLSSUvY3cvI4w0wMAwrjP0NrgavJh9zohlAl8078EMB/fX/NgtPLWOkAHbcF/toLcMBrCudXstvMdo3zQX9GoUH2lbpUwghE5zmJkZX1ki9lHRHh+93TB4fkALs+aarfqlzD62kmlg+Qj6hcFmD6hBKPKKAuqiiD8wvH4sJev1sBfw6rEOAzjOYr0mUejkLsUfodD/niDR2YywFfewcXUR/pZLAsoX1j5k0ZiYKlU8wQunWAHOAlyfEvHApfTR1r5jopmV9zAkL5mIQSYanmW1iYX5a8eSWrsUw0sjK2BKLlIQGj3nOIUEKbdzhzdevxg93eplYVodnQH64YbBX8rCj0yc8HsXBMkjPKC8yEFgdTWOi5N8kw/hRTM8TpXxyXHrLOoIL6QbIN/Sd0ObNC9qFCroAv5kugOTLinIEmFe58+ts0pdI0UxErO9LmYezD5u57Rn12/IOU9NI1IwkPhDv96VCcnSzSfXGuuNvwpoKC2dBNziogVH6SDnKcv+Ft8 X-Forefront-PRVS: 012349AD1C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1779; 23:NYkUZMrT9NsFAk4o1oIo9iCTd8weTcak2q1CM8u?= =?us-ascii?Q?ZAUu7D6MlD802AnZf2HggJEay876K+7102grroWv0Vgn40wkxu+VtoG6qqSQ?= =?us-ascii?Q?qjSHy/jTDBzQq+ml/seDHu97pyLWLnZU9OhgWbAdQi1RzpTrL6dMzOUyau1P?= =?us-ascii?Q?9jyJQyQhiQbc9UtYTpg72xpRNWuIl2Txc89B3IByu1QgIE2ePTRpiSVhxC3d?= =?us-ascii?Q?venFwdeP5FPYNK+5aWZ8SLn386T4vnxmRhHZ85LuJNJMDK5sz2+LiOG+IJoV?= =?us-ascii?Q?yzl8lCN2VBM3MilPfAekVXb4le6aSgf0bVL0LsU+NcezEBALcw78vkCa0Z4U?= =?us-ascii?Q?3f/YjkHPTHSovVdl8NfPGbJss0j2kB8Um08gBm3BCeJBYX4Pk6bqGCnpNA1Z?= =?us-ascii?Q?i+Wtjp2ckAnen20dSGTjFjg3Gk6vX0ASfuuIhhmlSW7AmdrKkrNcQZPBoQUC?= =?us-ascii?Q?bbrwkB7BUmNQOZ21eIGBsz7z+F2pPt/pzd1mi5x4+V3j2wSqi4r5cJ3WdxNJ?= =?us-ascii?Q?t5STri+ttG3Re2FHOUTGcPsLpD5osZWZDezVQ+Uz7U5+FxOcDWeQvjvlY8bS?= =?us-ascii?Q?fGU7Vf1ABD1e1asbRj27D9crY1UXS1+pNJkxkwxaJ+//iesXU9LrH7EWaNTs?= =?us-ascii?Q?fTWCtK2Iy+aG61mcf/HJtZdsNTDsor7vFltl1KWEYZmxpaSxYYVw338g4N2G?= =?us-ascii?Q?WzaMihJA5Aa2eucxStY2FsZ4oR9BdZySVdCpOUA096MfYYl+f61pZQpD5ssM?= =?us-ascii?Q?znMY+3Y+Nqv1GA/5lEk3ev6eYp9bONI8/UawTrEsvCyatvvPMYYiHtcjYaFA?= =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soft-Exchange-Diagnostics: 1; AM5PR0801MB1779; 7:dasFS/WAyS41Zoevs8EiJJEum17b/fmRJRExKxp8Y2UahF1feoZQayTB228kb/klROVCSjD37Fbb0Q93L4bymRvnZjgk4nxu6QYf0krCFQcOmKgW2H3w5Q8Cp7rN7MwQsWvV0nP2BMzFop/ZohxyxZdUS5nxY4+CIL1PO5pDUe3yK1e0H2oGF8uk9hCmZkSxuhz31+CjXMIATBZ7THNjyhTqKoSQNWh80DUhz4TKsvTt0ctQmGEizn7s0JrndOj1HHIkue99s5ZehZbZ7NLlaJ33OGDcCE0y+A0UwH6MegQKn3Pj7HI6ZkRRDV+MjzO5kyef+1PKRPpnpGNNWZj3TcvO8gon52TtB8ZrhoXtq/g= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 15:38:03.6206 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1779 X-IsSubscribed: yes --- This patch has already been approved: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01554.html --- This patch ports the logic from s390's TARGET_FLT_EVAL_METHOD to the new target hook TARGET_C_EXCESS_PRECISION, following the guidance in this thread https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01172.html In this patch we handle EXCESS_PRECISION_TYPE_IMPLICIT like EXCESS_PRECISION_TYPE_FAST. This has the consequence of meaning float_t in glibc is calculated in a different precision (double) to that indicated by FLT_EVAL_METHOD. --- gcc/ 2016-11-09 James Greenhalgh * config/s390/s390.c (s390_excess_precision): New. (TARGET_C_EXCESS_PRECISION): Define. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3f98cd8..311a7f2 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -15260,6 +15260,43 @@ s390_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty return NULL; } +/* Implement TARGET_C_EXCESS_PRECISION. + + FIXME: For historical reasons, float_t and double_t are typedef'ed to + double on s390, causing operations on float_t to operate in a higher + precision than is necessary. However, it is not the case that SFmode + operations have implicit excess precision, and we generate more optimal + code if we let the compiler know no implicit extra precision is added. + + That means when we are compiling with -fexcess-precision=fast, the value + we set for FLT_EVAL_METHOD will be out of line with the actual precision of + float_t (though they would be correct for -fexcess-precision=standard). + + A complete fix would modify glibc to remove the unnecessary typedef + of float_t to double. */ + +static enum flt_eval_method +s390_excess_precision (enum excess_precision_type type) +{ + switch (type) + { + case EXCESS_PRECISION_TYPE_IMPLICIT: + case EXCESS_PRECISION_TYPE_FAST: + /* The fastest type to promote to will always be the native type, + whether that occurs with implicit excess precision or + otherwise. */ + return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; + case EXCESS_PRECISION_TYPE_STANDARD: + /* Otherwise, when we are in a standards compliant mode, to + ensure consistency with the implementation in glibc, report that + float is evaluated to the range and precision of double. */ + return FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE; + default: + gcc_unreachable (); + } + return FLT_EVAL_METHOD_UNPREDICTABLE; +} + /* Initialize GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -15320,6 +15357,9 @@ s390_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_const_tree_hwi_hwi_const_tree_true +#undef TARGET_C_EXCESS_PRECISION +#define TARGET_C_EXCESS_PRECISION s390_excess_precision + #undef TARGET_SCHED_ADJUST_PRIORITY #define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority #undef TARGET_SCHED_ISSUE_RATE