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
This commit is contained in:
Jens Arnold 2006-08-09 14:17:09 +00:00
parent 91022738ee
commit f54c34eb0f
2 changed files with 4 additions and 6 deletions

View file

@ -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 */

View file

@ -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 */