all repos — mgba @ 448bc200c36c68a1250a2eb0394f5b90a2f75bed

mGBA Game Boy Advance Emulator

Util: Get rid of _to16Bit
Vicki Pfau vi@endrift.com
Sat, 26 Aug 2017 18:23:29 -0700
commit

448bc200c36c68a1250a2eb0394f5b90a2f75bed

parent

323a6326cd9d9f90f08e4ebd2c5b2f84fcdbd533

3 files changed, 5 insertions(+), 34 deletions(-)

jump to
M include/mgba-util/arm-algo.hinclude/mgba-util/arm-algo.h

@@ -7,12 +7,10 @@ #ifndef ARM_ALGO_H

#define ARM_ALGO_H #ifdef __arm__ -void _to16Bit(uint16_t* dest, uint32_t* src, size_t words); - #if defined(__ARM_NEON) void _neon2x(void* dest, void* src, int width, int height); void _neon4x(void* dest, void* src, int width, int height); #endif #endif -#endif+#endif
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -641,13 +641,12 @@ }

} #ifdef COLOR_16_BIT -#if defined(__ARM_NEON) && !defined(__APPLE__) - _to16Bit(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS); -#else - for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x) { + for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; x += 4) { row[x] = softwareRenderer->row[x]; + row[x + 1] = softwareRenderer->row[x + 1]; + row[x + 2] = softwareRenderer->row[x + 2]; + row[x + 3] = softwareRenderer->row[x + 3]; } -#endif #else memcpy(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS * sizeof(*row)); #endif
M src/util/arm-algo.Ssrc/util/arm-algo.S

@@ -6,32 +6,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/.

#if defined(__ARM_NEON) && !defined(PSP2) # r0: Destination # r1: Source -# r2: Number of words to copy as halfwords -.global _to16Bit -_to16Bit: -push {r4-r10} -mov r8, r0 -mov r9, r1 -mov r10, r2 -.L0: -tst r10, #15 -beq .L1 -ldr r0, [r9], #4 -strh r0, [r8], #2 -sub r10, #1 -b .L0 -.L1: -vld4.16 {d0, d1, d2, d3}, [r9]! -vld4.16 {d4, d5, d6, d7}, [r9]! -vst2.16 {d0, d2}, [r8]! -vst2.16 {d4, d6}, [r8]! -subs r10, #16 -bne .L1 -pop {r4-r10} -bx lr - -# r0: Destination -# r1: Source # r2: Width # r3: Height .global _neon2x