Re: [PATCH bpf-next v2 2/2] bpf, mips: Add support for BPF_SDIV and BPF_SMOD

From: Johan Almbladh

Date: Sat Aug 01 2026 - 05:45:16 EST


Hi Nicholas,

Thanks for putting in the work on this.

> I'm working on separate MOVSX and MEMSX patches. Would you be willing to
> take BSWAP and JMP32_JA?

Yes. I think BSWAP and JMP32_JA will be independent of the SDIV/SMOD
and MOVSX/MEMSX handling, so we can work in parallel on this.

> I'll pass the raw s16 off value through immediate validation and
> register emission, and interpret off == 1 only in DIV/MOD-specific paths.
> That leaves MOVSX free to interpret off as its source width.

Great.

> I will validate each series boundary on MIPS32r2, MIPS64r2, MIPS32r6, and
> MIPS64r6, and build the complete v3 together with the MOVSX and MEMSX
> candidates before posting it.

Good. I also have a QEMU test setup that I will use for verification:
mips32, mips32r2, mips32r6 and mips64 (pre-R6), both big and little
endian.

> Does that sound ok?

Yes, sounds like a good plan.

Thanks,
Johan