diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-01-14 16:16:05 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-01-14 16:17:18 -0500 |
commit | cc2685013551ac1e2b3e08e3eef49bf8e4b728fc (patch) | |
tree | ada8ff09e838432f6a6aad974573ac9b0ebcd9e0 /firmware/target | |
parent | bb24ac8c27af4ea8459e622a9ea2619aebc50efb (diff) | |
download | rockbox-cc2685013551ac1e2b3e08e3eef49bf8e4b728fc.tar.gz rockbox-cc2685013551ac1e2b3e08e3eef49bf8e4b728fc.zip |
Cut a few instructions from lcd_copy_buffer_rect.
Change-Id: I5159534f90b041c6ffefc00c8f91abc68ca6eb42
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/lcd-as-memframe.S | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/firmware/target/arm/lcd-as-memframe.S b/firmware/target/arm/lcd-as-memframe.S index 163eacefe6..52ab0447c2 100644 --- a/firmware/target/arm/lcd-as-memframe.S +++ b/firmware/target/arm/lcd-as-memframe.S | |||
@@ -51,46 +51,42 @@ lcd_copy_buffer_rect: @ | |||
51 | ble 40f @ finish line @ next line if lt or finish | 51 | ble 40f @ finish line @ next line if lt or finish |
52 | @ trailing halfword if eq | 52 | @ trailing halfword if eq |
53 | 20: @ rem copy @ | 53 | 20: @ rem copy @ |
54 | add r14, r2, #1 @ get remaining width mod 16 after word | 54 | sub r14, r2, #1 @ wrap remaining width mod 16 after word |
55 | @ align (rw) | 55 | @ align (rw) |
56 | and r14, r14, #0xe @ r14 = 0 (16), 2, 4, 6, 8, 10, 12, 14 | 56 | and r14, r14, #0xe @ r14 = 14, 0, 2, 4, 6, 8, 10, 12 |
57 | add pc, pc, r14, lsl #3 @ branch to 32-byte align | 57 | add pc, pc, r14, lsl #3 @ branch to 32-byte align |
58 | nop @ | 58 | nop @ |
59 | b 30f @ rw % 16 = 0 or 1? use octword loop | 59 | ldr r6, [r1], #4 @ rw % 16 = 2 or 3 (0) |
60 | nop @ | ||
61 | nop @ | ||
62 | nop @ | ||
63 | ldr r6, [r1], #4 @ rw % 16 = 2 or 3 | ||
64 | subs r2, r2, #2 @ | 60 | subs r2, r2, #2 @ |
65 | str r6, [r0], #4 @ | 61 | str r6, [r0], #4 @ |
66 | b 25f @ copy up done @ | 62 | b 25f @ copy up done @ |
67 | ldmia r1!, { r6-r7 } @ rw % 16 = 4 or 5 | 63 | ldmia r1!, { r6-r7 } @ rw % 16 = 4 or 5 (2) |
68 | subs r2, r2, #4 @ | 64 | subs r2, r2, #4 @ |
69 | stmia r0!, { r6-r7 } @ | 65 | stmia r0!, { r6-r7 } @ |
70 | b 25f @ copy up done @ | 66 | b 25f @ copy up done @ |
71 | ldmia r1!, { r6-r8 } @ rw % 16 = 6 or 7 | 67 | ldmia r1!, { r6-r8 } @ rw % 16 = 6 or 7 (4) |
72 | subs r2, r2, #6 @ | 68 | subs r2, r2, #6 @ |
73 | stmia r0!, { r6-r8 } @ | 69 | stmia r0!, { r6-r8 } @ |
74 | b 25f @ copy up done @ | 70 | b 25f @ copy up done @ |
75 | ldmia r1!, { r6-r9 } @ rw % 16 = 8 or 9 | 71 | ldmia r1!, { r6-r9 } @ rw % 16 = 8 or 9 (6) |
76 | subs r2, r2, #8 @ | 72 | subs r2, r2, #8 @ |
77 | stmia r0!, { r6-r9 } @ | 73 | stmia r0!, { r6-r9 } @ |
78 | b 25f @ copy up done @ | 74 | b 25f @ copy up done @ |
79 | ldmia r1!, { r6-r10 } @ rw % 16 = 10 or 11 | 75 | ldmia r1!, { r6-r10 } @ rw % 16 = 10 or 11 (8) |
80 | subs r2, r2, #10 @ | 76 | subs r2, r2, #10 @ |
81 | stmia r0!, { r6-r10 } @ | 77 | stmia r0!, { r6-r10 } @ |
82 | b 25f @ copy up done @ | 78 | b 25f @ copy up done @ |
83 | ldmia r1!, { r6-r11 } @ rw % 16 = 12 or 13 | 79 | ldmia r1!, { r6-r11 } @ rw % 16 = 12 or 13 (10) |
84 | subs r2, r2, #12 @ | 80 | subs r2, r2, #12 @ |
85 | stmia r0!, { r6-r11 } @ | 81 | stmia r0!, { r6-r11 } @ |
86 | b 25f @ copy up done @ | 82 | b 25f @ copy up done @ |
87 | ldmia r1!, { r6-r12 } @ rw % 16 = 14 or 15 | 83 | ldmia r1!, { r6-r12 } @ rw % 16 = 14 or 15 (12) |
88 | subs r2, r2, #14 @ | 84 | subs r2, r2, #14 @ |
89 | stmia r0!, { r6-r12 } @ | 85 | stmia r0!, { r6-r12 } @ |
90 | 25: @ copy up done @ | 86 | 25: @ copy up done @ |
91 | ble 40f @ finish line @ no 32-byte segments remaining? | 87 | ble 40f @ finish line @ |
92 | 30: @ octword loop @ copy 16 pixels per loop | 88 | 30: @ octword loop @ rw % 16 = 0 or 1 (14) |
93 | ldmia r1!, { r6-r12, r14 } @ | 89 | ldmia r1!, { r6-r12, r14 } @ copy 16 pixels per loop |
94 | subs r2, r2, #16 @ | 90 | subs r2, r2, #16 @ |
95 | stmia r0!, { r6-r12, r14 } @ | 91 | stmia r0!, { r6-r12, r14 } @ |
96 | bgt 30b @ octword loop @ | 92 | bgt 30b @ octword loop @ |
@@ -102,9 +98,9 @@ lcd_copy_buffer_rect: @ | |||
102 | subs r3, r3, #1 @ next line | 98 | subs r3, r3, #1 @ next line |
103 | bgt 10b @ copy line @ | 99 | bgt 10b @ copy line @ |
104 | ldmpc regs=r4-r11 @ restore regs and return | 100 | ldmpc regs=r4-r11 @ restore regs and return |
105 | .ltorg @ dump constant pool | ||
106 | .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect | 101 | .size lcd_copy_buffer_rect, .-lcd_copy_buffer_rect |
107 | 102 | ||
103 | |||
108 | /**************************************************************************** | 104 | /**************************************************************************** |
109 | * void lcd_write_yuv420_lines(fb_data *dst, | 105 | * void lcd_write_yuv420_lines(fb_data *dst, |
110 | * unsigned char const * const src[3], | 106 | * unsigned char const * const src[3], |