Skip to content

Commit 8e6b629

Browse files
committed
cspace_arm: slight improvements
...maybe
1 parent 30431e7 commit 8e6b629

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

frontend/cspace_arm.S

+19-11
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@
2020
orr \rn, r12, lsl #6
2121
.endm
2222

23+
.macro bgr555_to_rgb565_one_i rn1 rn2
24+
and r12, lr, \rn1, lsr #5
25+
and \rn1,lr, \rn1, lsr #10
26+
orr r12, r11, lsl #5
27+
and r11, lr, \rn2
28+
orr \rn1,r12, lsl #6
29+
.endm
30+
2331
.macro pld_ reg offs=#0
2432
#ifdef HAVE_ARMV6
2533
pld [\reg, \offs]
2634
#endif
2735
.endm
2836

2937
FUNCTION(bgr555_to_rgb565): @ void *dst, const void *src, int bytes
30-
pld_ r1
3138
push {r4-r11,lr}
3239
mov lr, #0x001f
3340
subs r2, #4*8
@@ -43,16 +50,17 @@ FUNCTION(bgr555_to_rgb565): @ void *dst, const void *src, int bytes
4350
0:
4451
ldmia r1!, {r3-r10}
4552
subs r2, #4*8
46-
bgr555_to_rgb565_one r3
47-
48-
pld_ r1, #32*2
49-
bgr555_to_rgb565_one r4
50-
bgr555_to_rgb565_one r5
51-
bgr555_to_rgb565_one r6
52-
bgr555_to_rgb565_one r7
53-
bgr555_to_rgb565_one r8
54-
bgr555_to_rgb565_one r9
55-
bgr555_to_rgb565_one r10
53+
bic r12, r1, #0x1f
54+
pld_ r12, #32*1
55+
and r11, lr, r3
56+
bgr555_to_rgb565_one_i r3 r4
57+
bgr555_to_rgb565_one_i r4 r5
58+
bgr555_to_rgb565_one_i r5 r6
59+
bgr555_to_rgb565_one_i r6 r7
60+
bgr555_to_rgb565_one_i r7 r8
61+
bgr555_to_rgb565_one_i r8 r9
62+
bgr555_to_rgb565_one_i r9 r10
63+
bgr555_to_rgb565_one_i r10 r10
5664
stmia r0!, {r3-r10}
5765
bge 0b
5866

0 commit comments

Comments
 (0)