From d730b288c8873d6459250327be02c1895c86e652 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 7 Jan 2015 21:34:23 +0000 Subject: [PATCH] Remove WebRtcSpl_ScaleAndAddVectorsWithRoundNeon This function isn't used anymore. The file and header are also removed. BUG=4002,3273 R=andrew@webrtc.org Change-Id: I4b65dec57e6adc2ac2253031501f3b6de6937fac Review URL: https://webrtc-codereview.appspot.com/35519004 Patch from Yang Zhang . git-svn-id: http://webrtc.googlecode.com/svn/trunk@8019 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/common_audio/BUILD.gn | 1 - webrtc/common_audio/common_audio.gyp | 1 - .../include/signal_processing_library.h | 9 -- .../vector_scaling_operations_neon.S | 82 ------------------- 4 files changed, 93 deletions(-) delete mode 100644 webrtc/common_audio/signal_processing/vector_scaling_operations_neon.S diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn index 406a50940d..1a077c6bb2 100644 --- a/webrtc/common_audio/BUILD.gn +++ b/webrtc/common_audio/BUILD.gn @@ -196,7 +196,6 @@ if (rtc_build_armv7_neon) { "signal_processing/cross_correlation_neon.S", "signal_processing/downsample_fast_neon.S", "signal_processing/min_max_operations_neon.S", - "signal_processing/vector_scaling_operations_neon.S", ] configs += [ "..:common_config" ] diff --git a/webrtc/common_audio/common_audio.gyp b/webrtc/common_audio/common_audio.gyp index b6a30abbf0..76519c26cc 100644 --- a/webrtc/common_audio/common_audio.gyp +++ b/webrtc/common_audio/common_audio.gyp @@ -200,7 +200,6 @@ 'signal_processing/cross_correlation_neon.S', 'signal_processing/downsample_fast_neon.S', 'signal_processing/min_max_operations_neon.S', - 'signal_processing/vector_scaling_operations_neon.S', ], 'conditions': [ # Disable LTO in common_audio_neon target due to compiler bug diff --git a/webrtc/common_audio/signal_processing/include/signal_processing_library.h b/webrtc/common_audio/signal_processing/include/signal_processing_library.h index 2bdfc23ce0..f60f2542d9 100644 --- a/webrtc/common_audio/signal_processing/include/signal_processing_library.h +++ b/webrtc/common_audio/signal_processing/include/signal_processing_library.h @@ -383,15 +383,6 @@ int WebRtcSpl_ScaleAndAddVectorsWithRoundC(const int16_t* in_vector1, int right_shifts, int16_t* out_vector, int length); -#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON) -int WebRtcSpl_ScaleAndAddVectorsWithRoundNeon(const int16_t* in_vector1, - int16_t in_vector1_scale, - const int16_t* in_vector2, - int16_t in_vector2_scale, - int right_shifts, - int16_t* out_vector, - int length); -#endif #if defined(MIPS_DSP_R1_LE) int WebRtcSpl_ScaleAndAddVectorsWithRound_mips(const int16_t* in_vector1, int16_t in_vector1_scale, diff --git a/webrtc/common_audio/signal_processing/vector_scaling_operations_neon.S b/webrtc/common_audio/signal_processing/vector_scaling_operations_neon.S deleted file mode 100644 index 07db741b00..0000000000 --- a/webrtc/common_audio/signal_processing/vector_scaling_operations_neon.S +++ /dev/null @@ -1,82 +0,0 @@ -@ -@ Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. -@ -@ Use of this source code is governed by a BSD-style license -@ that can be found in the LICENSE file in the root of the source -@ tree. An additional intellectual property rights grant can be found -@ in the file PATENTS. All contributing project authors may -@ be found in the AUTHORS file in the root of the source tree. -@ - -@ vector_scaling_operations_neon.s -@ This file contains the function WebRtcSpl_ScaleAndAddVectorsWithRoundNeon(), -@ optimized for ARM Neon platform. Output is bit-exact with the reference -@ C code in vector_scaling_operations.c. - -#include "webrtc/system_wrappers/interface/asm_defines.h" - -GLOBAL_FUNCTION WebRtcSpl_ScaleAndAddVectorsWithRoundNeon -.align 2 -DEFINE_FUNCTION WebRtcSpl_ScaleAndAddVectorsWithRoundNeon - push {r4-r9} - - ldr r4, [sp, #32] @ length - ldr r5, [sp, #28] @ out_vector - ldrsh r6, [sp, #24] @ right_shifts - - cmp r4, #0 - ble END @ Return if length <= 0. - - cmp r4, #8 - blt SET_ROUND_VALUE - - vdup.16 d26, r1 @ in_vector1_scale - vdup.16 d27, r3 @ in_vector2_scale - - @ Neon instructions can only right shift by an immediate value. To shift right - @ by a register value, we have to do a left shift left by the negative value. - rsb r7, r6, #0 - vdup.16 q12, r7 @ -right_shifts - - bic r7, r4, #7 @ Counter for LOOP_UNROLLED_BY_8: length / 8 * 8. - -LOOP_UNROLLED_BY_8: - vld1.16 {d28, d29}, [r0]! @ in_vector1[] - vld1.16 {d30, d31}, [r2]! @ in_vector2[] - vmull.s16 q0, d28, d26 - vmull.s16 q1, d29, d26 - vmull.s16 q2, d30, d27 - vmull.s16 q3, d31, d27 - vadd.s32 q0, q2 - vadd.s32 q1, q3 - vrshl.s32 q0, q12 @ Round shift right by right_shifts. - vrshl.s32 q1, q12 - vmovn.i32 d0, q0 @ Cast to 16 bit values. - vmovn.i32 d1, q1 - subs r7, #8 - vst1.16 {d0, d1}, [r5]! - bgt LOOP_UNROLLED_BY_8 - - ands r4, #0xFF @ Counter for LOOP_NO_UNROLLING: length % 8. - beq END - -SET_ROUND_VALUE: - mov r9, #1 - lsl r9, r6 - lsr r9, #1 - -LOOP_NO_UNROLLING: - ldrh r7, [r0], #2 - ldrh r8, [r2], #2 - smulbb r7, r7, r1 - smulbb r8, r8, r3 - subs r4, #1 - add r7, r9 - add r7, r8 - asr r7, r6 - strh r7, [r5], #2 - bne LOOP_NO_UNROLLING - -END: - pop {r4-r9} - bx lr