rm X11 include hack
[pcsx_rearmed.git] / frontend / arm_utils.s
CommitLineData
a327967e 1/*
2 * (C) Gražvydas "notaz" Ignotas, 2010
3 *
69af03a2 4 * This work is licensed under the terms of any of these licenses
5 * (at your option):
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
a327967e 8 * See the COPYING file in the top-level directory.
9 */
10
11.text
12.align 2
13
14.global bgr555_to_rgb565
15bgr555_to_rgb565:
16 mov r3, #0x03e0
17 vdup.16 q15, r3
18 mov r2, r2, lsr #6
190:
20 vldmia r1!, {q0-q3}
21 vshr.u16 q4, q0, #10
22 vshr.u16 q5, q1, #10
23 vshr.u16 q6, q2, #10
24 vshr.u16 q7, q3, #10
25 vshl.u16 q8, q0, #11
26 vshl.u16 q9, q1, #11
27 vshl.u16 q10, q2, #11
28 vshl.u16 q11, q3, #11
29 vand q0, q0, q15
30 vand q1, q1, q15
31 vand q2, q2, q15
32 vand q3, q3, q15
33 vshl.u16 q0, q0, #1
34 vshl.u16 q1, q1, #1
35 vshl.u16 q2, q2, #1
36 vshl.u16 q3, q3, #1
37 vorr q0, q0, q4
38 vorr q1, q1, q5
39 vorr q2, q2, q6
40 vorr q3, q3, q7
41 vorr q0, q0, q8
42 vorr q1, q1, q9
43 vorr q2, q2, q10
44 vorr q3, q3, q11
45 vstmia r0!, {q0-q3}
46 subs r2, r2, #1
47 bne 0b
48
49 bx lr
50
1972732a 51
52.global bgr888_to_rgb888
53bgr888_to_rgb888:
54 @ r2 /= 48
55 mov r2, r2, lsr #4
56 movw r3, #0x5556
57 movt r3, #0x5555
58 umull r12,r2, r3, r2
590:
60 vld3.8 {d0-d2}, [r1, :64]!
61 vld3.8 {d3-d5}, [r1, :64]!
62 vswp d0, d2
63 vswp d3, d5
64 vst3.8 {d0-d2}, [r0, :64]!
65 vst3.8 {d3-d5}, [r0, :64]!
66 subs r2, r2, #1
67 bne 0b
68
69 bx lr
70
71
a327967e 72@ vim:filetype=armasm