Fix ARM NEON detection

This commit is contained in:
twinaphex 2021-02-16 23:02:06 +01:00
parent dea73a5595
commit c01df07f3d
5 changed files with 29 additions and 9 deletions

View File

@ -464,7 +464,7 @@ build-retroarch-metal-osx-arm64:
script:
# Normal RetroArch Metal (ARM64) Build
- ./configure --enable-metal --disable-al
- make ARCH=arm64 -j$NUMPROC
- make -j$NUMPROC
# Cleanup for DMG creation
- rm -rvf "RetroArch_ARM64.app/"

View File

@ -29,6 +29,12 @@
#include <audio/audio_resampler.h>
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
#define HAVE_ARM_NEON_OPTIMIZATIONS
#endif
#endif
/* Since SSE and NEON don't provide support for trigonometric functions
* we approximate those with polynoms
*
@ -344,7 +350,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
data->output_frames = outp - (audio_frame_float_t*)data->data_out;
}
#elif defined (__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
#define CC_RESAMPLER_IDENT "NEON"

View File

@ -28,10 +28,16 @@
#include <altivec.h>
#endif
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
#define HAVE_ARM_NEON_OPTIMIZATIONS
#endif
#endif
#include <features/features_cpu.h>
#include <audio/conversion/float_to_s16.h>
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#if defined(HAVE_ARM_NEON_OPTIMIZATIONS)
static bool float_to_s16_neon_enabled = false;
void convert_float_s16_asm(int16_t *out, const float *in, size_t samples);
#endif
@ -91,7 +97,7 @@ void convert_float_to_s16(int16_t *out,
samples = samples_in;
i = 0;
#elif defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
if (float_to_s16_neon_enabled)
{
size_t aligned_samples = samples & ~7;
@ -151,7 +157,7 @@ void convert_float_to_s16(int16_t *out,
**/
void convert_float_to_s16_init_simd(void)
{
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#if defined(HAVE_ARM_NEON_OPTIMIZATIONS)
unsigned cpu = cpu_features_get();
if (cpu & RETRO_SIMD_NEON)

View File

@ -29,7 +29,13 @@
#include <features/features_cpu.h>
#include <audio/conversion/s16_to_float.h>
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
#define HAVE_ARM_NEON_OPTIMIZATIONS
#endif
#endif
#if defined(HAVE_ARM_NEON_OPTIMIZATIONS)
static bool s16_to_float_neon_enabled = false;
/* Avoid potential hard-float/soft-float ABI issues. */
@ -98,7 +104,7 @@ void convert_s16_to_float(float *out,
samples = samples_in;
i = 0;
#elif defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
if (s16_to_float_neon_enabled)
{
size_t aligned_samples = samples & ~7;
@ -181,7 +187,7 @@ void convert_s16_to_float(float *out,
**/
void convert_s16_to_float_init_simd(void)
{
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#if defined(HAVE_ARM_NEON_OPTIMIZATIONS)
unsigned cpu = cpu_features_get();
if (cpu & RETRO_SIMD_NEON)

View File

@ -87,12 +87,14 @@ typedef struct rarch_sinc_resampler
enum sinc_window window_type;
} rarch_sinc_resampler_t;
#if defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#if TARGET_OS_IPHONE
#else
#ifndef WANT_NEON
#define WANT_NEON
#endif
#endif
#endif
#ifdef WANT_NEON
/* Assumes that taps >= 8, and that taps is a multiple of 8. */