From 5b8aca84dca69bad86c2f01811e91faad130ecae Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 5 Apr 2010 06:35:23 +0000 Subject: Fuzev2: don't reinvent the wheel: swap pixels with existing swap_odd_even32 It is equally fast and doesn't need an additional mask Thanks to amiconn for pointing to it git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25477 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c') diff --git a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c index 06a1b7f4dd..b337a14eac 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c @@ -144,23 +144,9 @@ static void dbop_write_data(const int16_t* p_bytes, int count) dbop_set_mode(32); data = (int32_t*)p_bytes; - const unsigned int mask = 0xff00ff; while (count > 1) { - 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; + DBOP_DOUT32 = swap_odd_even32(*data++); count -= 2; /* Wait if push fifo is full */ -- cgit v1.2.3