From f54c34eb0f86a49b13b5c75fac64a68fc4769b10 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 9 Aug 2006 14:17:09 +0000 Subject: ARM targets: Shave off one instruction from the multiply-by-75. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10503 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/gray_core.c | 5 ++--- apps/plugins/lib/gray_draw.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/plugins/lib/gray_core.c b/apps/plugins/lib/gray_core.c index f08189dbc2..e65a7f259e 100644 --- a/apps/plugins/lib/gray_core.c +++ b/apps/plugins/lib/gray_core.c @@ -690,9 +690,8 @@ void gray_update_rect(int x, int y, int width, int height) "ldr r2, [%[bpat], r0, lsl #2] \n" /* r2 = bitpattern[byte]; */ - "add r0, %[rnd], %[rnd], lsl #3 \n" /* multiply by 75 */ - "add %[rnd], %[rnd], %[rnd], lsl #1 \n" - "add %[rnd], %[rnd], r0, lsl #3 \n" + "add %[rnd], %[rnd], %[rnd], lsl #2 \n" /* multiply by 75 */ + "rsb %[rnd], %[rnd], %[rnd], lsl #4 \n" "add %[rnd], %[rnd], #74 \n" /* add another 74 */ /* Since the lower bits are not very random: get bits 8..15 (need max. 5) */ "and r1, %[rmsk], %[rnd], lsr #8 \n" /* ..and mask out unneeded bits */ diff --git a/apps/plugins/lib/gray_draw.c b/apps/plugins/lib/gray_draw.c index 7df3e13c56..9406664ea2 100644 --- a/apps/plugins/lib/gray_draw.c +++ b/apps/plugins/lib/gray_draw.c @@ -898,9 +898,8 @@ static void _writearray(unsigned char *address, const unsigned char *src, "ldrb r0, [%[trns], r0] \n" /* idxtable into pattern index */ "ldr r2, [%[bpat], r0, lsl #2] \n" /* r2 = bitpattern[byte]; */ - "add r0, %[rnd], %[rnd], lsl #3 \n" /* multiply by 75 */ - "add %[rnd], %[rnd], %[rnd], lsl #1 \n" - "add %[rnd], %[rnd], r0, lsl #3 \n" + "add %[rnd], %[rnd], %[rnd], lsl #2 \n" /* multiply by 75 */ + "rsb %[rnd], %[rnd], %[rnd], lsl #4 \n" "add %[rnd], %[rnd], #74 \n" /* add another 74 */ /* Since the lower bits are not very random: get bits 8..15 (need max. 5) */ "and r1, %[rmsk], %[rnd], lsr #8 \n" /* ..and mask out unneeded bits */ -- cgit v1.2.3