Skip to content

Add loongarch64 support#294

Merged
zsliu98 merged 2 commits into
ZL-Audio:mainfrom
iv-m:add-riscv64-and-loongarch64-support
Jul 17, 2026
Merged

Add loongarch64 support#294
zsliu98 merged 2 commits into
ZL-Audio:mainfrom
iv-m:add-riscv64-and-loongarch64-support

Conversation

@iv-m

@iv-m iv-m commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

A small series of changes to CMakelists.txt to make ZLEqualizer buildable on loongarch64 and riscv64 linux.

Tested on Loongson LS3A6000 desktop (loongarch64, in both LSX and LASX mode) and a SpacemiT K1 board (riscv64 with RVV) running linux. On both machines ZLEqualizer builds and works with this series applied.

Acknowledgments

By submitting this pull request, I acknowledge and confirm the following:

  • If this is not a multilingual/localization support pull request, I confirm that this feature, fix, or change has been discussed and aligned upon in the repository's Discussions section prior to opening this PR.
  • I agree that all code contributed through this pull request is licensed under the Apache-2.0 License.
  • I certify that I am the sole author and legal owner of this code, or that I have the necessary rights and permissions to contribute it under the specified license without violating any third-party intellectual property.
  • I have manually reviewed this code and verified its functionality.

LoongArch64 architecture provides two SIMD APIs: LSX (with
128-bit registers) and LASX (with 256-bit registers). Both
are supported by highway.

This change allows to compile ZL Equalizer for LoongArch64
linux.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@zsliu98

zsliu98 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for the report. Here are several questions/notes from me (as I don't have the machines to test those instructions):

  • Does the FFT produce the expect result (i.e., the FFT analyzer itself, Matched Phase/Mixed Phase/Zero Phase)?
  • Regarding riscv64: I don't think that the plugin would work perfectly on every computer. RISC-V is variable length SIMD instruction. But when I coded the FFT library, I fix the SIMD width to make the code simpler. Perhaps that is something I should address in the future for RISC-V and SVE.
  • Regarding loongarch64: I would guess that the plugin would work as it is very similar to SSE2/AVX2 (and hopefully Highway is free-of-bug on mapping to loongarch64).

If you are also not very sure about riscv64, perhaps you could remove it from the targets?

@iv-m

iv-m commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Does the FFT produce the expect result (i.e., the FFT analyzer itself, Matched Phase/Mixed Phase/Zero Phase)?

The analyzer seems to work correctly, and equalization works without any surprises with all the "filter strucure" values -- also I just listened to it, so I cannot be 100% that the output is exactly the same as on other architectures.

If you are also not very sure about riscv64, perhaps you could remove it from the targets?

Hmm, ok.

It is strictly advised to use same flags when compliling
and linking, especially when LTO is used.

To avoid breaking builds on OSs I don't have access to,
this change is linux-only.
@iv-m
iv-m force-pushed the add-riscv64-and-loongarch64-support branch from 929bf17 to 5e22fab Compare July 17, 2026 12:20
@iv-m iv-m changed the title Add riscv64 and loongarch64 support Add loongarch64 support Jul 17, 2026
@zsliu98

zsliu98 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I am merging it now.

@zsliu98
zsliu98 merged commit 1a7e14e into ZL-Audio:main Jul 17, 2026
4 checks passed
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.

2 participants