From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mtlfep01.bell.net (belmont79srvr.owm.bell.net [184.150.200.79]) by sourceware.org (Postfix) with ESMTP id 1DC47384C004 for ; Thu, 27 Aug 2020 00:31:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1DC47384C004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dave.anglin@bell.net Received: from bell.net mtlfep01 184.150.200.30 by mtlfep01.bell.net with ESMTP id <20200827003154.JELY5779.mtlfep01.bell.net@mtlspm02.bell.net> for ; Wed, 26 Aug 2020 20:31:54 -0400 Received: from [192.168.2.49] (really [70.53.61.197]) by mtlspm02.bell.net with ESMTP id <20200827003154.ROHX3672.mtlspm02.bell.net@[192.168.2.49]>; Wed, 26 Aug 2020 20:31:54 -0400 Subject: Re: [PATCH] hppa: Improve expansion of ashldi3 when !TARGET_64BIT To: Roger Sayle , law@redhat.com, 'GCC Patches' References: <044501d677ba$099a5520$1cceff60$@nextmovesoftware.com> <6942a7b4-ec9b-0278-21e0-fa2f6a13b09b@bell.net> <00c701d67861$a1c37370$e54a5a50$@nextmovesoftware.com> <42249873-db65-322f-1305-3295e8ca27f6@bell.net> <000901d6789d$8bdd40e0$a397c2a0$@nextmovesoftware.com> <001501d678db$56a34580$03e9d080$@nextmovesoftware.com> <709e096b57a340e75084980d27c43229099ac87a.camel@redhat.com> <005201d67bef$1816b5b0$48442110$@nextmovesoftware.com> From: John David Anglin Message-ID: Date: Wed, 26 Aug 2020 20:31:53 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <005201d67bef$1816b5b0$48442110$@nextmovesoftware.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-Analysis: v=2.3 cv=E9SzWpVl c=1 sm=1 tr=0 a=6x1y2OhCX1CAR/Lk3lU3cg==:117 a=6x1y2OhCX1CAR/Lk3lU3cg==:17 a=IkcTkHD0fZMA:10 a=y4yBn9ojGxQA:10 a=FBHGMhGWAAAA:8 a=I4mnYipR6wz9U9-ImHMA:9 a=QEXdDO2ut3YA:10 a=9gvnlMMaQFpL9xblJ6ne:22 X-CM-Envelope: MS4wfM3ZoFA2G/vKK0G2ICzAVjyq99o50Wzvw9Y8Katm6ehar8AanOD61u20+D7LeCCcLCQy6uqdxOFHYNTx/ooUG9UlMJgCxDS319lCvuvIGniJ1O1Yt4Pn +r/Ap0qeB4kn75x9qa054JPXAqGe1/RdvBUmENmgQ4cexNpjdfSOHdmcRi1X73W623LPV9m+r0FtXw== X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 00:31:56 -0000 On 2020-08-26 5:23 p.m., Roger Sayle wrote: > These more accurate target rtx_costs are used by the gimple-ssa-strength-reduction.c > (via a call to mult_by_coeff_cost) to decide whether applying strength reduction would > be profitable. This test case, slsr-13.c, assumes that two multiplications by four are > cheaper than two multiplications by five. (I believe) This is not the case on hppa which > has a sh2add instruction, that performs a multiplication by five in one cycle, or exactly > the same cost as performing a left shift by two (i.e. a multiplication by four). Oddly, I > also believe this isn't the case on x86_64, where the similar lea instruction is (sometimes) > as efficient as left shift by two bits. This looks like a regression. gcc-10 (prepatch):         addl %r25,%r26,%r28         sh2addl %r25,%r28,%r25         sh2addl %r26,%r28,%r26         addl %r26,%r28,%r28         bv %r0(%r2)         addl %r28,%r25,%r28   [local count: 1073741824]:   x1_4 = c_2(D) + s_3(D);   slsr_11 = s_3(D) * 4;   x2_6 = x1_4 + slsr_11;   slsr_12 = c_2(D) * 4;   x3_8 = x1_4 + slsr_12;   _1 = x1_4 + x2_6;   x_9 = _1 + x3_8;   return x_9; gcc-11 (with patch):         addl %r25,%r26,%r19         sh2addl %r26,%r26,%r28         addl %r28,%r25,%r28         sh2addl %r25,%r25,%r25         addl %r28,%r19,%r28         addl %r25,%r26,%r26         bv %r0(%r2)         addl %r28,%r26,%r28   [local count: 1073741824]:   x1_4 = c_2(D) + s_3(D);   a2_5 = s_3(D) * 5;   x2_6 = c_2(D) + a2_5;   a3_7 = c_2(D) * 5;   x3_8 = s_3(D) + a3_7;   _1 = x1_4 + x2_6;   x_9 = _1 + x3_8;   return x_9; Regards, Dave -- John David Anglin dave.anglin@bell.net