From 47d4c4739bafcb9864dc8d1c2b44903ad4f75b68 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 11 Jul 2009 23:43:44 +0000 Subject: ARM asm LCD and ATA driver functions: Don't save r12 as it is a scratch reg. Saves a bit of stack and execution time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21795 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/lcd-as-e200v2-fuze.S | 62 ++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'firmware/target/arm/as3525/lcd-as-e200v2-fuze.S') diff --git a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S index 254816cd0e..71d997d044 100644 --- a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S +++ b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S @@ -51,7 +51,7 @@ lcd_write_yuv420_lines: @ r0 = yuv_src @ r1 = width @ r2 = stride - stmfd sp!, { r4-r12 } @ save non-scratch + stmfd sp!, { r4-r10, lr } @ save non-scratch ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p @ r5 = yuv_src[1] = Cb_p @ r6 = yuv_src[2] = Cr_p @@ -76,9 +76,9 @@ lcd_write_yuv420_lines: add r10, r10, r8, asl #3 @ add r10, r10, r8, asl #4 @ @ - add r11, r9, r9, asl #2 @ r9 = Cr*101 - add r11, r11, r9, asl #5 @ - add r9, r11, r9, asl #6 @ + add lr, r9, r9, asl #2 @ r9 = Cr*101 + add lr, lr, r9, asl #5 @ + add r9, lr, r9, asl #6 @ @ add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 mov r8, r8, asr #2 @ @@ -88,19 +88,19 @@ lcd_write_yuv420_lines: mov r10, r10, asr #8 @ @ compute R, G, and B add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu - add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv + add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv @ - orr r12, r0, r11 @ check if clamping is needed... + orr r12, r0, lr @ check if clamping is needed... orr r12, r12, r7, asr #1 @ ...at all cmp r12, #31 @ bls 15f @ no clamp @ cmp r0, #31 @ clamp b mvnhi r0, r0, asr #31 @ andhi r0, r0, #31 @ - cmp r11, #31 @ clamp r - mvnhi r11, r11, asr #31 @ - andhi r11, r11, #31 @ + cmp lr, #31 @ clamp r + mvnhi lr, lr, asr #31 @ + andhi lr, lr, #31 @ cmp r7, #63 @ clamp g mvnhi r7, r7, asr #31 @ andhi r7, r7, #63 @ @@ -108,7 +108,7 @@ lcd_write_yuv420_lines: @ ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) @ - orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b + orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b strh r0, [r3, #0x10] @ write pixel 1: @ busy @ @@ -121,19 +121,19 @@ lcd_write_yuv420_lines: add r7, r12, r7, asl #5 @ @ compute R, G, and B add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu - add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv + add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv @ - orr r12, r0, r11 @ check if clamping is needed... + orr r12, r0, lr @ check if clamping is needed... orr r12, r12, r7, asr #1 @ ...at all cmp r12, #31 @ bls 15f @ no clamp @ cmp r0, #31 @ clamp b mvnhi r0, r0, asr #31 @ andhi r0, r0, #31 @ - cmp r11, #31 @ clamp r - mvnhi r11, r11, asr #31 @ - andhi r11, r11, #31 @ + cmp lr, #31 @ clamp r + mvnhi lr, lr, asr #31 @ + andhi lr, lr, #31 @ cmp r7, #63 @ clamp g mvnhi r7, r7, asr #31 @ andhi r7, r7, #63 @ @@ -141,7 +141,7 @@ lcd_write_yuv420_lines: @ ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) @ - orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b + orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b strh r0, [r3, #0x10] @ write pixel 1: @ busy @ @@ -154,19 +154,19 @@ lcd_write_yuv420_lines: add r7, r12, r7, asl #5 @ @ compute R, G, and B add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu - add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv + add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv @ - orr r12, r0, r11 @ check if clamping is needed... + orr r12, r0, lr @ check if clamping is needed... orr r12, r12, r7, asr #1 @ ...at all cmp r12, #31 @ bls 15f @ no clamp @ cmp r0, #31 @ clamp b mvnhi r0, r0, asr #31 @ andhi r0, r0, #31 @ - cmp r11, #31 @ clamp r - mvnhi r11, r11, asr #31 @ - andhi r11, r11, #31 @ + cmp lr, #31 @ clamp r + mvnhi lr, lr, asr #31 @ + andhi lr, lr, #31 @ cmp r7, #63 @ clamp g mvnhi r7, r7, asr #31 @ andhi r7, r7, #63 @ @@ -175,7 +175,7 @@ lcd_write_yuv420_lines: ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) @ @ - orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b + orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b strh r0, [r3, #0x10] @ write pixel 1: @ busy @ @@ -188,25 +188,25 @@ lcd_write_yuv420_lines: add r7, r12, r7, asl #5 @ @ compute R, G, and B add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu - add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv + add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv @ - orr r12, r0, r11 @ check if clamping is needed... + orr r12, r0, lr @ check if clamping is needed... orr r12, r12, r7, asr #1 @ ...at all cmp r12, #31 @ bls 15f @ no clamp @ cmp r0, #31 @ clamp b mvnhi r0, r0, asr #31 @ andhi r0, r0, #31 @ - cmp r11, #31 @ clamp r - mvnhi r11, r11, asr #31 @ - andhi r11, r11, #31 @ + cmp lr, #31 @ clamp r + mvnhi lr, lr, asr #31 @ + andhi lr, lr, #31 @ cmp r7, #63 @ clamp g mvnhi r7, r7, asr #31 @ andhi r7, r7, #63 @ 15: @ no clamp @ @ - orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b + orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b strh r0, [r3, #0x10] @ write pixel 1: @ busy @ @@ -217,7 +217,7 @@ lcd_write_yuv420_lines: subs r1, r1, #2 @ subtract block from width bgt 10b @ loop line @ @ - ldmfd sp!, { r4-r12 } @ restore registers and return + ldmfd sp!, { r4-r10, pc } @ restore registers and return bx lr @ .ltorg @ dump constant pool .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines @@ -258,7 +258,7 @@ lcd_write_yuv420_lines_odither: @ r2 = stride @ r3 = x_screen @ [sp] = y_screen - stmfd sp!, { r4-r12, lr } @ save non-scratch + stmfd sp!, { r4-r11, lr } @ save non-scratch ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p @ r5 = yuv_src[1] = Cb_p @ r6 = yuv_src[2] = Cr_p @@ -496,6 +496,6 @@ lcd_write_yuv420_lines_odither: subs r1, r1, #2 @ subtract block from width bgt 10b @ loop line @ @ - ldmfd sp!, { r4-r12, pc } @ restore registers and return + ldmfd sp!, { r4-r11, pc } @ restore registers and return .ltorg @ dump constant pool .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither -- cgit v1.2.3