summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-04-05 05:41:51 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-04-05 05:41:51 +0000
commit69186f6f8528d56499b32f86204d547db834b80c (patch)
tree8af2366c472d4b954c59f07c19d5b1efd4bb3d44
parent7a90aa40c605ec27f6743e2dd3bb55d46495601a (diff)
downloadrockbox-69186f6f8528d56499b32f86204d547db834b80c.tar.gz
rockbox-69186f6f8528d56499b32f86204d547db834b80c.zip
Fuzev2: write pixel swapping in assembly for a some speed up
Unboosted: 73 fps -> 87.5 fps git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25476 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
index 53d8f73904..06a1b7f4dd 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
@@ -143,10 +143,23 @@ static void dbop_write_data(const int16_t* p_bytes, int count)
143 * switch to 32bit output if needed */ 143 * switch to 32bit output if needed */
144 dbop_set_mode(32); 144 dbop_set_mode(32);
145 data = (int32_t*)p_bytes; 145 data = (int32_t*)p_bytes;
146
147 const unsigned int mask = 0xff00ff;
146 while (count > 1) 148 while (count > 1)
147 { 149 {
148 int pixels = *data++; 150 register unsigned int pixels = *data++;
149 pixels = (swap16(pixels >> 16) << 16) | (swap16(pixels & 0xffff)); 151 register unsigned int tmp;
152
153 /* pixels == ABCD */
154 asm(
155 "and %[tmp], %[pixels], %[mask] \n" /* tmp = 0B0D */
156 "and %[pixels], %[pixels], %[mask], lsl #8\n" /* %[pixels] = A0C0 */
157 "mov %[pixels], %[pixels], lsr #8 \n" /* %[pixels] = 0A0C */
158 "orr %[pixels], %[pixels], %[tmp], lsl #8 \n" /* %[pixels] = BADC */
159 : [pixels]"+r"(pixels), [tmp]"=r"(tmp) /* output */
160 : [mask]"r"(mask) /* input */
161 );
162
150 DBOP_DOUT32 = pixels; 163 DBOP_DOUT32 = pixels;
151 count -= 2; 164 count -= 2;
152 165