opus: gate the ARMv5E kernels for ARMv6 too

Four `ARM_ARCH == 5` checks -- in SOURCES and celt/arm/{bands_arm,
comb_filter_arm,vq_arm}.h -- excluded ARMv6 from every ARMv5E kernel:
denorm_band, haar1, comb_filter_const, celt_sat, deemphasis_stereo_simple,
exp_rotation1 and normres_scale all silently fell back to plain C on
ARM1136/ARM1176, since ARMv6 is a strict superset of the EDSP instructions
those kernels use. Widened to ARM_ARCH >= 5, matching config.h's own
OPUS_ARM_INLINE_EDSP gate, which was already ARM_ARCH > 4.

These four can't be fixed at the commits that introduced them: those
commits are already merged into master under different SHAs. A fifth
instance of the same bug, in celt/arm/mdct_armv5e.h, was fixed at its
origin commit instead, since that one is still open for review.

Verified on both native ARMv6 targets (iPod Nano 4G, ARM1176JZ-S; Gigabeat
S, ARM1136JF-S) and the hosted Samsung YP-R0 (ARM1176JZ-S, cross toolchain
built for the occasion): all three now link and call all 16 ARMv5E
kernels, where they linked and called zero before this fix. Decoded PCM
bit-identical to the ARMv5E build under qemu.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Change-Id: I7e6f6b421b9c0203812fb45d2258c7eb81738d98
This commit is contained in:
Michael Giacomelli 2026-09-23 19:58:16 -04:00 • committed by Solomon Peachy
parent 5a6935047e
commit b12ef5e6f8
4 changed files with 5 additions and 3 deletions

View file

@ -42,7 +42,7 @@ void denorm_band_armv4(celt_sig *f, const celt_norm *x, int n, int g,
int shift);
# define DENORM_BAND denorm_band_armv4
# elif defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH == 5)
# elif defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH >= 5)
# define OVERRIDE_DENORM_BAND
void denorm_band_armv5e(celt_sig *f, const celt_norm *x, int n, int g,

View file

@ -61,7 +61,7 @@ void deemph_stereo_armv4(celt_sig *x0, celt_sig *x1, opus_val16 *pcm, int N,
# define deemphasis_stereo_simple(in, pcm, N, coef0, mem) \
deemph_stereo_armv4((in)[0], (in)[1], (pcm), (N), (coef0), (mem))
# elif defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH == 5)
# elif defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH >= 5)
# define OVERRIDE_COMB_FILTER_CONST
void comb_filter_const_armv5e(opus_val32 *y, opus_val32 *x, int T, int N,

View file

@ -36,7 +36,7 @@
Shares OPUS_ARM_NO_BANDS_ASM with arm/bands_arm.h as the escape hatch. */
#if defined(FIXED_POINT) && !defined(OPUS_ARM_NO_BANDS_ASM) \
&& defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH == 5)
&& defined(OPUS_ARM_INLINE_EDSP) && (ARM_ARCH >= 5)
#define OVERRIDE_vq_exp_rotation1
void exp_rotation1_armv5e(celt_norm *X, int len, int stride, opus_val16 c,

View file

@ -87,6 +87,8 @@
#define OPUS_ARM_NO_MDCT_ASM
#define OPUS_ARM_NO_PITCH_ASM
#define OPUS_NO_PFA
#define OPUS_ARM_NO_COMB_ASM
#define OPUS_ARM_NO_BANDS_ASM
#endif
#endif /* ARM_ARCH */