Remove runtime NEON detection
Chrome does not detect NEON instruction set at runtime in WebRTC code starting with M50, which is now in Stable. Remove support for runtime detection for simplicity. The only remaining piece of Chrome that will continue to depend on runtime detection is /net, where devices with _broken_ neon support are also detected, and it is not configurable via GYP/GN. BUG=522035 NOPRESUBMIT=true Review-Url: https://codereview.webrtc.org/1955413003 Cr-Commit-Position: refs/heads/master@{#12778}
This commit is contained in:
@ -90,7 +90,7 @@ void WebRtcIsacfix_Spec2TimeC(int16_t* inreQ7,
|
||||
int32_t* outre1Q16,
|
||||
int32_t* outre2Q16);
|
||||
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_Time2SpecNeon(int16_t* inre1Q9,
|
||||
int16_t* inre2Q9,
|
||||
int16_t* outre,
|
||||
@ -174,7 +174,7 @@ void WebRtcIsacfix_FilterMaLoopC(int16_t input0,
|
||||
int32_t* ptr1,
|
||||
int32_t* ptr2);
|
||||
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r,
|
||||
const int16_t* __restrict x,
|
||||
int16_t N,
|
||||
|
||||
@ -147,7 +147,7 @@ void WebRtcIsacfix_MatrixProduct2C(const int16_t matrix0[],
|
||||
const int matrix0_index_factor,
|
||||
const int matrix0_index_step);
|
||||
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_MatrixProduct1Neon(const int16_t matrix0[],
|
||||
const int32_t matrix1[],
|
||||
int32_t matrix_product[],
|
||||
|
||||
@ -60,7 +60,7 @@ void WebRtcIsacfix_AllpassFilter2FixDec16C(
|
||||
int32_t *filter_state_ch1,
|
||||
int32_t *filter_state_ch2);
|
||||
|
||||
#if (defined WEBRTC_DETECT_NEON) || (defined WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
|
||||
int16_t *data_ch1,
|
||||
int16_t *data_ch2,
|
||||
|
||||
@ -64,11 +64,7 @@ class FilterBanksTest : public testing::Test {
|
||||
|
||||
TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) {
|
||||
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16C);
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
|
||||
}
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -59,11 +59,7 @@ class FiltersTest : public testing::Test {
|
||||
|
||||
TEST_F(FiltersTest, AutocorrFixTest) {
|
||||
FiltersTester(WebRtcIsacfix_AutocorrC);
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
FiltersTester(WebRtcIsacfix_AutocorrNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
FiltersTester(WebRtcIsacfix_AutocorrNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ int16_t WebRtcIsacfix_FreeInternal(ISACFIX_MainStruct *ISAC_main_inst)
|
||||
* This function initializes function pointers for ARM Neon platform.
|
||||
*/
|
||||
|
||||
#if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
static void WebRtcIsacfix_InitNeon(void) {
|
||||
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
|
||||
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
|
||||
@ -253,11 +253,7 @@ static void InitFunctionPointers(void) {
|
||||
WebRtcIsacfix_MatrixProduct1 = WebRtcIsacfix_MatrixProduct1C;
|
||||
WebRtcIsacfix_MatrixProduct2 = WebRtcIsacfix_MatrixProduct2C;
|
||||
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
WebRtcIsacfix_InitNeon();
|
||||
}
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
WebRtcIsacfix_InitNeon();
|
||||
#endif
|
||||
|
||||
|
||||
@ -57,8 +57,6 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) {
|
||||
ysum32 += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >>
|
||||
scaling;
|
||||
|
||||
// TODO(zhongwei.yao): Move this function into a separate NEON code file so
|
||||
// that WEBRTC_DETECT_NEON could take advantage of it.
|
||||
#ifdef WEBRTC_HAS_NEON
|
||||
{
|
||||
int32_t vbuff[4];
|
||||
|
||||
@ -179,22 +179,14 @@ class TransformTest : public testing::Test {
|
||||
|
||||
TEST_F(TransformTest, Time2SpecTest) {
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecC);
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
Time2SpecTester(WebRtcIsacfix_Time2SpecNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_F(TransformTest, Spec2TimeTest) {
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeC);
|
||||
#ifdef WEBRTC_DETECT_NEON
|
||||
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
|
||||
}
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
Spec2TimeTester(WebRtcIsacfix_Spec2TimeNeon);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user