(ARM NEON) Buildfix

This commit is contained in:
twinaphex 2016-05-17 17:00:16 +00:00
parent 070b7b78b1
commit 4af31cee97
5 changed files with 39 additions and 31 deletions

View File

@ -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 *

View File

@ -28,6 +28,9 @@
#include <altivec.h>
#endif
#include <features/features_cpu.h>
#include <conversion/float_to_s16.h>
/**
* 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
}

View File

@ -21,7 +21,7 @@
#include <boolean.h>
#include <features/features_cpu.h>
#include <conversion/float_to_s16.h>
#include <conversion/s16_to_float.h>
/**
* 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
}

View File

@ -23,13 +23,13 @@
#ifndef __LIBRETRO_SDK_CONVERSION_FLOAT_TO_S16_H__
#define __LIBRETRO_SDK_CONVERSION_FLOAT_TO_S16_H__
#include <stdint.h>
#include <stddef.h>
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
#include <stdint.h>
#include <stddef.h>
/**
* 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

View File

@ -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