Re: [PATCH] LoongArch: BPF: Optimize doubleword loads with ld.d and ldptr.d

From: George Guo

Date: Fri Dec 04 2026 - 02:11:23 EST


On 2026/11/18 16:12, Tiezhu Yang wrote:
> Optimize these loads by emitting ld.d for signed 12-bit offsets and
> ldptr.d for 4-byte aligned signed 16-bit offsets, or falling back to
> move_imm() + ldx.d when necessary.

Tested on Loongson-3C6000, together with "LoongArch: BPF: Fix the offset
of stptr.w and stptr.d stores". The jit_insns tests passed, including
the ldst_offsets subtests:

$ sudo ./test_progs -t jit_insns,jit_insns_blinded
...
#196/26 jit_insns/ldst_offsets:OK
...
#196 jit_insns:OK
...
#197/11 jit_insns_blinded/ldst_offsets:OK
...
#197 jit_insns_blinded:OK
Summary: 2/47 PASSED, 0 SKIPPED, 0/0 FAILED

Reviewed-by: George Guo <guodongtai@xxxxxxxxxx>
Tested-by: George Guo <guodongtai@xxxxxxxxxx>

Thanks,
George