OSDN Git Service

bpf,x64 Emit IMUL instead of MUL for x86-64
authorJie Meng <jmeng@fb.com>
Mon, 13 Sep 2021 21:13:37 +0000 (14:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Sep 2021 01:36:36 +0000 (18:36 -0700)
commitc0354077439bc9adcc9f2c96d6bbaf8b13748317
treea17537ada6a89d129640bf568c2d0ea38d1c4541
parent67dfac47dac67a44d5bbdab2541a35ce33a2729a
bpf,x64 Emit IMUL instead of MUL for x86-64

IMUL allows for multiple operands and saving and storing rax/rdx is no
longer needed. Signedness of the operands doesn't matter here because
the we only keep the lower 32/64 bit of the product for 32/64 bit
multiplications.

Signed-off-by: Jie Meng <jmeng@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210913211337.1564014-1-jmeng@fb.com
arch/x86/net/bpf_jit_comp.c
tools/testing/selftests/bpf/verifier/jit.c