Clear ARM NEON flag

Merge WEBRTC_ARCH_ARM64_NEON and WEBRTC_ARCH_ARM_NEON into one
WEBRTC_HAS_NEON.
Replace WEBRTC_DETECT_ARM_NEON by WEBRTC_DETECT_NEON.
Replace WEBRTC_ARCH_ARM by WEBRTC_ARCH_ARM64 for arm64 cpu.

BUG=4002
R=andrew@webrtc.org, jridges@masque.com, kjellander@webrtc.org

Change-Id: I870a4d0682b80633b671c9aab733153f6d95a980

Review URL: https://webrtc-codereview.appspot.com/49309004

Cr-Commit-Position: refs/heads/master@{#9228}
This commit is contained in:
Andrew MacDonald
2015-05-19 22:20:17 -07:00
parent 4d71edef45
commit cb7f8ce2df
31 changed files with 95 additions and 133 deletions

View File

@ -105,9 +105,9 @@ extern "C" {
#include "webrtc/common_audio/signal_processing/include/spl_inl.h"
// Initialize SPL. Currently it contains only function pointer initialization.
// If the underlying platform is known to be ARM-Neon (WEBRTC_ARCH_ARM_NEON
// defined), the pointers will be assigned to code optimized for Neon; otherwise
// if run-time Neon detection (WEBRTC_DETECT_ARM_NEON) is enabled, the pointers
// If the underlying platform is known to be ARM-Neon (WEBRTC_HAS_NEON defined),
// the pointers will be assigned to code optimized for Neon; otherwise
// if run-time Neon detection (WEBRTC_DETECT_NEON) is enabled, the pointers
// will be assigned to either Neon code or generic C code; otherwise, generic C
// code will be assigned.
// Note that this function MUST be called in any application that uses SPL
@ -154,8 +154,7 @@ void WebRtcSpl_ZerosArrayW32(int32_t* vector,
typedef int16_t (*MaxAbsValueW16)(const int16_t* vector, int length);
extern MaxAbsValueW16 WebRtcSpl_MaxAbsValueW16;
int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int16_t WebRtcSpl_MaxAbsValueW16Neon(const int16_t* vector, int length);
#endif
#if defined(MIPS32_LE)
@ -173,8 +172,7 @@ int16_t WebRtcSpl_MaxAbsValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MaxAbsValueW32)(const int32_t* vector, int length);
extern MaxAbsValueW32 WebRtcSpl_MaxAbsValueW32;
int32_t WebRtcSpl_MaxAbsValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int32_t WebRtcSpl_MaxAbsValueW32Neon(const int32_t* vector, int length);
#endif
#if defined(MIPS_DSP_R1_LE)
@ -194,8 +192,7 @@ int32_t WebRtcSpl_MaxAbsValueW32_mips(const int32_t* vector, int length);
typedef int16_t (*MaxValueW16)(const int16_t* vector, int length);
extern MaxValueW16 WebRtcSpl_MaxValueW16;
int16_t WebRtcSpl_MaxValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int16_t WebRtcSpl_MaxValueW16Neon(const int16_t* vector, int length);
#endif
#if defined(MIPS32_LE)
@ -215,8 +212,7 @@ int16_t WebRtcSpl_MaxValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MaxValueW32)(const int32_t* vector, int length);
extern MaxValueW32 WebRtcSpl_MaxValueW32;
int32_t WebRtcSpl_MaxValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int32_t WebRtcSpl_MaxValueW32Neon(const int32_t* vector, int length);
#endif
#if defined(MIPS32_LE)
@ -236,8 +232,7 @@ int32_t WebRtcSpl_MaxValueW32_mips(const int32_t* vector, int length);
typedef int16_t (*MinValueW16)(const int16_t* vector, int length);
extern MinValueW16 WebRtcSpl_MinValueW16;
int16_t WebRtcSpl_MinValueW16C(const int16_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int16_t WebRtcSpl_MinValueW16Neon(const int16_t* vector, int length);
#endif
#if defined(MIPS32_LE)
@ -257,8 +252,7 @@ int16_t WebRtcSpl_MinValueW16_mips(const int16_t* vector, int length);
typedef int32_t (*MinValueW32)(const int32_t* vector, int length);
extern MinValueW32 WebRtcSpl_MinValueW32;
int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, int length);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int32_t WebRtcSpl_MinValueW32Neon(const int32_t* vector, int length);
#endif
#if defined(MIPS32_LE)
@ -558,8 +552,7 @@ void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
int16_t dim_cross_correlation,
int16_t right_shifts,
int16_t step_seq2);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
void WebRtcSpl_CrossCorrelationNeon(int32_t* cross_correlation,
const int16_t* seq1,
const int16_t* seq2,
@ -724,8 +717,7 @@ int WebRtcSpl_DownsampleFastC(const int16_t* data_in,
int coefficients_length,
int factor,
int delay);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
int data_in_length,
int16_t* data_out,

View File

@ -28,8 +28,8 @@ CrossCorrelation WebRtcSpl_CrossCorrelation;
DownsampleFast WebRtcSpl_DownsampleFast;
ScaleAndAddVectorsWithRound WebRtcSpl_ScaleAndAddVectorsWithRound;
#if (defined(WEBRTC_DETECT_ARM_NEON) || !defined(WEBRTC_ARCH_ARM_NEON)) && \
!defined(MIPS32_LE) && !defined(WEBRTC_ARCH_ARM64_NEON)
#if (defined(WEBRTC_DETECT_NEON) || !defined(WEBRTC_HAS_NEON)) && \
!defined(MIPS32_LE)
/* Initialize function pointers to the generic C version. */
static void InitPointersToC() {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16C;
@ -45,8 +45,7 @@ static void InitPointersToC() {
}
#endif
#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) || \
(defined WEBRTC_ARCH_ARM64_NEON)
#if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
/* Initialize function pointers to the Neon version. */
static void InitPointersToNeon() {
WebRtcSpl_MaxAbsValueW16 = WebRtcSpl_MaxAbsValueW16Neon;
@ -57,8 +56,6 @@ static void InitPointersToNeon() {
WebRtcSpl_MinValueW32 = WebRtcSpl_MinValueW32Neon;
WebRtcSpl_CrossCorrelation = WebRtcSpl_CrossCorrelationNeon;
WebRtcSpl_DownsampleFast = WebRtcSpl_DownsampleFastNeon;
/* TODO(henrik.lundin): re-enable NEON when the crash from bug 3243 is
understood. */
WebRtcSpl_ScaleAndAddVectorsWithRound =
WebRtcSpl_ScaleAndAddVectorsWithRoundC;
}
@ -87,19 +84,19 @@ static void InitPointersToMIPS() {
#endif
static void InitFunctionPointers(void) {
#if defined(WEBRTC_DETECT_ARM_NEON)
#if defined(WEBRTC_DETECT_NEON)
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
InitPointersToNeon();
} else {
InitPointersToC();
}
#elif defined(WEBRTC_ARCH_ARM_NEON) || defined(WEBRTC_ARCH_ARM64_NEON)
#elif defined(WEBRTC_HAS_NEON)
InitPointersToNeon();
#elif defined(MIPS32_LE)
InitPointersToMIPS();
#else
InitPointersToC();
#endif /* WEBRTC_DETECT_ARM_NEON */
#endif /* WEBRTC_DETECT_NEON */
}
#if defined(WEBRTC_POSIX)