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/as3525/lcd-as-e200v2-fuze.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/as3525/lcd-as-e200v2-fuze.S')
-rw-r--r-- | firmware/target/arm/as3525/lcd-as-e200v2-fuze.S | 62 |
1 files changed, 31 insertions, 31 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: | |||
51 | @ r0 = yuv_src | 51 | @ r0 = yuv_src |
52 | @ r1 = width | 52 | @ r1 = width |
53 | @ r2 = stride | 53 | @ r2 = stride |
54 | stmfd sp!, { r4-r12 } @ save non-scratch | 54 | stmfd sp!, { r4-r10, lr } @ save non-scratch |
55 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p | 55 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p |
56 | @ r5 = yuv_src[1] = Cb_p | 56 | @ r5 = yuv_src[1] = Cb_p |
57 | @ r6 = yuv_src[2] = Cr_p | 57 | @ r6 = yuv_src[2] = Cr_p |
@@ -76,9 +76,9 @@ lcd_write_yuv420_lines: | |||
76 | add r10, r10, r8, asl #3 @ | 76 | add r10, r10, r8, asl #3 @ |
77 | add r10, r10, r8, asl #4 @ | 77 | add r10, r10, r8, asl #4 @ |
78 | @ | 78 | @ |
79 | add r11, r9, r9, asl #2 @ r9 = Cr*101 | 79 | add lr, r9, r9, asl #2 @ r9 = Cr*101 |
80 | add r11, r11, r9, asl #5 @ | 80 | add lr, lr, r9, asl #5 @ |
81 | add r9, r11, r9, asl #6 @ | 81 | add r9, lr, r9, asl #6 @ |
82 | @ | 82 | @ |
83 | add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 | 83 | add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 |
84 | mov r8, r8, asr #2 @ | 84 | mov r8, r8, asr #2 @ |
@@ -88,19 +88,19 @@ lcd_write_yuv420_lines: | |||
88 | mov r10, r10, asr #8 @ | 88 | mov r10, r10, asr #8 @ |
89 | @ compute R, G, and B | 89 | @ compute R, G, and B |
90 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 90 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
91 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 91 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
92 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 92 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
93 | @ | 93 | @ |
94 | orr r12, r0, r11 @ check if clamping is needed... | 94 | orr r12, r0, lr @ check if clamping is needed... |
95 | orr r12, r12, r7, asr #1 @ ...at all | 95 | orr r12, r12, r7, asr #1 @ ...at all |
96 | cmp r12, #31 @ | 96 | cmp r12, #31 @ |
97 | bls 15f @ no clamp @ | 97 | bls 15f @ no clamp @ |
98 | cmp r0, #31 @ clamp b | 98 | cmp r0, #31 @ clamp b |
99 | mvnhi r0, r0, asr #31 @ | 99 | mvnhi r0, r0, asr #31 @ |
100 | andhi r0, r0, #31 @ | 100 | andhi r0, r0, #31 @ |
101 | cmp r11, #31 @ clamp r | 101 | cmp lr, #31 @ clamp r |
102 | mvnhi r11, r11, asr #31 @ | 102 | mvnhi lr, lr, asr #31 @ |
103 | andhi r11, r11, #31 @ | 103 | andhi lr, lr, #31 @ |
104 | cmp r7, #63 @ clamp g | 104 | cmp r7, #63 @ clamp g |
105 | mvnhi r7, r7, asr #31 @ | 105 | mvnhi r7, r7, asr #31 @ |
106 | andhi r7, r7, #63 @ | 106 | andhi r7, r7, #63 @ |
@@ -108,7 +108,7 @@ lcd_write_yuv420_lines: | |||
108 | @ | 108 | @ |
109 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) | 109 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) |
110 | @ | 110 | @ |
111 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 111 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
112 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 112 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
113 | strh r0, [r3, #0x10] @ write pixel | 113 | strh r0, [r3, #0x10] @ write pixel |
114 | 1: @ busy @ | 114 | 1: @ busy @ |
@@ -121,19 +121,19 @@ lcd_write_yuv420_lines: | |||
121 | add r7, r12, r7, asl #5 @ | 121 | add r7, r12, r7, asl #5 @ |
122 | @ compute R, G, and B | 122 | @ compute R, G, and B |
123 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 123 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
124 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 124 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
125 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 125 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
126 | @ | 126 | @ |
127 | orr r12, r0, r11 @ check if clamping is needed... | 127 | orr r12, r0, lr @ check if clamping is needed... |
128 | orr r12, r12, r7, asr #1 @ ...at all | 128 | orr r12, r12, r7, asr #1 @ ...at all |
129 | cmp r12, #31 @ | 129 | cmp r12, #31 @ |
130 | bls 15f @ no clamp @ | 130 | bls 15f @ no clamp @ |
131 | cmp r0, #31 @ clamp b | 131 | cmp r0, #31 @ clamp b |
132 | mvnhi r0, r0, asr #31 @ | 132 | mvnhi r0, r0, asr #31 @ |
133 | andhi r0, r0, #31 @ | 133 | andhi r0, r0, #31 @ |
134 | cmp r11, #31 @ clamp r | 134 | cmp lr, #31 @ clamp r |
135 | mvnhi r11, r11, asr #31 @ | 135 | mvnhi lr, lr, asr #31 @ |
136 | andhi r11, r11, #31 @ | 136 | andhi lr, lr, #31 @ |
137 | cmp r7, #63 @ clamp g | 137 | cmp r7, #63 @ clamp g |
138 | mvnhi r7, r7, asr #31 @ | 138 | mvnhi r7, r7, asr #31 @ |
139 | andhi r7, r7, #63 @ | 139 | andhi r7, r7, #63 @ |
@@ -141,7 +141,7 @@ lcd_write_yuv420_lines: | |||
141 | @ | 141 | @ |
142 | ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) | 142 | ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) |
143 | @ | 143 | @ |
144 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 144 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
145 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 145 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
146 | strh r0, [r3, #0x10] @ write pixel | 146 | strh r0, [r3, #0x10] @ write pixel |
147 | 1: @ busy @ | 147 | 1: @ busy @ |
@@ -154,19 +154,19 @@ lcd_write_yuv420_lines: | |||
154 | add r7, r12, r7, asl #5 @ | 154 | add r7, r12, r7, asl #5 @ |
155 | @ compute R, G, and B | 155 | @ compute R, G, and B |
156 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 156 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
157 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 157 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
158 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 158 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
159 | @ | 159 | @ |
160 | orr r12, r0, r11 @ check if clamping is needed... | 160 | orr r12, r0, lr @ check if clamping is needed... |
161 | orr r12, r12, r7, asr #1 @ ...at all | 161 | orr r12, r12, r7, asr #1 @ ...at all |
162 | cmp r12, #31 @ | 162 | cmp r12, #31 @ |
163 | bls 15f @ no clamp @ | 163 | bls 15f @ no clamp @ |
164 | cmp r0, #31 @ clamp b | 164 | cmp r0, #31 @ clamp b |
165 | mvnhi r0, r0, asr #31 @ | 165 | mvnhi r0, r0, asr #31 @ |
166 | andhi r0, r0, #31 @ | 166 | andhi r0, r0, #31 @ |
167 | cmp r11, #31 @ clamp r | 167 | cmp lr, #31 @ clamp r |
168 | mvnhi r11, r11, asr #31 @ | 168 | mvnhi lr, lr, asr #31 @ |
169 | andhi r11, r11, #31 @ | 169 | andhi lr, lr, #31 @ |
170 | cmp r7, #63 @ clamp g | 170 | cmp r7, #63 @ clamp g |
171 | mvnhi r7, r7, asr #31 @ | 171 | mvnhi r7, r7, asr #31 @ |
172 | andhi r7, r7, #63 @ | 172 | andhi r7, r7, #63 @ |
@@ -175,7 +175,7 @@ lcd_write_yuv420_lines: | |||
175 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) | 175 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) |
176 | @ | 176 | @ |
177 | @ | 177 | @ |
178 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 178 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
179 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 179 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
180 | strh r0, [r3, #0x10] @ write pixel | 180 | strh r0, [r3, #0x10] @ write pixel |
181 | 1: @ busy @ | 181 | 1: @ busy @ |
@@ -188,25 +188,25 @@ lcd_write_yuv420_lines: | |||
188 | add r7, r12, r7, asl #5 @ | 188 | add r7, r12, r7, asl #5 @ |
189 | @ compute R, G, and B | 189 | @ compute R, G, and B |
190 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 190 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
191 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 191 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
192 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 192 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
193 | @ | 193 | @ |
194 | orr r12, r0, r11 @ check if clamping is needed... | 194 | orr r12, r0, lr @ check if clamping is needed... |
195 | orr r12, r12, r7, asr #1 @ ...at all | 195 | orr r12, r12, r7, asr #1 @ ...at all |
196 | cmp r12, #31 @ | 196 | cmp r12, #31 @ |
197 | bls 15f @ no clamp @ | 197 | bls 15f @ no clamp @ |
198 | cmp r0, #31 @ clamp b | 198 | cmp r0, #31 @ clamp b |
199 | mvnhi r0, r0, asr #31 @ | 199 | mvnhi r0, r0, asr #31 @ |
200 | andhi r0, r0, #31 @ | 200 | andhi r0, r0, #31 @ |
201 | cmp r11, #31 @ clamp r | 201 | cmp lr, #31 @ clamp r |
202 | mvnhi r11, r11, asr #31 @ | 202 | mvnhi lr, lr, asr #31 @ |
203 | andhi r11, r11, #31 @ | 203 | andhi lr, lr, #31 @ |
204 | cmp r7, #63 @ clamp g | 204 | cmp r7, #63 @ clamp g |
205 | mvnhi r7, r7, asr #31 @ | 205 | mvnhi r7, r7, asr #31 @ |
206 | andhi r7, r7, #63 @ | 206 | andhi r7, r7, #63 @ |
207 | 15: @ no clamp @ | 207 | 15: @ no clamp @ |
208 | @ | 208 | @ |
209 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 209 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
210 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 210 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
211 | strh r0, [r3, #0x10] @ write pixel | 211 | strh r0, [r3, #0x10] @ write pixel |
212 | 1: @ busy @ | 212 | 1: @ busy @ |
@@ -217,7 +217,7 @@ lcd_write_yuv420_lines: | |||
217 | subs r1, r1, #2 @ subtract block from width | 217 | subs r1, r1, #2 @ subtract block from width |
218 | bgt 10b @ loop line @ | 218 | bgt 10b @ loop line @ |
219 | @ | 219 | @ |
220 | ldmfd sp!, { r4-r12 } @ restore registers and return | 220 | ldmfd sp!, { r4-r10, pc } @ restore registers and return |
221 | bx lr @ | 221 | bx lr @ |
222 | .ltorg @ dump constant pool | 222 | .ltorg @ dump constant pool |
223 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines | 223 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines |
@@ -258,7 +258,7 @@ lcd_write_yuv420_lines_odither: | |||
258 | @ r2 = stride | 258 | @ r2 = stride |
259 | @ r3 = x_screen | 259 | @ r3 = x_screen |
260 | @ [sp] = y_screen | 260 | @ [sp] = y_screen |
261 | stmfd sp!, { r4-r12, lr } @ save non-scratch | 261 | stmfd sp!, { r4-r11, lr } @ save non-scratch |
262 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p | 262 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p |
263 | @ r5 = yuv_src[1] = Cb_p | 263 | @ r5 = yuv_src[1] = Cb_p |
264 | @ r6 = yuv_src[2] = Cr_p | 264 | @ r6 = yuv_src[2] = Cr_p |
@@ -496,6 +496,6 @@ lcd_write_yuv420_lines_odither: | |||
496 | subs r1, r1, #2 @ subtract block from width | 496 | subs r1, r1, #2 @ subtract block from width |
497 | bgt 10b @ loop line @ | 497 | bgt 10b @ loop line @ |
498 | @ | 498 | @ |
499 | ldmfd sp!, { r4-r12, pc } @ restore registers and return | 499 | ldmfd sp!, { r4-r11, pc } @ restore registers and return |
500 | .ltorg @ dump constant pool | 500 | .ltorg @ dump constant pool |
501 | .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither | 501 | .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither |