From 4af31cee97f3c03df7ba90adf0e7a3897bb45f1f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 17 May 2016 17:00:16 +0000 Subject: [PATCH] (ARM NEON) Buildfix --- audio/audio_driver.c | 3 +- libretro-common/conversion/float_to_s16.c | 20 +++++++++++++ libretro-common/conversion/s16_to_float.c | 15 +++------- .../include/conversion/float_to_s16.h | 28 ++++++++----------- .../include/conversion/s16_to_float.h | 4 +-- 5 files changed, 39 insertions(+), 31 deletions(-) diff --git a/audio/audio_driver.c b/audio/audio_driver.c index 33b51995d6..72b7aa4ab1 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -310,7 +310,8 @@ static bool audio_driver_init_internal(bool audio_cb_inited) size_t outsamples_max, max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2; settings_t *settings = config_get_ptr(); - convert_init_simd(); + convert_s16_to_float_init_simd(); + convert_float_to_s16_init_simd(); /* Accomodate rewind since at some point we might have two full buffers. */ outsamples_max = max_bufsamples * AUDIO_MAX_RATIO * diff --git a/libretro-common/conversion/float_to_s16.c b/libretro-common/conversion/float_to_s16.c index f353cc2200..9ae0fab4f0 100644 --- a/libretro-common/conversion/float_to_s16.c +++ b/libretro-common/conversion/float_to_s16.c @@ -28,6 +28,9 @@ #include #endif +#include +#include + /** * convert_float_to_s16_C: * @out : output buffer @@ -195,3 +198,20 @@ void convert_float_to_s16_ALLEGREX(int16_t *out, } } #endif + +/** + * convert_float_to_s16_init_simd: + * + * Sets up function pointers for conversion + * functions based on CPU features. + **/ +void convert_float_to_s16_init_simd(void) +{ + unsigned cpu = cpu_features_get(); + + (void)cpu; +#if defined(__ARM_NEON__) && !defined(VITA) + convert_float_to_s16_arm = (cpu & RETRO_SIMD_NEON) ? + convert_float_to_s16_neon : convert_float_to_s16_C; +#endif +} diff --git a/libretro-common/conversion/s16_to_float.c b/libretro-common/conversion/s16_to_float.c index 4f3222d53f..2bc402b1c1 100644 --- a/libretro-common/conversion/s16_to_float.c +++ b/libretro-common/conversion/s16_to_float.c @@ -21,7 +21,7 @@ #include #include -#include +#include /** * convert_s16_to_float_C: @@ -224,26 +224,19 @@ void convert_s16_to_float_ALLEGREX(float *out, } #endif -static unsigned convert_get_cpu_features(void) -{ - return cpu_features_get(); -} - /** - * convert_init_simd: + * convert_s16_to_float_init_simd: * * Sets up function pointers for conversion * functions based on CPU features. **/ -void convert_init_simd(void) +void convert_s16_to_float_init_simd(void) { - unsigned cpu = convert_get_cpu_features(); + unsigned cpu = cpu_features_get(); (void)cpu; #if defined(__ARM_NEON__) && !defined(VITA) convert_s16_to_float_arm = (cpu & RETRO_SIMD_NEON) ? convert_s16_to_float_neon : convert_s16_to_float_C; - convert_float_to_s16_arm = (cpu & RETRO_SIMD_NEON) ? - convert_float_to_s16_neon : convert_float_to_s16_C; #endif } diff --git a/libretro-common/include/conversion/float_to_s16.h b/libretro-common/include/conversion/float_to_s16.h index 3295a4faab..3ee1aad112 100644 --- a/libretro-common/include/conversion/float_to_s16.h +++ b/libretro-common/include/conversion/float_to_s16.h @@ -23,13 +23,13 @@ #ifndef __LIBRETRO_SDK_CONVERSION_FLOAT_TO_S16_H__ #define __LIBRETRO_SDK_CONVERSION_FLOAT_TO_S16_H__ -#include -#include - #include RETRO_BEGIN_DECLS +#include +#include + /** * convert_float_to_s16_C: * @out : output buffer @@ -81,20 +81,6 @@ void (*convert_float_to_s16_arm)(int16_t *out, const float *in, size_t samples); void convert_float_s16_asm(int16_t *out, const float *in, size_t samples); - -/** - * convert_float_to_s16_neon: - * @out : output buffer - * @in : input buffer - * @samples : size of samples to be converted - * - * Converts floating point - * to signed integer 16-bit. - * - * ARM NEON implementation callback function. - **/ -static void convert_float_to_s16_neon(int16_t *out, - const float *in, size_t samples); #elif defined(_MIPS_ARCH_ALLEGREX) #define convert_float_to_s16 convert_float_to_s16_ALLEGREX /** @@ -114,6 +100,14 @@ void convert_float_to_s16_ALLEGREX(int16_t *out, #define convert_float_to_s16 convert_float_to_s16_C #endif +/** + * convert_float_to_s16_init_simd: + * + * Sets up function pointers for conversion + * functions based on CPU features. + **/ +void convert_float_to_s16_init_simd(void); + RETRO_END_DECLS #endif diff --git a/libretro-common/include/conversion/s16_to_float.h b/libretro-common/include/conversion/s16_to_float.h index b79638dd6d..b418a61396 100644 --- a/libretro-common/include/conversion/s16_to_float.h +++ b/libretro-common/include/conversion/s16_to_float.h @@ -108,12 +108,12 @@ void convert_s16_to_float_C(float *out, const int16_t *in, size_t samples, float gain); /** - * convert_init_simd: + * convert_s16_to_float_init_simd: * * Sets up function pointers for conversion * functions based on CPU features. **/ -void convert_init_simd(void); +void convert_s16_to_float_init_simd(void); RETRO_END_DECLS