Skip to content

ltpf: add Arm Helium (MVE) SIMD backend - #90

Open
JUSTiceMaMo wants to merge 2 commits into
google:mainfrom
JUSTiceMaMo:ltpf-mve
Open

JUSTiceMaMo wants to merge 2 commits into
google:mainfrom
JUSTiceMaMo:ltpf-mve

Conversation

@JUSTiceMaMo

Copy link
Copy Markdown

Summary

Add an M-Profile Vector Extension (MVE / Arm Helium) backend for the LTPF pitch-detection hotspot, mirroring the existing NEON and Arm-DSP backends.

dot / correlate use vmlaldavaq_s16 (8-lane int16 -> int64 multiply-accumulate). The integer sum and the (v + 32) >> 6 rounding match the scalar reference exactly, so the output is bit-exact.

The header is guarded by #if (__ARM_FEATURE_MVE & 1) and is inert on non-MVE targets, so existing scalar / NEON / DSP builds are unchanged.

Measurements

On-device (Cortex-M55 @197 MHz, 16 kHz mono LC3 encode):

  • LTPF correlate: 15105 -> 8370 cyc/frame (~ -44%)
  • Encoder output bit-exact vs the scalar path (FNV-1a checksum identical)

Testing

  • make test passes locally.
  • Encoder bitstream verified bit-exact against the scalar reference.

Add an M-Profile Vector Extension (MVE) backend for the LTPF
pitch-detection hotspot, mirroring the existing NEON and Arm-DSP
backends. `dot` / `correlate` use vmlaldavaq_s16 (8-lane int16 -> int64
multiply-accumulate); the integer sum and the (v + 32) >> 6 rounding
match the scalar reference exactly, so the output is bit-exact.

The header is guarded by `#if (__ARM_FEATURE_MVE & 1)` and is inert on
non-MVE targets, so existing scalar / NEON / DSP builds are unchanged.

Measured on-device (Cortex-M55 @197 MHz, 16 kHz mono LC3 encode):
 - LTPF correlate: 15105 -> 8370 cyc/frame (about -44%)
 - encoder output bit-exact vs the scalar path (FNV-1a checksum identical)

Signed-off-by: zhangyi101 <zhangyi101@xiaomi.com>
@google-cla

google-cla Bot commented Sep 14, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Add host coverage for the LTPF Arm Helium (MVE) backend, mirroring the
existing `test/arm` and `test/neon` suites. Previously the MVE `dot` /
`correlate` paths had no automated coverage: the reference tests run the
scalar path on x86, and only ARM and NEON had backend unit tests.

`test/mve/mve.h` provides a small host emulation of the two intrinsics
used by the backend (`vldrhq_s16`, `vmlaldavaq_s16`), matching the
`test/neon/neon.h` and `test/arm/simd32.h` approach, so the backend
compiles and runs on the CI host. `test/mve/ltpf_mve.c` compiles
`ltpf.c` with `TEST_MVE` defined and checks `mve_dot` / `mve_correlate`
against the scalar reference for bit-exactness.

`ltpf_mve.h` gains a `TEST_MVE` hook (guard opt-in and the `dot` /
`correlate` overrides wrapped in `#ifndef TEST_MVE`) so both the scalar
and MVE versions are visible to the test, and so the MVE backend stays
inert while the ARM / NEON tests build.

Signed-off-by: zhangyi101 <zhangyi101@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant