summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2010-06-11 19:53:17 +0000
committerJens Arnold <amiconn@rockbox.org>2010-06-11 19:53:17 +0000
commitf053b0d6066291bf865a622bd4969cd782a2deee (patch)
treec36f373b2e9727d50937c608ddc27000ef9bd3de
parent3c95dbb20859debe99edc874c57ddaa6f3acf3d2 (diff)
downloadrockbox-f053b0d6066291bf865a622bd4969cd782a2deee.tar.gz
rockbox-f053b0d6066291bf865a622bd4969cd782a2deee.zip
Port greylib blitting optimisation to MPIO HD200. ISR speedup is ~10%; further speedup should be possible by using line transfers for accessing the greylib buffers. Thanks to Marcin Bukat for testing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26793 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S71
1 files changed, 31 insertions, 40 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
index 7ea0b8f921..9709e210e2 100644
--- a/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
+++ b/firmware/target/coldfire/mpio/hd200/lcd-as-hd200.S
@@ -125,54 +125,45 @@ lcd_mono_data:
125 .type lcd_grey_data,@function 125 .type lcd_grey_data,@function
126 126
127lcd_grey_data: 127lcd_grey_data:
128 lea.l (-2*4, %sp), %sp 128 lea.l (-6*4, %sp), %sp
129 movem.l %a2-%a3, (%sp) 129 movem.l %d2-%d5/%a2-%a3, (%sp)
130 movem.l (2*4+4, %sp), %a0-%a2 /* values, phases, length */ 130 movem.l (6*4+4, %sp), %a0-%a2 /* values, phases, length */
131 add.l %a2, %a2 131 add.l %a2, %a2
132 lea.l (%a1, %a2.l*4), %a2 /* end address */ 132 lea.l (%a1, %a2.l*4), %a2 /* end address */
133 lea.l LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */ 133 lea.l LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */
134 moveq.l #24, %d4 /* shift count */
135 move.l #0x204081, %d5 /* bit shuffle factor */
136
134.ph_loop: 137.ph_loop:
135 clr.l %d1 138 movem.l (%a1), %d0-%d1 /* fetch 8 pixel phases */
136 move.l (%a1), %d0 /* fetch 4 pixel phases */ 139
137 bclr.l #31, %d0 /* Z = !(p0 & 0x80); p0 &= ~0x80; */ 140 move.l %d0, %d2
138 seq.b %d1 /* %d1 = ........................00000000 */ 141 and.l #0x80808080, %d2 /* %d2 = 0.......1.......2.......3....... */
139 lsl.l #1, %d1 /* %d1 = .......................00000000. */ 142 eor.l %d2, %d0
140 bclr.l #23, %d0 /* Z = !(p1 & 0x80); p1 &= ~0x80; */ 143 add.l (%a0)+, %d0 /* add values to first 4 phases */
141 seq.b %d1 /* %d1 = .......................011111111 */ 144
142 lsl.l #1, %d1 /* %d1 = ......................011111111. */ 145 move.l %d1, %d3
143 bclr.l #15, %d0 /* Z = !(p2 & 0x80); p2 &= ~0x80; */ 146 and.l #0x80808080, %d3 /* %d3 = 4.......5.......6.......7....... */
144 seq.b %d1 /* %d1 = ......................0122222222 */ 147 eor.l %d3, %d1
145 lsl.l #1, %d1 /* %d1 = .....................0122222222. */ 148 add.l (%a0)+, %d1 /* add values to second 4 phases */
146 bclr.l #7, %d0 /* Z = !(p3 & 0x80); p3 &= ~0x80; */ 149
147 seq.b %d1 /* %d1 = .....................01233333333 */ 150 lsr.l #4, %d3 /* %d3 = ....4.......5.......6.......7... */
148 lsl.l #1, %d1 /* %d1 = ....................01233333333. */ 151 or.l %d3, %d2 /* %d2 = 0...4...1...5...2...6...3...7... */
149 add.l (%a0)+, %d0 /* add 4 pixel values to the phases */ 152 mulu.l %d5, %d2 /* %d2 = 01234567123.567.23..67..3...7... */
150 move.l %d0, (%a1)+ /* store new phases, advance pointer */ 153 not.l %d2 /* negate bits */
151 154 lsr.l %d4, %d2 /* %d2 = ........................01234567 */
152 move.l (%a1), %d0 /* fetch 4 pixel phases */ 155
153 bclr.l #31, %d0 /* Z = !(p0 & 0x80); p0 &= ~0x80; */ 156 move.w %d2, (%a3) /* transfer first LCD byte */
154 seq.b %d1 /* %d1 = ....................012344444444 */ 157
155 lsl.l #1, %d1 /* %d1 = ...................012344444444. */ 158 movem.l %d0-%d1, (%a1) /* store 8 new pixel phases */
156 bclr.l #23, %d0 /* Z = !(p1 & 0x80); p1 &= ~0x80; */ 159 addq.l #8, %a1
157 seq.b %d1 /* %d1 = ...................0123455555555 */
158 lsl.l #1, %d1 /* %d1 = ..................0123455555555. */
159 bclr.l #15, %d0 /* Z = !(p2 & 0x80); p2 &= ~0x80; */
160 seq.b %d1 /* %d1 = ..................01234566666666 */
161 lsl.l #1, %d1 /* %d1 = .................01234566666666. */
162 bclr.l #7, %d0 /* Z = !(p3 & 0x80); p3 &= ~0x80; */
163 seq.b %d1 /* %d1 = .................012345677777777 */
164 lsr.l #7, %d1 /* %d1 = ........................01234567 */
165 add.l (%a0)+, %d0 /* add 4 pixel values to the phases */
166 move.l %d0, (%a1)+ /* store new phases, advance pointer */
167
168 move.w %d1, (%a3) /* transfer to lcd */
169 move.w %d1, (%a3) /* transfer to lcd */
170 160
161 move.w %d2, (%a3) /* transfer second LCD byte */
171 cmp.l %a2, %a1 162 cmp.l %a2, %a1
172 bls.s .ph_loop 163 bls.s .ph_loop
173 164
174 movem.l (%sp), %a2-%a3 165 movem.l (%sp), %d2-%d5/%a2-%a3
175 lea.l (2*4, %sp), %sp 166 lea.l (6*4, %sp), %sp
176 rts 167 rts
177.grey_end: 168.grey_end:
178 .size lcd_grey_data,.grey_end-lcd_grey_data 169 .size lcd_grey_data,.grey_end-lcd_grey_data