aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authornotaz2010-12-07 13:00:46 +0200
committernotaz2010-12-14 15:25:04 +0200
commita327967e78393018a9f2a7edb38bc3af657e597a (patch)
tree707375cb00994b09fdd9bb7bea64678ad968132c /frontend
parentfa9cfe0a7ff390f15bfdc6add7e57841173d1954 (diff)
downloadpcsx_rearmed-a327967e78393018a9f2a7edb38bc3af657e597a.tar.gz
pcsx_rearmed-a327967e78393018a9f2a7edb38bc3af657e597a.tar.bz2
pcsx_rearmed-a327967e78393018a9f2a7edb38bc3af657e597a.zip
simple neon BGR555 to RGB565 converter
Diffstat (limited to 'frontend')
-rw-r--r--frontend/arm_utils.s48
1 files changed, 48 insertions, 0 deletions
diff --git a/frontend/arm_utils.s b/frontend/arm_utils.s
new file mode 100644
index 0000000..edaafb8
--- /dev/null
+++ b/frontend/arm_utils.s
@@ -0,0 +1,48 @@
+/*
+ * (C) GraÅžvydas "notaz" Ignotas, 2010
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+.text
+.align 2
+
+.global bgr555_to_rgb565
+bgr555_to_rgb565:
+ mov r3, #0x03e0
+ vdup.16 q15, r3
+ mov r2, r2, lsr #6
+0:
+ vldmia r1!, {q0-q3}
+ vshr.u16 q4, q0, #10
+ vshr.u16 q5, q1, #10
+ vshr.u16 q6, q2, #10
+ vshr.u16 q7, q3, #10
+ vshl.u16 q8, q0, #11
+ vshl.u16 q9, q1, #11
+ vshl.u16 q10, q2, #11
+ vshl.u16 q11, q3, #11
+ vand q0, q0, q15
+ vand q1, q1, q15
+ vand q2, q2, q15
+ vand q3, q3, q15
+ vshl.u16 q0, q0, #1
+ vshl.u16 q1, q1, #1
+ vshl.u16 q2, q2, #1
+ vshl.u16 q3, q3, #1
+ vorr q0, q0, q4
+ vorr q1, q1, q5
+ vorr q2, q2, q6
+ vorr q3, q3, q7
+ vorr q0, q0, q8
+ vorr q1, q1, q9
+ vorr q2, q2, q10
+ vorr q3, q3, q11
+ vstmia r0!, {q0-q3}
+ subs r2, r2, #1
+ bne 0b
+
+ bx lr
+
+@ vim:filetype=armasm