aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2002-07-08 12:56:32 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2002-07-08 12:56:32 +0000
commite47e6f0e3032d46ff2f3e4ffa7de2beb2bc9a60d (patch)
tree57476522919923f687c1bb151d211d1ada2c71e0 /newlib/libc
parent23c3a85872597c87dfeeb37f6ef42dab25406951 (diff)
downloadnewlib-e47e6f0e3032d46ff2f3e4ffa7de2beb2bc9a60d.zip
newlib-e47e6f0e3032d46ff2f3e4ffa7de2beb2bc9a60d.tar.gz
newlib-e47e6f0e3032d46ff2f3e4ffa7de2beb2bc9a60d.tar.bz2
Some small speedups.
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/machine/sh/strcmp.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/newlib/libc/machine/sh/strcmp.S b/newlib/libc/machine/sh/strcmp.S
index 850c82b..8dcc20b 100644
--- a/newlib/libc/machine/sh/strcmp.S
+++ b/newlib/libc/machine/sh/strcmp.S
@@ -55,14 +55,16 @@ ENTRY(strcmp)
pt loop,tr1
bnei/u r8,0,tr0 // r23_zero
pt found_zero,tr0
- ori r3,7,r3
- addi r3,9,r3
+ addi r3,15,r3
+ andi r3,-8,r3
sub r3,r2,r3
bne/l r7,r6,tr1 // loop
/* The strings are aligned to each other. */
+ /* It is possible to have a loop with six cycles / iteration
+ by re-ordering the exit conditions, but then it needs extra
+ time and/or code to sort out the r4 != r5 case. */
pt al_loop,tr1
pt al_found_zero,tr0
- addi r3,-8,r3
al_loop:
ld.q r2,8,r4
ldx.q r2,r3,r5
@@ -103,8 +105,8 @@ cmp_quad:
blink tr2,r63
found_zero:
pt zero_now,tr0
- mcmpeq.b r63,r5,r7
pt cmp_quad,tr1
+ SHHI r9,r20,r7
bne/u r8,r7,tr0 // zero_now
bne/u r4,r5,tr1 // cmp_quad
SHLO r9,r22,r8