-
Notifications
You must be signed in to change notification settings - Fork 694
Refresh MIPS support #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refresh MIPS support #416
Conversation
Due to historical reasons __builtin_clz result is undefined for 0. Fix that in MIPS port. Signed-off-by: Siarhei Volkau <[email protected]>
silk_CLZ16 MIPS port does sign extension from opus_int16 to opus_int32. In case of negative input it will return -16 instead of expected 0. Input should be zero extended for mips_clz / __builtin_clz. Signed-off-by: Siarhei Volkau <[email protected]>
While 32-bit MIPS doesn't fit for rules described for OPUS_FAST_INT64 enabling, it has fast 32x32 multiplication with full 64-bit result. That's enough to enable OPUS_FAST_INT64 for any MIPS since OPUS_FAST_INT64 guards various multiplication implementation. Maybe it's worth to get it more precise name? e.g. OPUS_FAST_MULT. GCC macro __mips covers both 32- and 64-bit MIPS. Signed-off-by: Siarhei Volkau <[email protected]>
Current MIPS port supports special implementation for CPUs with DSP extension support. It is enabled by setting MIPSr1_ASM flag for compiler. The name MIPSr1_ASM is very confusing, r1 might mean: - MIPS I - MIPS32/MIPS64 release 1 - MIPS DSP ASE revision 1 (the correct one) Let's remove it and check GCC's builtin define __mips_dsp instead. This allows use default autotools build system instead of hand-crafted makefile. Signed-off-by: Siarhei Volkau <[email protected]>
Looks like MIPS port is abandoned? Not surprised though. There's a lot of updates for mdct too, will be addressed in another patch. Signed-off-by: Siarhei Volkau <[email protected]>
GCC supports all MIPS DSP and DSPr2 instructions in form of builtin functions, this is more convenient way rather than inline assembly. Moreover, performance on MIPS heavily depends on instruction scheduling GCC is unable to schedule inline assembly properly because it doesn't know what exactly the asm routine do. Signed-off-by: Siarhei Volkau <[email protected]>
Changes from C version of MDCT algo ported into MIPS variant. Signed-off-by: Siarhei Volkau <[email protected]>
Android build failures are unrelated breakage. |
@SiarheiVolkau thanks for the patches! It would be easier to review if you referenced the commits with the mdct updates you're porting to the mips implementation in the commit messages. |
@rillian well, it is all commits that update |
This PR address issues with MIPS platform support.
Tests ran in QEMU and on real hardware (MIPS32r2 + DSP, soft-float) and all passed
for both float and fixed versions.