aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config/avr
diff options
context:
space:
mode:
authorWolfgang Hospital <Wolfgang.Hospital@arcor.de>2024-05-18 15:02:51 +0200
committerGeorg-Johann Lay <avr@gjlay.de>2024-05-18 15:12:10 +0200
commit988838da722dea09bd81ee9d49800a6f24980372 (patch)
tree2c2ab3117e57544a325524aaefa22696638922cf /libgcc/config/avr
parent7422e050f33dd9ee7dcd5a72c80b4e11d61995ce (diff)
downloadgcc-988838da722dea09bd81ee9d49800a6f24980372.zip
gcc-988838da722dea09bd81ee9d49800a6f24980372.tar.gz
gcc-988838da722dea09bd81ee9d49800a6f24980372.tar.bz2
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.
Diffstat (limited to 'libgcc/config/avr')
-rw-r--r--libgcc/config/avr/lib1funcs.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgcc/config/avr/lib1funcs.S b/libgcc/config/avr/lib1funcs.S
index 04a4eb0..d48b047 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) */