From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127568 invoked by alias); 13 Jun 2017 10:17:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127543 invoked by uid 89); 13 Jun 2017 10:17:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Third X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr50069.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Jun 2017 10:17:01 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com (10.173.74.140) by VI1PR0801MB2031.eurprd08.prod.outlook.com (10.173.74.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Tue, 13 Jun 2017 10:17:02 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com ([fe80::b9d4:b6e7:35f9:e399]) by VI1PR0801MB2031.eurprd08.prod.outlook.com ([fe80::b9d4:b6e7:35f9:e399%17]) with mapi id 15.01.1157.017; Tue, 13 Jun 2017 10:17:02 +0000 From: Tamar Christina To: Richard Biener CC: GCC Patches , nd , "law@redhat.com" , "ian@airs.com" , "rdsandiford@googlemail.com" Subject: RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)] Date: Tue, 13 Jun 2017 10:17:00 -0000 Message-ID: References: In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar.Christina@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0801MB2031;7:B4VNsDtry8T+DQScuOPHmEv147C05Bye0i0C38OxR6IMkkFi5FUStrbzrCPbxF1TXR3ZY6adumZ+RqMoqx1V+pYa6BZjqFfWnkrruWu5bse2ijKR/D1dOn41w6Ed7OnOAd8ZiTNw4wjFkBDgK0IySVvRjwBn6UeK5LibQMVaMLcE9lijKnYZHaB3H30hh545OUhtDLz6cqcuemex53EPdRymdO13JMCoLw2I4xnAJFfp9Qk/JohYSmazRU6+PY81l7amNWNX9fdGkdGAQ2JwB+6DhJQQAlWqFc7J5a7tBeRfZ9dwwOFg/LdwpbAoPPb6tUT+sIegUrBeoCitpqPrHg== x-ms-traffictypediagnostic: VI1PR0801MB2031: x-ms-office365-filtering-correlation-id: de85c431-7285-4c85-7150-08d4b24555a0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:VI1PR0801MB2031; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0801MB2031;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0801MB2031; x-forefront-prvs: 0337AFFE9A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(377424004)(189002)(51914003)(199003)(189998001)(3280700002)(74316002)(97736004)(14454004)(68736007)(7736002)(66066001)(305945005)(2950100002)(6916009)(3660700001)(2900100001)(86362001)(54906002)(6506006)(6436002)(25786009)(81166006)(81156014)(8676002)(4326008)(8936002)(6246003)(7696004)(50986999)(53936002)(76176999)(54356999)(110136004)(38730400002)(33656002)(105586002)(5250100002)(2906002)(106356001)(478600001)(102836003)(6116002)(101416001)(99286003)(9686003)(3846002)(72206003)(5660300001)(55016002)(229853002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0801MB2031;H:VI1PR0801MB2031.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2017 10:17:02.3741 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2031 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00886.txt.bz2 Hi Richard, Thanks for the feedback, I'll update the patch accordingly. > What does >=20 > > (copysigns @0 (negate @1)): Likewise. >=20 > do? >=20 Sorry this slipped through my clean-up. The patch doesn't actually contain = this definition anymore. > Third, new IL that is present throughout the compilation always poses the > risk that while passes may be able to handle copysign they do not handle > xorsign (vectorization?). In this case it looks like the matching is sim= ply to > enhance RTL expansion which means it should ideally be done close to RTL > expansion only. If you write >=20 > (match (xorsign_p @0 @1) > (mult:c (copysign real_onep @0) @1)) >=20 > you can call gimple_xorsign_p (you need to declare it, see the generated > gimple-match.c file for the definition) from, say, > pass_optimize_widening_mul, which despite its name is used as a kitchen- > sink for late GIMPLE pattern-matching stuff to enhance RTL expansion / > instruction selection. >=20 > Thanks, > Richard. >=20 > > > > gcc/ > > 2017-06-07 Tamar Christina > > > > * builtins.def (BUILT_IN_XORSIGN, BUILT_IN_XORSIGNF): New. > > (BUILT_IN_XORSIGNL, BUILT_IN_XORSIGN_FLOAT_NX): Likewise. > > * match.pd (mult (COPYSIGN:s real_onep @0) @1): New simplifier. > > (mult (COPYSIGN:s real_mus_onep @0) @1): Likewise. > > (copysigns @0 (negate @1)): Likewise. > > * builtins.c (expand_builtin_copysign): Promoted local to argument. > > (expand_builtin): Added CASE_FLT_FN_FLOATN_NX > (BUILT_IN_XORSIGN) and > > CASE_FLT_FN (BUILT_IN_XORSIGN). > > (BUILT_IN_COPYSIGN): Updated function call. > > * optabs.h (expand_copysign): New bool. > > (expand_xorsign): New. > > * optabs.def (xorsign_optab): New. > > * optabs.c (expand_copysign): New parameter. > > * fortran/f95-lang.c (xorsignl, xorsign, xorsignf): New. > > * fortran/mathbuiltins.def (XORSIGN): New. > > > > gcc/testsuite/ > > 2017-06-07 Tamar Christina > > > > * gcc.dg/tree-ssa/xorsign.c: New. > > * gcc.dg/xorsign_exec.c: New. > > * gcc.dg/vec-xorsign_exec.c: New. > > * gcc.dg/tree-ssa/reassoc-39.c (f2, f3): Updated constant to 2. >=20 > -- > Richard Biener > SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, > HRB 21284 (AG Nuernberg)