[CMake] Fix ARM64 intrinsics activation

In 95e2c52 the autotools build worked fine, but CMake missed a few
defines. Activition of the lpc_compute_residual_from_qlp_coefficients
depended on encoder->private_->cpuinfo.use_asm for no reason, so
this dependency is removed
This commit is contained in:
Martijn van Beurden 2022-05-02 21:59:40 +02:00
parent d9554fb7c9
commit e3a9212bfc
3 changed files with 16 additions and 11 deletions

View File

@ -9,6 +9,9 @@
/* Target processor is little endian. */
#cmakedefine01 CPU_IS_LITTLE_ENDIAN
/* Target processor ARM64 */
#cmakedefine FLAC__CPU_ARM64
/* Target processor PPC */
#cmakedefine FLAC__CPU_PPC
@ -43,6 +46,9 @@
/* Set to 1 if <arm_neon.h> is available. */
#cmakedefine01 FLAC__HAS_NEONINTRIN
/* Set to 1 if <arm_neon.h> contains A64 intrinsics */
#cmakedefine01 FLAC__HAS_A64NEONINTRIN
/* define if building for Darwin / MacOS X */
#cmakedefine FLAC__SYS_DARWIN

View File

@ -41,7 +41,7 @@
#include "private/macros.h"
#include <arm_neon.h>
#ifdef FLAC__HAS_A64NEONINTRIN
#if FLAC__HAS_A64NEONINTRIN
void FLAC__lpc_compute_autocorrelation_intrin_neon_lag_14(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[])
{
#undef MAX_LAG

View File

@ -906,8 +906,10 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation;
}
#endif
#endif
#if defined FLAC__CPU_ARM64 && FLAC__HAS_NEONINTRIN && FLAC__HAS_A64NEONINTRIN
#endif /* defined(FLAC__CPU_PPC64) && defined(FLAC__USE_VSX) */
#if defined FLAC__CPU_ARM64 && FLAC__HAS_NEONINTRIN
#if FLAC__HAS_A64NEONINTRIN
if(encoder->protected_->max_lpc_order < 8)
encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_intrin_neon_lag_8;
else if(encoder->protected_->max_lpc_order < 10)
@ -917,6 +919,11 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
else
encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation;
#endif
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_neon;
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_neon;
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit = FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_neon;
#endif /* defined FLAC__CPU_ARM64 && FLAC__HAS_NEONINTRIN */
if(encoder->private_->cpuinfo.use_asm) {
# ifdef FLAC__CPU_IA32
FLAC__ASSERT(encoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
@ -1013,14 +1020,6 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
# endif
# endif /* FLAC__HAS_X86INTRIN */
# endif /* FLAC__CPU_... */
#if defined FLAC__CPU_ARM64 && FLAC__HAS_NEONINTRIN
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_neon;
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_neon;
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit = FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_neon;
# endif
}
# endif /* !FLAC__NO_ASM */