Messages in this thread | | | From | Luke Nelson <> | Date | Tue, 25 Jun 2019 13:26:21 -0700 | Subject | Re: [RFC PATCH bpf-next] RV32G eBPF JIT |
| |
On Mon, Jun 24, 2019 at 9:45 AM Jiong Wang <jiong.wang@netronome.com> wrote: > > Looks to me 32-bit optimization is not enabled. > > If you define bpf_jit_needs_zext to return true > > bool bpf_jit_needs_zext(void) > { > return true; > } > > Then you don't need to zero high 32-bit when writing 32-bit sub-register > and you just need to implement the explicit zero extension insn which is a > special variant of BPF_MOV. This can save quite a few instructions. RV64 > and arches like arm has implemented this, please search > "aux->verifier_zext". > > And there is a doc for this optimization: > > https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/Documentation/bpf/bpf_design_QA.rst#n168
Thanks for the pointer. I'll add this optimization before sending out an updated version of the patch.
– Luke
| |