From a327967e78393018a9f2a7edb38bc3af657e597a Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 7 Dec 2010 13:00:46 +0200 Subject: simple neon BGR555 to RGB565 converter --- frontend/arm_utils.s | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 frontend/arm_utils.s (limited to 'frontend') 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 -- cgit v1.2.3