summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-08-09 14:17:09 +0000
committerJens Arnold <amiconn@rockbox.org>2006-08-09 14:17:09 +0000
commitf54c34eb0f86a49b13b5c75fac64a68fc4769b10 (patch)
tree546bae3f1c617e036a85ee6bb05d40b4f9285ee3
parent91022738ee412fda01088fcef44d4eaee946513f (diff)
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
-rw-r--r--apps/plugins/lib/gray_core.c5
-rw-r--r--apps/plugins/lib/gray_draw.c5
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 */