From: Georg-Johann Lay <avr@gjlay.de>
To: gcc-patches@gcc.gnu.org
Subject: [patch,avr,applied] PR115065: Tweak __clzhi2
Date: Sat, 18 May 2024 15:19:01 +0200 [thread overview]
Message-ID: <3b03c4ff-f133-44a3-9561-113e2c4545b6@gjlay.de> (raw)
Applied as obvious,
Johann
--
Author: Wolfgang Hospital <Wolfgang.Hospital@arcor.de>
Date: Sat May 18 15:02:51 2024 +0200
AVR: target/115065 - Tweak __clzhi2.
The libgcc implementation of __clzhi2 can be tweaked by
one cycle in some situations by re-arranging the instructions.
It also reduces the WCET by 1 cycle.
libgcc/
PR target/115065
* config/avr/lib1funcs.S (__clzhi2): Tweak.
diff --git a/libgcc/config/avr/lib1funcs.S b/libgcc/config/avr/lib1funcs.S
index 04a4eb01ab4..d48b04747da 100644
--- a/libgcc/config/avr/lib1funcs.S
+++ b/libgcc/config/avr/lib1funcs.S
@@ -2921,11 +2921,9 @@ DEFUN __clzhi2
clr r26
tst r25
brne 1f
- subi r26, -8
or r25, r24
- brne 1f
- ldi r24, 16
- ret
+ breq 0f
+ subi r26, -8
1: cpi r25, 16
brsh 3f
subi r26, -3
@@ -2936,6 +2934,8 @@ DEFUN __clzhi2
mov r24, r26
clr r25
ret
+0: ldi r24, 16
+ ret
ENDF __clzhi2
#endif /* defined (L_clzhi2) */
reply other threads:[~2024-05-18 13:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b03c4ff-f133-44a3-9561-113e2c4545b6@gjlay.de \
--to=avr@gjlay.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).