From patchwork Fri Nov 11 15:37:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Greenhalgh X-Patchwork-Id: 81857 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1328931qge; Fri, 11 Nov 2016 07:39:03 -0800 (PST) X-Received: by 10.98.73.203 with SMTP id r72mr8127815pfi.75.1478878743568; Fri, 11 Nov 2016 07:39:03 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 12si7502069pfi.251.2016.11.11.07.39.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 07:39:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441122-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-441122-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441122-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=U+AQIzanpsMY0sD4 Bgyh+4XCpQKDP/iNPBg5or0o5u9PBp12xZEPwmtdBnQsjvyfTKz5PMIP2drC3Zn4 MSKu9BFi+Bi1DVJvUdOzen/LffTYkgDOFShYBmrO57A6P8d2lkuua+2mIzpzJ0HF 4K3nS3+tvj/WqJ3P3YlMAnJS7mk= 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=SvPA4ClIiQO6wX6ELuatH0 R98aE=; b=DoKFeZVTgV+Jc4/4rR1mgP4XdCSy1SMV5vng3HgZSA1uIZqP1r99EB 38UbVYKTDQ8ASnGps6CL6OB29zgsHQrH/hu0O/A+ODiepFdrw+oUn7XUdneJCy5Z ULQQbFy5VVpTJxbinGMZ8nt8V+HFW2vJKP1aogAep1nqkXGv5mw2s= Received: (qmail 74437 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 74261 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=HX-Exchange-Antispam-Report-CFA-Test:102415395, Hx-spam-relays-external:sk:EUR02-A, H*RU:sk:EUR02-A, HX-IncomingTopHeaderMarker:899 X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00042.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 15:38:03 +0000 Received: from VI1PR0801CA0050.eurprd08.prod.outlook.com (10.168.60.146) by AM5PR0801MB1780.eurprd08.prod.outlook.com (10.169.247.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.707.6; Fri, 11 Nov 2016 15:38:00 +0000 Received: from AM1FFO11FD001.protection.gbl (2a01:111:f400:7e00::111) by VI1PR0801CA0050.outlook.office365.com (2603:10a6:800:4d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.609.9 via Frontend Transport; Fri, 11 Nov 2016 15:38:00 +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:00 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:899; 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:35 +0000 From: James Greenhalgh To: CC: , , Subject: [Patch 1/17] Add a new target hook for describing excess precision intentions Date: Fri, 11 Nov 2016 15:37:18 +0000 Message-ID: <1478878647-22547-2-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)(199003)(189002)(586003)(5660300001)(2476003)(33646002)(189998001)(568964002)(626004)(5000100001)(4610100001)(84326002)(512874002)(5890100001)(86362001)(87936001)(104016004)(2906002)(246002)(7846002)(356003)(26826002)(2950100002)(110136003)(305945005)(2351001)(6916009)(50986999)(4326007)(76176999)(6666003)(36756003)(50226002)(8936002)(106466001)(8676002)(77096005)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1780; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD001; 1:ukd10wRO5hDmdGoWJLX1lj95P7mS26CW/eCj996W5Bdoohanjv8Prn0BRxrLhsmqkIZc5YEkLtGiJNlZ7KooBqbNWlm0LCX5frkVviKvpnuiGyN4u8vcz+t1Sv9OgzSOqZQ1+tq3nekEyqjlBgNyAfw+P9gYZ2Tuud3o1x9r0dKNfAr5q/isKoFS5+nrWKTtgHPOE1y/0UwvgRwRg5i8T6/ZFIHMJA+notESNkgcFJU+5C4N/HZ3py34ALfoiCYICt2HP6bZKQ3jvka43CzjMUHMQ5VL2O82KhDuPubRABckkR+VAaKWiT5qBfpXKPat6qddNGjosiNdyNXA+rqnxsOUhuKy90dpbU0j3deSuNWaW1HN41OmmxsrTMZ3z/Yxoqz36heTaXUn1BuurYBGbg7Y/A63HicTWaVZUxIwL7fMoV+cnnVOZrjAC2RkmRR/shZnshwnaN1+O+2mHnjakb3nieZJINhMgN3mquNEW6s9hH8vUmn6cVoLR+5G3cXP4XJ+oRg4bi1iLk/T/IO/KSMs5op1EJRd2aP4fx5hebPseLQlae8TadXONqbjU/nNaLMGNrez6zLdgnoAWobb04lZlHumjY7AFyBrocrIzDY= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1780; 2:lh63cijk/xELb/lgw6PQZa6ayklJfxEMy+g8LSE1jhiVI8Azv1FEw8y5/vIc3AMHXS4SMPWwlnDRB3Xc2KDnqj4949QCg59ypehk8IAC+2kf4+H8nB7cEBId0qWmvb5/jUuZV7ZU4mjQ6cZpdtAYH0j6W6sTGr3s+Y4mXtwAYC4=; 3:ahkysvmxCy+CCueLaVyUPwUtrGS7eMMGxBVRD2qgwkp1kQV/Ql2d76qBpoBiT7C4LaWYWKboS/JcPUYagARqlRQs7eOff0NYNN2jbLu9UN0f9ffNzle7JCz42+KOYOSEUfAUpuqDs2316cI9JDAJ8amZigm/bdnUrOZp3PifP1EyR+Wc6wX+/kQrTNRbyeKZL47cFQ9A28DiQnzcPjfCYqHAsX7IMyebk8m1ChWfwQpOYN43la9GliaSZTXABRV/v12PsIczWu4U4sr8kxPhcTiJR6hCi1jYbOWHspApCvY= X-MS-Office365-Filtering-Correlation-Id: 4a91bc42-d76f-4c2a-cf5d-08d40a48b7c4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:AM5PR0801MB1780; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1780; 25:0dkQKCqbn7uWtl0gqodXJXCa7UcHE0cq2C4Tsas?= =?us-ascii?Q?JMi4VpgEKbFvWVcr7oJBq2N/CcieQZIRKiHkRCbGVWxKaW3K0Q/4SqSG40Bk?= =?us-ascii?Q?/KqlfovwtV06kczXJUZ8orHR3v4w2l2rm1Ut76WxSnCfHfOJQo5VVMBOaK87?= =?us-ascii?Q?3KSjx2V9oCVhdE6pCJx3LcwXx4ybrwZjRh1BmZM/FrbbbHcVTx6HzGhx1x4G?= =?us-ascii?Q?7jz/ToD/596MWpTFHh+rMT4We09s18vVdPO5lZvjh5sDG9Y3d9/n6qpZiY8P?= =?us-ascii?Q?nMmOj+Oyy68p6k25AJa4n8UgZGcr3Ckc3bljRXUbngU3gz7bZbEu+XpZG/+f?= =?us-ascii?Q?xl3QgKpGXqCgODvYhkvlgGgsbipiWYWJZLTnuc91+sryC+0tE3tXFmDW7Cr5?= =?us-ascii?Q?LggT8nEVqwhfcuR3C4Jd//IsFm2tGh/K263mP7on+9cBILymtKaCZx7CrH32?= =?us-ascii?Q?dwYR80IKhvyR/mzXF3/aNEOf+kQ9Bs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T/mzqqjCa1jSFJTs2NaQZyzhsVdFFDw6NYA12mnkepJizU+CTQxxTMBBWYfAEKbxKiRK0lv0NVHZd/V6KS4LXBP/m5oUniBnV7zzG6kS4JqpimNplU1N5PQkTmVz4nULoA0IRN/fXnjrzFbTpGv1r/H+wGnVhJQYBKkUZq6uIB/SuY5B4+CKGypKKxkHSW2mnl+EfYkX1MOn7 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)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:AM5PR0801MB1780; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1780; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1780; 4:xqVLN9xuWGkDT8VoOraLaafIxwnveZBaQPZnOZX49c5F88e3tIRVoZGxlIwU1FoP5xEWNODKJHBhKi2L9Jx1Q8XS9zRMRuUhvXLSpBetJXpw6RAwCnHh1MlGv3ZDgj1Xzul4gYjw481WvWf17yAYHIPpENJKycZ7jSViR5Pe/izQfem3nqN4D59IWuT/u8Q46rn1KScyErLkrF8k7910i6jhsnJsZl8Oh3ihI6hal7gPIu+UjVtsIwHuginwrrTwogJkq8rFb2dsWYV2FURDodgYWmD083zoVspOcnNfpl3VjD7zOzyOC7S0f6TWlWMkZX5heYLE1JtMwhoq6kABOL4LOOGhLnw1Drv9fC18BEWrQHyYtstoglo/5TXTl8MhhvHQHlP0qlGnq4ndBQgepRNSGHltd/jqTsmV9D03Tz3u/zf4bYZ4zx6WOiB4lyTnFtya3XwliA1XsyhT9b8HiRkAjQ7/LhgjffMvNSHxr8hMqj7zx3KTz1qmR9Gnbr4WzQcQ+1IMJ6N7xGvznXnQFo0EXyTpH3p4zhFFfDjmheFyKvfXd1qwLkAD1s9Oz9n7EdarBzk2ZYrOA/Ff1UA60ItnFmt7UFFTq278qHTO5JQ/BFW5nhg3DuY8ANrxl/0q X-Forefront-PRVS: 012349AD1C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1780; 23:j674Td+PMvF+tjx+TEX7uVLio8gg5Q74BklE3fT?= =?us-ascii?Q?iskvRRrTPKnSmgl+vR5rvliu4ShwM8nQ88uQ1hrRetYNHE2y54Fr2SE2n6df?= =?us-ascii?Q?GkKlwidP2dPk5Q2tbdxNib6CsF+95Y5SATvj1vf2XOqAjWLWBUVODpJMYlJF?= =?us-ascii?Q?W6D0wjhUeaCIpK/FJLulWHgNvTELa1/DzmD0Jw22d2IIbSPvwWkPBJCeNjAy?= =?us-ascii?Q?4reIO2bDtdEgcLX7T5CKjS5r7bleuZNKHrVCHDFOTA031naf4JHydCPGDbug?= =?us-ascii?Q?ppSVuqOuciYRDX80hsZ9uL17M/F0+mCIdDwbBIiougMh3CHxxme5m22UYMpv?= =?us-ascii?Q?92kPvqu0FORNGkSOs+GP8a87KIXuFvh92lHA8QXQ56TwDydYmNrYbSYoGDvW?= =?us-ascii?Q?+q2d9WkxqvTW7BJheztyuHIsX7liiNLwG+ofYZrbs55cWTtZhJLKRtOqXbke?= =?us-ascii?Q?g31h2NO2JVb8eafEpn7HYAgbUXj9yCcYi8OunwumNHSb8Sf5EQtsjQjD6sc+?= =?us-ascii?Q?SszdIO++01D8cZn8BP4C3bWcPvNbFQiMLsrbo1PRd4lbG19BkoOSAi+Mk+Wp?= =?us-ascii?Q?VEbg0tVAp9l6UsebFleJOPV5W+ot2pkan+tuIcaBEe/Pjru9CGCVTGCaFbu/?= =?us-ascii?Q?k3SAST7JzlluTLd/71UKBugPWxXf/0qNV9uJPSQoImpRcS016QeskdDfRHye?= =?us-ascii?Q?KEfjhfwbfHe9OqMCGnbyYwHzDtX8JMHDkGEZZewJXqqGxlawXG5DXZ3DY0hw?= =?us-ascii?Q?KLpD9xqOGO0HtOTOuhHJFcZRmxBXcHl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pamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1780; 7:feyfe4uUIbnbaoD7s1L2eeHCchFlc0w9FzzZPGsHr0ClKb7Rzp35JDZaZN4SfcWWyF7DKWcQUh/+B4E9F9GK09YmDnWcZ2vgooD7nv7EqgMpsvMxxZJtvaA/Tr7rZLaDBZAcWjfIIGgJyWgyNAAREnrh7HyXgx1SL94OUvzoYDusAtD5TJnWp+dlauwYzYW/iQN8kukmvlOS2qs2eRHyWSB/CkmW7gsSMP71KqFL7rDXG33RoHJRXMH0hPIdsYi7AsA6iDfKvqfhq94oWZKHH3W58V3/hNuzVv51fnMvaegBFGi3iCkApcnTbZL2qIyUXPE4Uog+6cm3/3KoFcf2ZCC4r4uf55s64LEXkoo+tig= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 15:38:00.0794 (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: AM5PR0801MB1780 X-IsSubscribed: yes --- This patch has already been approved: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00781.html --- This patch introduces TARGET_C_EXCESS_PRECISION. This hook takes a tri-state argument, one of EXCESS_PRECISION_TYPE_IMPLICIT, EXCESS_PRECISION_TYPE_STANDARD, EXCESS_PRECISION_TYPE_FAST. Which relate to the implicit extra precision added by the target, the excess precision that should be guaranteed for -fexcess-precision=standard, and the excess precision that should be added for performance under -fexcess-precision=fast . Thanks James --- gcc/ 2016-11-09 James Greenhalgh * target.def (excess_precision): New hook. * target.h (flt_eval_method): New. (excess_precision_type): Likewise. * targhooks.c (default_excess_precision): New. * targhooks.h (default_excess_precision): New. * doc/tm.texi.in (TARGET_C_EXCESS_PRECISION): New. * doc/tm.texi: Regenerate. diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 869f858..09f8213 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -331,6 +331,24 @@ enum symbol_visibility VISIBILITY_INTERNAL }; +/* enums used by the targetm.excess_precision hook. */ + +enum flt_eval_method +{ + FLT_EVAL_METHOD_UNPREDICTABLE = -1, + FLT_EVAL_METHOD_PROMOTE_TO_FLOAT = 0, + FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE = 1, + FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE = 2, + FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 = 16 +}; + +enum excess_precision_type +{ + EXCESS_PRECISION_TYPE_IMPLICIT, + EXCESS_PRECISION_TYPE_STANDARD, + EXCESS_PRECISION_TYPE_FAST +}; + /* Support for user-provided GGC and PCH markers. The first parameter is a pointer to a pointer, the second a cookie. */ typedef void (*gt_pointer_operator) (void *, void *); diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 85341ae..fecb08c 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -947,6 +947,10 @@ sign-extend the result to 64 bits. On such machines, set Do not define this macro if it would never modify @var{m}. @end defmac +@deftypefn {Target Hook} {enum flt_eval_method} TARGET_C_EXCESS_PRECISION (enum excess_precision_type @var{type}) +Return a value, with the same meaning as @code{FLT_EVAL_METHOD} C that describes which excess precision should be applied. @var{type} is either @code{EXCESS_PRECISION_TYPE_IMPLICIT}, @code{EXCESS_PRECISION_TYPE_FAST}, or @code{EXCESS_PRECISION_TYPE_STANDARD}. For @code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which precision and range operations will be implictly evaluated in regardless of the excess precision explicitly added. For @code{EXCESS_PRECISION_TYPE_STANDARD} and @code{EXCESS_PRECISION_TYPE_FAST}, the target should return the explicit excess precision that should be added depending on the value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}. +@end deftypefn + @deftypefn {Target Hook} machine_mode TARGET_PROMOTE_FUNCTION_MODE (const_tree @var{type}, machine_mode @var{mode}, int *@var{punsignedp}, const_tree @var{funtype}, int @var{for_return}) Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or function return values. The target hook should return the new mode diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 400d574..03758b5 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -921,6 +921,8 @@ sign-extend the result to 64 bits. On such machines, set Do not define this macro if it would never modify @var{m}. @end defmac +@hook TARGET_C_EXCESS_PRECISION + @hook TARGET_PROMOTE_FUNCTION_MODE @defmac PARM_BOUNDARY diff --git a/gcc/target.def b/gcc/target.def index caeeff9..bf4fb29 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -5452,6 +5452,23 @@ DEFHOOK_UNDOC machine_mode, (char c), default_mode_for_suffix) +DEFHOOK +(excess_precision, + "Return a value, with the same meaning as @code{FLT_EVAL_METHOD} C that\ + describes which excess precision should be applied. @var{type} is\ + either @code{EXCESS_PRECISION_TYPE_IMPLICIT},\ + @code{EXCESS_PRECISION_TYPE_FAST}, or\ + @code{EXCESS_PRECISION_TYPE_STANDARD}. For\ + @code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which\ + precision and range operations will be implictly evaluated in regardless\ + of the excess precision explicitly added. For\ + @code{EXCESS_PRECISION_TYPE_STANDARD} and\ + @code{EXCESS_PRECISION_TYPE_FAST}, the target should return the\ + explicit excess precision that should be added depending on the\ + value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}.", + enum flt_eval_method, (enum excess_precision_type type), + default_excess_precision) + HOOK_VECTOR_END (c) /* Functions specific to the C++ frontend. */ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 866747a..73e1c25 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -2135,4 +2135,12 @@ default_min_arithmetic_precision (void) return WORD_REGISTER_OPERATIONS ? BITS_PER_WORD : BITS_PER_UNIT; } +/* Default implementation of TARGET_C_EXCESS_PRECISION. */ + +enum flt_eval_method +default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED) +{ + return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; +} + #include "gt-targhooks.h" diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 94f5e31..e00da60 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -263,4 +263,7 @@ extern bool default_optab_supported_p (int, machine_mode, machine_mode, extern unsigned int default_max_noce_ifcvt_seq_cost (edge); extern unsigned int default_min_arithmetic_precision (void); +extern enum flt_eval_method +default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED); + #endif /* GCC_TARGHOOKS_H */