From 69186f6f8528d56499b32f86204d547db834b80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 5 Apr 2010 05:41:51 +0000 Subject: 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 --- firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'firmware') 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) * switch to 32bit output if needed */ dbop_set_mode(32); data = (int32_t*)p_bytes; + + const unsigned int mask = 0xff00ff; while (count > 1) { - int pixels = *data++; - pixels = (swap16(pixels >> 16) << 16) | (swap16(pixels & 0xffff)); + register unsigned int pixels = *data++; + register unsigned int tmp; + + /* pixels == ABCD */ + asm( + "and %[tmp], %[pixels], %[mask] \n" /* tmp = 0B0D */ + "and %[pixels], %[pixels], %[mask], lsl #8\n" /* %[pixels] = A0C0 */ + "mov %[pixels], %[pixels], lsr #8 \n" /* %[pixels] = 0A0C */ + "orr %[pixels], %[pixels], %[tmp], lsl #8 \n" /* %[pixels] = BADC */ + : [pixels]"+r"(pixels), [tmp]"=r"(tmp) /* output */ + : [mask]"r"(mask) /* input */ + ); + DBOP_DOUT32 = pixels; count -= 2; -- cgit v1.2.3