From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2F52838708E1; Sat, 15 Jun 2024 07:18:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F52838708E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718435923; bh=D1/RqO0ODEe/QhbQARUFha63Q0LvyJLAoNVrFTtawUk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yJVjCfeYonqQ3kx1QtzlpTjDNolhqapg2KkuCjktIXR5it5kBA6PbbNI3UtCX3OZM 8XYLTTSA0M+pxeo5+eRbPLc2FA0ijqdAx5DnlyT4ofQSoLrsSJ/TaIPGGgypVCgfOF /pK4+3PS9aoNIQp5V/5CDT2avx+vy6dP1y/lsxx8= From: "syq at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111376] missed optimization of one bit test on MIPS32r1 Date: Sat, 15 Jun 2024 07:18:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: syq at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: syq at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111376 --- Comment #14 from YunQiang Su --- And it seems that the performance of SLL is related with the operand. Just iterate from 0 to 1e9: ``` 0000000000000b00 : b00: 000223c0 sll a0,v0,0xf #### <-- the code is something wrong #### in normal code, we should access #### v0 here. v0 will be 100= or 1000. b04: 04810003 bgez a0,b14 b08: 00000000 nop b0c: 03e00008 jr ra b10: 240203e8 li v0,1000 b14: 03e00008 jr ra b18: 24020064 li v0,100 b1c: 00000000 nop ``` is slower than ``` 0000000000000b00 : b00: 000223c0 sll a0,a0,0xf b04: 04810003 bgez a0,b14 b08: 00000000 nop b0c: 03e00008 jr ra b10: 240203e8 li v0,1000 b14: 03e00008 jr ra b18: 24020064 li v0,100 b1c: 00000000 nop ``` I have no idea how to make a trade off here.=