Commit c2d81b4
LoongArch: BPF: Optimize sign-extention mov instructions
For 8-bit and 16-bit sign-extention mov instructions, it can use the native
instructions ext.w.b and ext.w.h directly, no need to use the temporary t1
register, just remove the redundant operations.
Here are the test results:
# modprobe test_bpf test_range=81,84
# dmesg -t | tail -5
test_bpf: #81 ALU_MOVSX | BPF_B jited:1 5 PASS
test_bpf: #82 ALU_MOVSX | BPF_H jited:1 5 PASS
test_bpf: #83 ALU64_MOVSX | BPF_B jited:1 5 PASS
test_bpf: #84 ALU64_MOVSX | BPF_H jited:1 5 PASS
test_bpf: Summary: 4 PASSED, 0 FAILED, [4/4 JIT'ed]
Signed-off-by: Tiezhu Yang <[email protected]>
Acked-by: Hengqi Chen <[email protected]>1 parent 721f1da commit c2d81b4
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
531 | | - | |
| 530 | + | |
532 | 531 | | |
533 | 532 | | |
534 | 533 | | |
535 | | - | |
536 | | - | |
| 534 | + | |
537 | 535 | | |
538 | 536 | | |
539 | 537 | | |
| |||
0 commit comments