diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-07-11 23:43:44 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-07-11 23:43:44 +0000 |
commit | 47d4c4739bafcb9864dc8d1c2b44903ad4f75b68 (patch) | |
tree | 7a9f510c72a0df2ddacb0f6ec393658cf676b8d4 /firmware/target/arm/ipod/video/lcd-as-video.S | |
parent | fa59ed6ae724b3f75c8ba35efcf7ce18f21e3ed2 (diff) | |
download | rockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.tar.gz rockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.zip |
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
Diffstat (limited to 'firmware/target/arm/ipod/video/lcd-as-video.S')
-rw-r--r-- | firmware/target/arm/ipod/video/lcd-as-video.S | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/firmware/target/arm/ipod/video/lcd-as-video.S b/firmware/target/arm/ipod/video/lcd-as-video.S index e14b9dafb8..4b0cabcec2 100644 --- a/firmware/target/arm/ipod/video/lcd-as-video.S +++ b/firmware/target/arm/ipod/video/lcd-as-video.S | |||
@@ -32,22 +32,22 @@ | |||
32 | .type lcd_write_data, %function | 32 | .type lcd_write_data, %function |
33 | /* r0 = addr, must be aligned */ | 33 | /* r0 = addr, must be aligned */ |
34 | lcd_write_data: /* r1 = pixel count, must be even */ | 34 | lcd_write_data: /* r1 = pixel count, must be even */ |
35 | stmfd sp!, {r4-r5, lr} | 35 | stmfd sp!, {r4, lr} |
36 | mov lr, #0x30000000 /* LCD data port */ | 36 | mov lr, #0x30000000 /* LCD data port */ |
37 | 37 | ||
38 | subs r1, r1, #16 | 38 | subs r1, r1, #16 |
39 | .loop16: | 39 | .loop16: |
40 | ldmgeia r0!, {r2-r5} | 40 | ldmgeia r0!, {r2-r4, r12} |
41 | stmgeia lr, {r2-r5} | 41 | stmgeia lr, {r2-r4, r12} |
42 | ldmgeia r0!, {r2-r5} | 42 | ldmgeia r0!, {r2-r4, r12} |
43 | stmgeia lr, {r2-r5} | 43 | stmgeia lr, {r2-r4, r12} |
44 | subges r1, r1, #16 | 44 | subges r1, r1, #16 |
45 | bge .loop16 | 45 | bge .loop16 |
46 | 46 | ||
47 | /* no need to correct the count, we're just checking bits from now */ | 47 | /* no need to correct the count, we're just checking bits from now */ |
48 | tst r1, #8 | 48 | tst r1, #8 |
49 | ldmneia r0!, {r2-r5} | 49 | ldmneia r0!, {r2-r4, r12} |
50 | stmneia lr, {r2-r5} | 50 | stmneia lr, {r2-r4, r12} |
51 | tst r1, #4 | 51 | tst r1, #4 |
52 | ldmneia r0!, {r2-r3} | 52 | ldmneia r0!, {r2-r3} |
53 | stmneia lr, {r2-r3} | 53 | stmneia lr, {r2-r3} |
@@ -55,7 +55,7 @@ lcd_write_data: /* r1 = pixel count, must be even */ | |||
55 | ldrne r3, [r0], #4 | 55 | ldrne r3, [r0], #4 |
56 | strne r3, [lr] | 56 | strne r3, [lr] |
57 | 57 | ||
58 | ldmfd sp!, {r4-r5, pc} | 58 | ldmfd sp!, {r4, pc} |
59 | 59 | ||
60 | /**************************************************************************** | 60 | /**************************************************************************** |
61 | * extern void lcd_write_yuv420_lines(unsigned char const * const src[3], | 61 | * extern void lcd_write_yuv420_lines(unsigned char const * const src[3], |
@@ -87,10 +87,10 @@ lcd_write_yuv420_lines: | |||
87 | /* r1 = dst = bcmaddr */ | 87 | /* r1 = dst = bcmaddr */ |
88 | /* r2 = width */ | 88 | /* r2 = width */ |
89 | /* r3 = stride */ | 89 | /* r3 = stride */ |
90 | stmfd sp!, { r4-r11, lr } /* save non-scratch */ | 90 | stmfd sp!, { r4-r10, lr } /* save non-scratch */ |
91 | ldmia r0, { r9-r11 } /* r9 = yuv_src[0] = Y'_p */ | 91 | ldmia r0, { r9, r10, r12 } /* r9 = yuv_src[0] = Y'_p */ |
92 | /* r10 = yuv_src[1] = Cb_p */ | 92 | /* r10 = yuv_src[1] = Cb_p */ |
93 | /* r11 = yuv_src[2] = Cr_p */ | 93 | /* r12 = yuv_src[2] = Cr_p */ |
94 | add r3, r9, r3 /* r3 = &ysrc[stride] */ | 94 | add r3, r9, r3 /* r3 = &ysrc[stride] */ |
95 | add r4, r2, r2, asr #1 /* chroma buffer lenght = width/2 *3 */ | 95 | add r4, r2, r2, asr #1 /* chroma buffer lenght = width/2 *3 */ |
96 | mov r4, r4, asl #2 /* use words for str/ldm possibility */ | 96 | mov r4, r4, asl #2 /* use words for str/ldm possibility */ |
@@ -116,7 +116,7 @@ lcd_write_yuv420_lines: | |||
116 | 10: /* loop start */ | 116 | 10: /* loop start */ |
117 | 117 | ||
118 | ldrb r0, [r10], #1 /* r0 = *usrc++ = *Cb_p++ */ | 118 | ldrb r0, [r10], #1 /* r0 = *usrc++ = *Cb_p++ */ |
119 | ldrb r1, [r11], #1 /* r1 = *vsrc++ = *Cr_p++ */ | 119 | ldrb r1, [r12], #1 /* r1 = *vsrc++ = *Cr_p++ */ |
120 | 120 | ||
121 | sub r0, r0, #128 /* r0 = Cb-128 */ | 121 | sub r0, r0, #128 /* r0 = Cb-128 */ |
122 | sub r1, r1, #128 /* r1 = Cr-128 */ | 122 | sub r1, r1, #128 /* r1 = Cr-128 */ |
@@ -289,7 +289,7 @@ lcd_write_yuv420_lines: | |||
289 | 289 | ||
290 | ldr r3, [sp, #12] | 290 | ldr r3, [sp, #12] |
291 | add sp, sp, r3 /* deallocate buffer */ | 291 | add sp, sp, r3 /* deallocate buffer */ |
292 | ldmfd sp!, { r4-r11, pc } /* restore registers */ | 292 | ldmfd sp!, { r4-r10, pc } /* restore registers */ |
293 | 293 | ||
294 | .ltorg | 294 | .ltorg |
295 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines | 295 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines |