summaryrefslogtreecommitdiff
path: root/firmware/decompressor
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-10-29 07:14:37 +0000
committerJens Arnold <amiconn@rockbox.org>2008-10-29 07:14:37 +0000
commit9ae256186282db0ed0e5491c925f92e61591f396 (patch)
tree6dd3d9bb4f521f6b449ea4aa374b598d756bae7c /firmware/decompressor
parent2d4eacb9ec06e636519f6065c78c8f481b587f94 (diff)
downloadrockbox-9ae256186282db0ed0e5491c925f92e61591f396.tar.gz
rockbox-9ae256186282db0ed0e5491c925f92e61591f396.zip
Save another 4 bytes without sacrificing performance by subroutine rearrangement.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18916 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/decompressor')
-rw-r--r--firmware/decompressor/sh_nrv2e_d8.S20
1 files changed, 9 insertions, 11 deletions
diff --git a/firmware/decompressor/sh_nrv2e_d8.S b/firmware/decompressor/sh_nrv2e_d8.S
index c002911c0c..167251d595 100644
--- a/firmware/decompressor/sh_nrv2e_d8.S
+++ b/firmware/decompressor/sh_nrv2e_d8.S
@@ -81,15 +81,6 @@ eof_n2e:
81 rts 81 rts
82 mov src, r0 82 mov src, r0
83 83
84 .align 2
85get1_n2e: ! in: T bit set
86 mov.b @src+, bits ! SH1 sign-extends on load
87 rotcl bits ! LSB = T, T = MSB
88 shll16 bits
89 rts
90 shll8 bits
91
92 .align 2
93lit_n2e: 84lit_n2e:
94 mov.b @src, tmp 85 mov.b @src, tmp
95 add #1, src ! Need to fill the pipeline latency anyway 86 add #1, src ! Need to fill the pipeline latency anyway
@@ -135,6 +126,13 @@ len_n2e:
135 bra gotlen_n2e 126 bra gotlen_n2e
136 add #6-2, len 127 add #6-2, len
137 128
129get1_n2e: ! in: T bit set
130 mov.b @src+, bits ! SH1 sign-extends on load
131 rotcl bits ! LSB = T, T = MSB
132 shll16 bits
133 rts
134 shll8 bits
135
138lenlast_n2e: 136lenlast_n2e:
139 getnextb(len) ! 0,1,2,3 137 getnextb(len) ! 0,1,2,3
140 add #2, len 138 add #2, len
@@ -143,11 +141,11 @@ gotlen_n2e:
143 movt tmp ! too far away, so minimum match length is 3 141 movt tmp ! too far away, so minimum match length is 3
144 add tmp, len 142 add tmp, len
145copy_n2e: 143copy_n2e:
146 add #-1, len
147 mov.b @(off,dst), tmp 144 mov.b @(off,dst), tmp
148 tst len, len 145 add #-1, len
149 mov.b tmp, @dst 146 mov.b tmp, @dst
150 add #1, dst 147 add #1, dst
148 tst len, len
151 bf copy_n2e 149 bf copy_n2e
152 bra top_n2e 150 bra top_n2e
153 nop 151 nop