Skip to content

Commit 592a6d9

Browse files
committed
audioflinger: Enable ARMv5TE optimized resampler
Previously, the optimized asm option is only enabled when __ARM_ARCH_5E__ is defined, which is assigned in armv5te.mk rather than armv7-a series targets. This patch checks the ARM CPU feature about half-word multiply instructions to enable ARMv5TE resampler optimization routines properly. Change-Id: I4c5a5d8c932416f23bedb0b389db958349f21ea4
1 parent 9907d16 commit 592a6d9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

services/audioflinger/AudioResampler.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@
2626
#include "AudioResamplerSinc.h"
2727
#include "AudioResamplerCubic.h"
2828

29+
#ifdef __arm__
30+
#include <machine/cpu-features.h>
31+
#endif
32+
2933
namespace android {
3034

31-
#ifdef __ARM_ARCH_5E__ // optimized asm option
35+
#ifdef __ARM_HAVE_HALFWORD_MULTIPLY // optimized asm option
3236
#define ASM_ARM_RESAMP1 // enable asm optimisation for ResamplerOrder1
33-
#endif // __ARM_ARCH_5E__
37+
#endif // __ARM_HAVE_HALFWORD_MULTIPLY
3438
// ----------------------------------------------------------------------------
3539

3640
class AudioResamplerOrder1 : public AudioResampler {

0 commit comments

Comments
 (0)