summaryrefslogtreecommitdiff
path: root/firmware/decompressor
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-11-01 23:41:23 +0000
committerJens Arnold <amiconn@rockbox.org>2008-11-01 23:41:23 +0000
commit66f496cb88758313c8a6ab3675a7592b185cc10d (patch)
tree71b30f4278fd6f87e8508de11aca01f50db829b7 /firmware/decompressor
parenta85e2cd991ce987d5a83504053800575c7ad7e60 (diff)
downloadrockbox-66f496cb88758313c8a6ab3675a7592b185cc10d.tar.gz
rockbox-66f496cb88758313c8a6ab3675a7592b185cc10d.zip
Shave off another 4 instructions (8 bytes).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18970 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/decompressor')
-rw-r--r--firmware/decompressor/sh_nrv2e_d8.S26
1 files changed, 11 insertions, 15 deletions
diff --git a/firmware/decompressor/sh_nrv2e_d8.S b/firmware/decompressor/sh_nrv2e_d8.S
index 167251d595..6a050834a9 100644
--- a/firmware/decompressor/sh_nrv2e_d8.S
+++ b/firmware/decompressor/sh_nrv2e_d8.S
@@ -98,10 +98,9 @@ getoff_n2e:
98 getnextb(cnt) 98 getnextb(cnt)
99 jnextb0 off_n2e 99 jnextb0 off_n2e
100 100
101 mov cnt, tmp 101 mov #-4, tmp ! T=1 on entry, so this does
102 addc cnt, tmp ! tmp = cnt - 3, T = (cnt >= 3)
102 mov #0, len ! cnt and len share a reg! 103 mov #0, len ! cnt and len share a reg!
103 add #-3, tmp
104 cmp/pz tmp
105 bf offprev_n2e ! cnt was 2 104 bf offprev_n2e ! cnt was 2
106 mov.b @src+, off ! low 7+1 bits 105 mov.b @src+, off ! low 7+1 bits
107 shll8 tmp 106 shll8 tmp
@@ -112,19 +111,18 @@ getoff_n2e:
112 bt eof_n2e 111 bt eof_n2e
113 shar off 112 shar off
114 bt lenlast_n2e 113 bt lenlast_n2e
115 bra lenmore_n2e 114 bf lenmore_n2e ! always taken if the preceding bt isn't
116 mov #1, len
117 115
118offprev_n2e: 116offprev_n2e:
119 jnextb1 lenlast_n2e 117 jnextb1 lenlast_n2e
120 mov #1, len
121lenmore_n2e: 118lenmore_n2e:
119 mov #1, len
122 jnextb1 lenlast_n2e 120 jnextb1 lenlast_n2e
123len_n2e: 121len_n2e:
124 getnextb(len) 122 getnextb(len)
125 jnextb0 len_n2e 123 jnextb0 len_n2e
126 bra gotlen_n2e 124 bra gotlen_n2e
127 add #6-2, len 125 mov #6-2, tmp
128 126
129get1_n2e: ! in: T bit set 127get1_n2e: ! in: T bit set
130 mov.b @src+, bits ! SH1 sign-extends on load 128 mov.b @src+, bits ! SH1 sign-extends on load
@@ -135,19 +133,17 @@ get1_n2e: ! in: T bit set
135 133
136lenlast_n2e: 134lenlast_n2e:
137 getnextb(len) ! 0,1,2,3 135 getnextb(len) ! 0,1,2,3
138 add #2, len 136 mov #2, tmp
139gotlen_n2e: 137gotlen_n2e:
140 cmp/gt off, wrnk 138 cmp/gt off, wrnk ! too far away, so minimum match length is 3
141 movt tmp ! too far away, so minimum match length is 3 139 addc tmp, len
142 add tmp, len
143copy_n2e: 140copy_n2e:
144 mov.b @(off,dst), tmp
145 add #-1, len 141 add #-1, len
142 mov.b @(off,dst), tmp
143 tst len, len
146 mov.b tmp, @dst 144 mov.b tmp, @dst
147 add #1, dst 145 add #1, dst
148 tst len, len
149 bf copy_n2e 146 bf copy_n2e
150 bra top_n2e 147 bt top_n2e ! always taken if the preceding bf isn't
151 nop
152 148
153 .size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8 149 .size ucl_nrv2e_decompress_8, .-ucl_nrv2e_decompress_8