summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-07-11 23:43:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-07-11 23:43:44 +0000
commit47d4c4739bafcb9864dc8d1c2b44903ad4f75b68 (patch)
tree7a9f510c72a0df2ddacb0f6ec393658cf676b8d4 /firmware/target/arm
parentfa59ed6ae724b3f75c8ba35efcf7ce18f21e3ed2 (diff)
downloadrockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.tar.gz
rockbox-47d4c4739bafcb9864dc8d1c2b44903ad4f75b68.tar.bz2
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')
-rw-r--r--firmware/target/arm/as3525/lcd-as-e200v2-fuze.S62
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S16
-rw-r--r--firmware/target/arm/ata-as-arm.S64
-rw-r--r--firmware/target/arm/ipod/lcd-as-gray.S71
-rw-r--r--firmware/target/arm/ipod/video/lcd-as-video.S26
-rw-r--r--firmware/target/arm/iriver/h10/lcd-as-h10.S8
-rw-r--r--firmware/target/arm/lcd-as-memframe.S67
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S29
-rw-r--r--firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S8
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-as-yh820.S79
-rw-r--r--firmware/target/arm/samsung/yh925/lcd-as-yh925.S8
-rw-r--r--firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S79
12 files changed, 256 insertions, 261 deletions
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
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
index ed430178b9..5a52eb032c 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S
@@ -39,15 +39,15 @@
* r3/r4 - current block of phases
* r5/r6 - current block of values
* r7 - lcd data accumulator
- * r8 - phase signs mask
+ * r12 - phase signs mask
* lr - lcd bridge address
*/
lcd_grey_data:
- stmfd sp!, {r4-r8, lr}
- mov r8, #0x80
- orr r8, r8, r8, lsl #8
- orr r8, r8, r8, lsl #16
+ stmfd sp!, {r4-r7, lr}
+ mov r12, #0x80
+ orr r12, r12, r12, lsl #8
+ orr r12, r12, r12, lsl #16
ldr lr, =GPIOA_BASE
mov r3, #(1<<5)
@@ -70,7 +70,7 @@ lcd_grey_data:
orrne r7, r7, #0x2000
tst r3, #0x80000000
orrne r7, r7, #0x1000
- bic r3, r3, r8
+ bic r3, r3, r12
add r3, r3, r5
/* set bits 3..0 */
@@ -82,7 +82,7 @@ lcd_grey_data:
orrne r7, r7, #0x02
tst r4, #0x80000000
orrne r7, r7, #0x01
- bic r4, r4, r8
+ bic r4, r4, r12
add r4, r4, r6
stmia r1!, {r3-r4}
@@ -102,5 +102,5 @@ lcd_grey_data:
ands r5, r5, #(1<<10) @ wait until push fifo empties
beq 1b
- ldmfd sp!, {r4-r8, pc}
+ ldmfd sp!, {r4-r7, pc}
.size lcd_grey_data,.-lcd_grey_data
diff --git a/firmware/target/arm/ata-as-arm.S b/firmware/target/arm/ata-as-arm.S
index 31b753c421..c1475c0a5a 100644
--- a/firmware/target/arm/ata-as-arm.S
+++ b/firmware/target/arm/ata-as-arm.S
@@ -56,11 +56,11 @@
* r0 - current address
* r1 - word count
* r2 - ata port
- * r3..r6, lr - read buffers
+ * r3..r5, r12, lr - read buffers
*/
copy_read_sectors:
- stmfd sp!, {r4, r5, r6, lr}
+ stmfd sp!, {r4, r5, lr}
ldr r2, =.ata_port
tst r0, #1 /* 16 bit aligned? */
beq .r_aligned
@@ -92,16 +92,16 @@ copy_read_sectors:
ldrh r5, [r2]
orr r4, r4, r5, lsl #24
mov r5, r5, lsr #8
- ldrh r6, [r2]
- orr r5, r5, r6, lsl #8
- ldrh r6, [r2]
- orr r5, r5, r6, lsl #24
- mov r6, r6, lsr #8
+ ldrh r12, [r2]
+ orr r5, r5, r12, lsl #8
+ ldrh r12, [r2]
+ orr r5, r5, r12, lsl #24
+ mov r12, r12, lsr #8
ldrh lr, [r2]
- orr r6, r6, lr, lsl #8
+ orr r12, r12, lr, lsl #8
ldrh lr, [r2]
- orr r6, r6, lr, lsl #24
- stmia r0!, {r3, r4, r5, r6}
+ orr r12, r12, lr, lsl #24
+ stmia r0!, {r3, r4, r5, r12}
mov r3, lr, lsr #8
subs r1, r1, #8 /* 8 or more halfwords left? */
bge .r_loop_u
@@ -140,7 +140,7 @@ copy_read_sectors:
strb r3, [r0], #1 /* store final byte */
- ldmfd sp!, {r4, r5, r6, pc}
+ ldmfd sp!, {r4, r5, pc}
/* 16-bit aligned */
.r_aligned:
@@ -158,12 +158,12 @@ copy_read_sectors:
ldrh r5, [r2]
orr r4, r4, r5, lsl #16
ldrh r5, [r2]
- ldrh r6, [r2]
- orr r5, r5, r6, lsl #16
- ldrh r6, [r2]
+ ldrh r12, [r2]
+ orr r5, r5, r12, lsl #16
+ ldrh r12, [r2]
ldrh lr, [r2]
- orr r6, r6, lr, lsl #16
- stmia r0!, {r3, r4, r5, r6}
+ orr r12, r12, lr, lsl #16
+ stmia r0!, {r3, r4, r5, r12}
subs r1, r1, #8 /* 8 or more halfwords left? */
bge .r_loop_a
@@ -189,7 +189,7 @@ copy_read_sectors:
ldrneh r3, [r2]
strneh r3, [r0], #2
- ldmfd sp!, {r4, r5, r6, pc}
+ ldmfd sp!, {r4, r5, pc}
.r_end:
.size copy_read_sectors,.r_end-copy_read_sectors
@@ -210,11 +210,11 @@ copy_read_sectors:
* r0 - current address
* r1 - word count
* r2 - ata port
- * r3..r6, lr - read buffers
+ * r3..r5, r12, lr - read buffers
*/
copy_write_sectors:
- stmfd sp!, {r4, r5, r6, lr}
+ stmfd sp!, {r4, r5, lr}
ldr r2, =.ata_port
tst r0, #1 /* 16 bit aligned? */
beq .w_aligned
@@ -234,7 +234,7 @@ copy_write_sectors:
sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
.w_loop_u:
- ldmia r0!, {r4, r5, r6, lr}
+ ldmia r0!, {r4, r5, r12, lr}
orr r3, r3, r4, lsl #8 /* Load 4 words at once and decompose them */
strh r3, [r2] /* into 8 halfwords in a way that the words */
mov r3, r3, lsr #16 /* are shifted by 8 bits, putting the high */
@@ -245,15 +245,15 @@ copy_write_sectors:
mov r4, r4, lsr #16
strh r4, [r2]
mov r5, r5, lsr #24
- orr r5, r5, r6, lsl #8
+ orr r5, r5, r12, lsl #8
strh r5, [r2]
mov r5, r5, lsr #16
strh r5, [r2]
- mov r6, r6, lsr #24
- orr r6, r6, lr, lsl #8
- strh r6, [r2]
- mov r6, r6, lsr #16
- strh r6, [r2]
+ mov r12, r12, lsr #24
+ orr r12, r12, lr, lsl #8
+ strh r12, [r2]
+ mov r12, r12, lsr #16
+ strh r12, [r2]
mov r3, lr, lsr #24
subs r1, r1, #8 /* 8 or more halfwords left? */
bge .w_loop_u
@@ -294,7 +294,7 @@ copy_write_sectors:
orr r3, r3, r4, lsl #8
strh r3, [r2] /* write final halfword */
- ldmfd sp!, {r4, r5, r6, pc}
+ ldmfd sp!, {r4, r5, pc}
/* 16-bit aligned */
.w_aligned:
@@ -305,7 +305,7 @@ copy_write_sectors:
sub r1, r1, #8 /* adjust for zero-check and doing 8 halfwords/loop */
.w_loop_a:
- ldmia r0!, {r3, r4, r5, r6}
+ ldmia r0!, {r3, r4, r5, r12}
strh r3, [r2] /* Load 4 words and decompose them into */
mov r3, r3, lsr #16 /* 2 halfwords each, and write those. */
strh r3, [r2]
@@ -315,9 +315,9 @@ copy_write_sectors:
strh r5, [r2]
mov r5, r5, lsr #16
strh r5, [r2]
- strh r6, [r2]
- mov r6, r6, lsr #16
- strh r6, [r2]
+ strh r12, [r2]
+ mov r12, r12, lsr #16
+ strh r12, [r2]
subs r1, r1, #8 /* 8 or more halfwords left? */
bge .w_loop_a
@@ -343,7 +343,7 @@ copy_write_sectors:
ldrneh r3, [r0], #2
strneh r3, [r2]
- ldmfd sp!, {r4, r5, r6, pc}
+ ldmfd sp!, {r4, r5, pc}
.w_end:
.size copy_write_sectors,.w_end-copy_write_sectors
diff --git a/firmware/target/arm/ipod/lcd-as-gray.S b/firmware/target/arm/ipod/lcd-as-gray.S
index a066e55a05..b6878a1a78 100644
--- a/firmware/target/arm/ipod/lcd-as-gray.S
+++ b/firmware/target/arm/ipod/lcd-as-gray.S
@@ -34,8 +34,7 @@
.type lcd_write_data,%function
lcd_write_data:
- str lr, [sp, #-4]!
- ldr lr, =LCD1_BASE
+ ldr r12, =LCD1_BASE
.loop:
ldrb r2, [r0], #1
@@ -45,29 +44,29 @@ lcd_write_data:
orr r2, r3, r2, lsl #8
orr r2, r2, #0x760000
1:
- ldr r3, [lr]
+ ldr r3, [r12]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r2, [lr, #0x08]
+ str r2, [r12, #0x08]
#else
1:
- ldr r3, [lr]
+ ldr r3, [r12]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r2, [lr, #0x10]
+ str r2, [r12, #0x10]
ldrb r2, [r0], #1
1:
- ldr r3, [lr]
+ ldr r3, [r12]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r2, [lr, #0x10]
+ str r2, [r12, #0x10]
#endif
subs r1, r1, #1
bne .loop
- ldr pc, [sp], #4
+ bx lr
.size lcd_write_data,.-lcd_write_data
@@ -77,9 +76,9 @@ lcd_write_data:
.type lcd_write_data_shifted,%function
lcd_write_data_shifted:
- stmfd sp!, {r4, r5, lr}
+ stmfd sp!, {r4, lr}
ldr lr, =LCD1_BASE
- mov r5, #0x760000
+ mov r12, #0x760000
ldrb r2, [r0], #1
.sloop:
@@ -88,7 +87,7 @@ lcd_write_data_shifted:
ldrb r3, [r0], #1
orr r2, r3, r2, lsl #8
mov r4, r2, lsl #12
- orr r4, r5, r4, lsr #16
+ orr r4, r12, r4, lsr #16
1:
ldr r3, [lr]
tst r3, #LCD1_BUSY_MASK
@@ -98,7 +97,7 @@ lcd_write_data_shifted:
subs r1, r1, #1
bne .sloop
- ldmfd sp!, {r4, r5, pc}
+ ldmfd sp!, {r4, pc}
.size lcd_write_data_shifted,.-lcd_write_data_shifted
#elif defined IPOD_MINI
@@ -107,33 +106,33 @@ lcd_write_data_shifted:
.type lcd_write_data_shifted,%function
lcd_write_data_shifted:
- stmfd sp!, {r4, lr}
+ str lr, [sp, #-4]!
ldr lr, =LCD1_BASE
ldrb r2, [r0], #1
.sloop:
ldrb r3, [r0], #1
orr r2, r3, r2, lsl #8
- mov r4, r2, lsr #4
+ mov r12, r2, lsr #4
1:
ldr r3, [lr]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r4, [lr, #0x10]
+ str r12, [lr, #0x10]
ldrb r3, [r0], #1
orr r2, r3, r2, lsl #8
- mov r4, r2, lsr #4
+ mov r12, r2, lsr #4
1:
ldr r3, [lr]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r4, [lr, #0x10]
+ str r12, [lr, #0x10]
subs r1, r1, #1
bne .sloop
- ldmfd sp!, {r4, pc}
+ ldr pc, [sp], #4
.size lcd_write_data_shifted,.-lcd_write_data_shifted
#endif
@@ -142,18 +141,18 @@ lcd_write_data_shifted:
.type lcd_mono_data,%function
lcd_mono_data:
- stmfd sp!, {r4, r5, lr}
+ stmfd sp!, {r4, lr}
ldr lr, =LCD1_BASE
- adr r5, .dibits
+ adr r12, .dibits
.mloop:
ldrb r2, [r0], #1
mov r3, r2, lsr #4
- ldrb r4, [r5, r3]
+ ldrb r4, [r12, r3]
#ifdef IPOD_MINI2G
and r3, r2, #0x0f
- ldrb r3, [r5, r3]
+ ldrb r3, [r12, r3]
orr r4, r3, r4, lsl #8
orr r4, r4, #0x760000
1:
@@ -169,7 +168,7 @@ lcd_mono_data:
str r4, [lr, #0x10]
and r3, r2, #0x0f
- ldrb r4, [r5, r3]
+ ldrb r4, [r12, r3]
1:
ldr r3, [lr]
tst r3, #LCD1_BUSY_MASK
@@ -180,7 +179,7 @@ lcd_mono_data:
subs r1, r1, #1
bne .mloop
- ldmfd sp!, {r4, r5, pc}
+ ldmfd sp!, {r4, pc}
.dibits:
.byte 0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F
@@ -203,16 +202,16 @@ lcd_mono_data:
* Register usage:
* r3/r4 - current block of phases
* r5/r6 - current block of values
- * r7 - lcd data accumulator
- * r8 - phase signs mask
- * lr - lcd bridge address
+ * r7 - lcd data accumulator
+ * r12 - phase signs mask
+ * lr - lcd bridge address
*/
lcd_grey_data:
- stmfd sp!, {r4-r8, lr}
- mov r8, #0x80
- orr r8, r8, r8, lsl #8
- orr r8, r8, r8, lsl #16
+ stmfd sp!, {r4-r7, lr}
+ mov r12, #0x80
+ orr r12, r12, r12, lsl #8
+ orr r12, r12, r12, lsl #16
ldr lr, =LCD1_BASE
.greyloop:
@@ -229,7 +228,7 @@ lcd_grey_data:
orreq r7, r7, #0x0c00
tst r3, #0x80000000
orreq r7, r7, #0x0300
- bic r3, r3, r8
+ bic r3, r3, r12
add r3, r3, r5
#else /* Parallel bridge mode */
mov r7, #0
@@ -241,7 +240,7 @@ lcd_grey_data:
orreq r7, r7, #0x0c
tst r3, #0x80000000
orreq r7, r7, #0x03
- bic r3, r3, r8
+ bic r3, r3, r12
add r3, r3, r5
1:
@@ -261,7 +260,7 @@ lcd_grey_data:
orreq r7, r7, #0x0c
tst r4, #0x80000000
orreq r7, r7, #0x03
- bic r4, r4, r8
+ bic r4, r4, r12
add r4, r4, r6
stmia r1!, {r3-r4}
@@ -279,6 +278,6 @@ lcd_grey_data:
subs r2, r2, #1
bne .greyloop
- ldmfd sp!, {r4-r8, pc}
+ ldmfd sp!, {r4-r7, pc}
.size lcd_grey_data,.-lcd_grey_data
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 @@
.type lcd_write_data, %function
/* r0 = addr, must be aligned */
lcd_write_data: /* r1 = pixel count, must be even */
- stmfd sp!, {r4-r5, lr}
+ stmfd sp!, {r4, lr}
mov lr, #0x30000000 /* LCD data port */
subs r1, r1, #16
.loop16:
- ldmgeia r0!, {r2-r5}
- stmgeia lr, {r2-r5}
- ldmgeia r0!, {r2-r5}
- stmgeia lr, {r2-r5}
+ ldmgeia r0!, {r2-r4, r12}
+ stmgeia lr, {r2-r4, r12}
+ ldmgeia r0!, {r2-r4, r12}
+ stmgeia lr, {r2-r4, r12}
subges r1, r1, #16
bge .loop16
/* no need to correct the count, we're just checking bits from now */
tst r1, #8
- ldmneia r0!, {r2-r5}
- stmneia lr, {r2-r5}
+ ldmneia r0!, {r2-r4, r12}
+ stmneia lr, {r2-r4, r12}
tst r1, #4
ldmneia r0!, {r2-r3}
stmneia lr, {r2-r3}
@@ -55,7 +55,7 @@ lcd_write_data: /* r1 = pixel count, must be even */
ldrne r3, [r0], #4
strne r3, [lr]
- ldmfd sp!, {r4-r5, pc}
+ ldmfd sp!, {r4, pc}
/****************************************************************************
* extern void lcd_write_yuv420_lines(unsigned char const * const src[3],
@@ -87,10 +87,10 @@ lcd_write_yuv420_lines:
/* r1 = dst = bcmaddr */
/* r2 = width */
/* r3 = stride */
- stmfd sp!, { r4-r11, lr } /* save non-scratch */
- ldmia r0, { r9-r11 } /* r9 = yuv_src[0] = Y'_p */
+ stmfd sp!, { r4-r10, lr } /* save non-scratch */
+ ldmia r0, { r9, r10, r12 } /* r9 = yuv_src[0] = Y'_p */
/* r10 = yuv_src[1] = Cb_p */
- /* r11 = yuv_src[2] = Cr_p */
+ /* r12 = yuv_src[2] = Cr_p */
add r3, r9, r3 /* r3 = &ysrc[stride] */
add r4, r2, r2, asr #1 /* chroma buffer lenght = width/2 *3 */
mov r4, r4, asl #2 /* use words for str/ldm possibility */
@@ -116,7 +116,7 @@ lcd_write_yuv420_lines:
10: /* loop start */
ldrb r0, [r10], #1 /* r0 = *usrc++ = *Cb_p++ */
- ldrb r1, [r11], #1 /* r1 = *vsrc++ = *Cr_p++ */
+ ldrb r1, [r12], #1 /* r1 = *vsrc++ = *Cr_p++ */
sub r0, r0, #128 /* r0 = Cb-128 */
sub r1, r1, #128 /* r1 = Cr-128 */
@@ -289,7 +289,7 @@ lcd_write_yuv420_lines:
ldr r3, [sp, #12]
add sp, sp, r3 /* deallocate buffer */
- ldmfd sp!, { r4-r11, pc } /* restore registers */
+ ldmfd sp!, { r4-r10, pc } /* restore registers */
.ltorg
.size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
diff --git a/firmware/target/arm/iriver/h10/lcd-as-h10.S b/firmware/target/arm/iriver/h10/lcd-as-h10.S
index ba6c876d44..e99eee50c9 100644
--- a/firmware/target/arm/iriver/h10/lcd-as-h10.S
+++ b/firmware/target/arm/iriver/h10/lcd-as-h10.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
@ r0 = yuv_src
@ r1 = width
@ r2 = stride
- 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
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
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, .-lcd_write_yuv420_lines
@@ -273,7 +273,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
@@ -533,6 +533,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
diff --git a/firmware/target/arm/lcd-as-memframe.S b/firmware/target/arm/lcd-as-memframe.S
index 84f549036f..2d0aff937f 100644
--- a/firmware/target/arm/lcd-as-memframe.S
+++ b/firmware/target/arm/lcd-as-memframe.S
@@ -37,7 +37,7 @@
@ r2 = width
@ r3 = height
lcd_copy_buffer_rect: @
- stmfd sp!, { r4-r12, lr } @ save non-scratch regs
+ stmfd sp!, { r4-r11, lr } @ save non-scratch regs
mov r5, r2 @ r5 = cached width
rsb r4, r2, #LCD_WIDTH @ r4 = LCD_WIDTH - width
10: @ copy line @
@@ -101,7 +101,7 @@ lcd_copy_buffer_rect: @
add r0, r0, r4, lsl #1 @
subs r3, r3, #1 @ next line
bgt 10b @ copy line @
- ldmfd sp!, { r4-r12, pc } @ restore regs and return
+ ldmfd sp!, { r4-r11, pc } @ restore regs and return
.ltorg @ dump constant pool
.size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect
@@ -132,7 +132,7 @@ lcd_write_yuv420_lines:
@ r1 = yuv_src
@ r2 = width
@ r3 = stride
- stmfd sp!, { r4-r12 } @ save non-scratch
+ stmfd sp!, { r4-r10, lr } @ save non-scratch
ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
@ r5 = yuv_src[1] = Cb_p
@ r6 = yuv_src[2] = Cr_p
@@ -155,9 +155,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 @
@@ -167,19 +167,19 @@ lcd_write_yuv420_lines:
mov r10, r10, asr #8 @
@ compute R, G, and B
add r1, r8, r7, asr #8 @ r1 = 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, r1, r11 @ check if clamping is needed...
+ orr r12, r1, lr @ check if clamping is needed...
orr r12, r12, r7, asr #1 @ ...at all
cmp r12, #31 @
bls 15f @ no clamp @
cmp r1, #31 @ clamp b
mvnhi r1, r1, asr #31 @
andhi r1, r1, #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 @
@@ -188,7 +188,7 @@ lcd_write_yuv420_lines:
ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride)
@
orr r1, r1, r7, lsl #5 @ r4 |= (g << 5)
- orr r1, r1, r11, lsl #11 @ r4 = b | (r << 11)
+ orr r1, r1, lr, lsl #11 @ r4 = b | (r << 11)
#if LCD_WIDTH >= LCD_HEIGHT
strh r1, [r0] @
@@ -203,19 +203,19 @@ lcd_write_yuv420_lines:
add r7, r12, r7, asl #5 @
@ compute R, G, and B
add r1, r8, r7, asr #8 @ r1 = 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, r1, r11 @ check if clamping is needed...
+ orr r12, r1, lr @ check if clamping is needed...
orr r12, r12, r7, asr #1 @ ...at all
cmp r12, #31 @
bls 15f @ no clamp @
cmp r1, #31 @ clamp b
mvnhi r1, r1, asr #31 @
andhi r1, r1, #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 @
@@ -223,7 +223,7 @@ lcd_write_yuv420_lines:
@
ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
@
- orr r1, r1, r11, lsl #11 @ r1 = b | (r << 11)
+ orr r1, r1, lr, lsl #11 @ r1 = b | (r << 11)
orr r1, r1, r7, lsl #5 @ r1 |= (g << 5)
#if LCD_WIDTH >= LCD_HEIGHT
@@ -242,19 +242,19 @@ lcd_write_yuv420_lines:
add r7, r12, r7, asl #5 @
@ compute R, G, and B
add r1, r8, r7, asr #8 @ r1 = 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, r1, r11 @ check if clamping is needed...
+ orr r12, r1, lr @ check if clamping is needed...
orr r12, r12, r7, asr #1 @ ...at all
cmp r12, #31 @
bls 15f @ no clamp @
cmp r1, #31 @ clamp b
mvnhi r1, r1, asr #31 @
andhi r1, r1, #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 @
@@ -263,7 +263,7 @@ lcd_write_yuv420_lines:
ldrb r12, [r4, r3] @ r12 = Y' = *(Y'_p + stride)
@
orr r1, r1, r7, lsl #5 @ r1 = b | (g << 5)
- orr r1, r1, r11, lsl #11 @ r1 |= (r << 11)
+ orr r1, r1, lr, lsl #11 @ r1 |= (r << 11)
#if LCD_WIDTH >= LCD_HEIGHT
strh r1, [r0, #2]
@@ -278,25 +278,25 @@ lcd_write_yuv420_lines:
add r7, r12, r7, asl #5 @
@ compute R, G, and B
add r1, r8, r7, asr #8 @ r1 = 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, r1, r11 @ check if clamping is needed...
+ orr r12, r1, lr @ check if clamping is needed...
orr r12, r12, r7, asr #1 @ ...at all
cmp r12, #31 @
bls 15f @ no clamp @
cmp r1, #31 @ clamp b
mvnhi r1, r1, asr #31 @
andhi r1, r1, #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 r12, r1, r11, lsl #11 @ r12 = b | (r << 11)
+ orr r12, r1, lr, lsl #11 @ r12 = b | (r << 11)
orr r12, r12, r7, lsl #5 @ r12 |= (g << 5)
#if LCD_WIDTH >= LCD_HEIGHT
@@ -320,8 +320,7 @@ lcd_write_yuv420_lines:
subs r2, r2, #2 @ subtract block from width
bgt 10b @ loop line @
@
- ldmfd sp!, { r4-r12 } @ restore registers and return
- bx lr @
+ ldmfd sp!, { r4-r10, pc } @ restore registers and return
.ltorg @ dump constant pool
.size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
@@ -364,7 +363,7 @@ lcd_write_yuv420_lines_odither:
@ r3 = stride
@ [sp] = x_screen
@ [sp+4] = y_screen
- stmfd sp!, { r4-r12, lr } @ save non-scratch
+ stmfd sp!, { r4-r11, lr } @ save non-scratch
ldmia r1, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p
@ r5 = yuv_src[1] = Cb_p
@ r6 = yuv_src[2] = Cr_p
@@ -626,6 +625,6 @@ lcd_write_yuv420_lines_odither:
subs r2, r2, #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
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
index 84f47addd8..2aede6d5e7 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-as-mr100.S
@@ -30,21 +30,20 @@
.type lcd_write_data,%function
lcd_write_data:
- str lr, [sp, #-4]!
- ldr lr, =LCD1_BASE
+ ldr r12, =LCD1_BASE
.loop:
ldrb r2, [r0], #1
1:
- ldr r3, [lr]
+ ldr r3, [r12]
tst r3, #LCD1_BUSY_MASK
bne 1b
- str r2, [lr, #0x10]
+ str r2, [r12, #0x10]
subs r1, r1, #1
bne .loop
- ldr pc, [sp], #4
+ bx lr
.size lcd_write_data,.-lcd_write_data
@@ -62,16 +61,16 @@ lcd_write_data:
* Register usage:
* r3/r4 - current block of phases
* r5/r6 - current block of values
- * r7 - lcd data accumulator
- * r8 - phase signs mask
- * lr - lcd bridge address
+ * r7 - lcd data accumulator
+ * r12 - phase signs mask
+ * lr - lcd bridge address
*/
lcd_grey_data:
- stmfd sp!, {r4-r8, lr}
- mov r8, #0x80
- orr r8, r8, r8, lsl #8
- orr r8, r8, r8, lsl #16
+ stmfd sp!, {r4-r7, lr}
+ mov r12, #0x80
+ orr r12, r12, r12, lsl #8
+ orr r12, r12, r12, lsl #16
ldr lr, =LCD1_BASE
.greyloop:
@@ -87,7 +86,7 @@ lcd_grey_data:
biceq r7, r7, #0x20
tst r3, #0x80000000
biceq r7, r7, #0x10
- bic r3, r3, r8
+ bic r3, r3, r12
add r3, r3, r5
tst r4, #0x80
@@ -98,7 +97,7 @@ lcd_grey_data:
biceq r7, r7, #0x02
tst r4, #0x80000000
biceq r7, r7, #0x01
- bic r4, r4, r8
+ bic r4, r4, r12
add r4, r4, r6
stmia r1!, {r3-r4}
@@ -112,6 +111,6 @@ lcd_grey_data:
subs r2, r2, #1
bne .greyloop
- ldmfd sp!, {r4-r8, pc}
+ ldmfd sp!, {r4-r7, pc}
.size lcd_grey_data,.-lcd_grey_data
diff --git a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
index 8f3d12e727..74327dddaf 100644
--- a/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
+++ b/firmware/target/arm/philips/hdd1630/lcd-as-hdd1630.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
@ r0 = yuv_src
@ r1 = width
@ r2 = stride
- 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
@@ -248,7 +248,7 @@ lcd_write_yuv420_lines:
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, .-lcd_write_yuv420_lines
@@ -289,7 +289,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
@@ -565,6 +565,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
diff --git a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
index e466624d04..7187b83661 100644
--- a/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
+++ b/firmware/target/arm/samsung/yh820/lcd-as-yh820.S
@@ -48,7 +48,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
@@ -73,9 +73,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 @
@@ -85,19 +85,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 @
@@ -105,14 +105,14 @@ lcd_write_yuv420_lines:
@
ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -124,19 +124,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 @
@@ -144,14 +144,14 @@ lcd_write_yuv420_lines:
@
ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -163,19 +163,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 @
@@ -184,14 +184,14 @@ lcd_write_yuv420_lines:
ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
@
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -203,32 +203,32 @@ 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 @
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -238,8 +238,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
- bx lr @
+ ldmfd sp!, { r4-r10, pc } @ restore registers and return
.ltorg @ dump constant pool
.size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
@@ -279,7 +278,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
@@ -546,6 +545,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
diff --git a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
index ba6c876d44..e99eee50c9 100644
--- a/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
+++ b/firmware/target/arm/samsung/yh925/lcd-as-yh925.S
@@ -49,7 +49,7 @@ lcd_write_yuv420_lines:
@ r0 = yuv_src
@ r1 = width
@ r2 = stride
- 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
@@ -232,7 +232,7 @@ lcd_write_yuv420_lines:
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, .-lcd_write_yuv420_lines
@@ -273,7 +273,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
@@ -533,6 +533,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
diff --git a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
index e466624d04..7187b83661 100644
--- a/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
+++ b/firmware/target/arm/sandisk/sansa-c200/lcd-as-c200.S
@@ -48,7 +48,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
@@ -73,9 +73,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 @
@@ -85,19 +85,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 @
@@ -105,14 +105,14 @@ lcd_write_yuv420_lines:
@
ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -124,19 +124,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 @
@@ -144,14 +144,14 @@ lcd_write_yuv420_lines:
@
ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++)
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -163,19 +163,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 @
@@ -184,14 +184,14 @@ lcd_write_yuv420_lines:
ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride)
@
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -203,32 +203,32 @@ 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 @
@
- mov r11, r11, lsl #3 @
- orr r11, r11, r7, lsr #3 @ r11 = (r << 3) | (g >> 3)
+ mov lr, lr, lsl #3 @
+ orr lr, lr, r7, lsr #3 @ lr = (r << 3) | (g >> 3)
orr r0, r0, r7, lsl #5 @ r0 = (g << 5) | b
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
bne 1b @
- str r11, [r3, #0x10] @ send MSB
+ str lr, [r3, #0x10] @ send MSB
1: @ busy @
ldr r7, [r3] @ r7 = LCD1_BASE
tst r7, #LCD1_BUSY_MASK @ bridge busy?
@@ -238,8 +238,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
- bx lr @
+ ldmfd sp!, { r4-r10, pc } @ restore registers and return
.ltorg @ dump constant pool
.size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines
@@ -279,7 +278,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
@@ -546,6 +545,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