From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B2AC0385841C; Sun, 16 Apr 2023 17:27:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2AC0385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681666053; bh=/nkmcBhX9I49u1HrN/jbS+E4RBGTVd5+4VDZHW3gPxA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gfNjNnudAR0+xJ3JhH3CbYAedf0JDeX7Ih8HSJh5e+TO/x+SHGOKVcDkKTDbNzP+j KiUDx6dh2SAxzbFAVyGienuoVwfqRn7vi4fIOrkOUcy6tTtUFrUY73WuBtoNj3E6JW 2JHw/qghM9e+RPmCSfRADzcHnqVSLcDVcy8AfPwc= From: "klaus.doldinger64 at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66511] [avr] whole-byte shifts not optimized away for uint64_t Date: Sun, 16 Apr 2023 17:27:33 +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: 4.9.2 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: klaus.doldinger64 at googlemail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D66511 Wilhelm M changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |klaus.doldinger64@googlemai | |l.com --- Comment #5 from Wilhelm M --- (In reply to Roger Sayle from comment #4) > Created attachment 54871 [details] > proposed patch >=20 > Proposed patch, using a peephole2 in avr-dimode.md to inline calls to > __lshrdi3 that require only a single instruction or two (due to truncatio= n). > For truncations to char, this is smaller and faster, and for truncations = to > unsigned short this is the same size, but faster. The drawback is that > performing this late (in peephole2) doesn't eliminate the stack frame > prolog/epilog. Thoughts? Looks good to me. Many thanks!=