Skip to content

Convert MUL/DIV to fastop

Avi Kivity kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: x86 emulator: add support for writing back the source operandarch/x86/kvm/emulate.c+26 -211 reply
2/8KVM: x86 emulator: decode extended accumulator explicityarch/x86/kvm/emulate.c+22 -02 replies
3/8KVM: x86 emulator: switch MUL/DIV to DstXaccarch/x86/kvm/emulate.c+8 -70 replies
4/8KVM: x86 emulator: Switch fastop src operand to RDXarch/x86/kvm/emulate.c+13 -130 replies
5/8KVM: x86 emulator: convert single-operand MUL/IMUL to fastoparch/x86/kvm/emulate.c+16 -190 replies
6/8KVM: x86 emulator: convert DIV/IDIV to fastoparch/x86/kvm/emulate.c+26 -251 reply
7/8KVM: x86 emulator: drop unused old-style inline emulationarch/x86/kvm/emulate.c+0 -1980 replies
8/8KVM: x86 emulator: convert XADD to fastoparch/x86/kvm/emulate.c+3 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Convert MUL/DIV to fastop

This patchset converts MUL/DIV to fastop. We depart from the plan, which was to encode rdx:rax as a single operand, and instead encode it as two separate operands. This reduces register pressure on i386, and is simpler besides.

As a bonus, XADD is converted as well.

The series results in a nice code size reduction:

  60147	      0	      0	  60147	   eaf3	arch/x86/kvm/emulate.o.before
  56899	      0	      0	  56899	   de43	arch/x86/kvm/emulate.o.after

Avi Kivity (8):
KVM: x86 emulator: add support for writing back the source operand
KVM: x86 emulator: decode extended accumulator explicity
KVM: x86 emulator: switch MUL/DIV to DstXacc
KVM: x86 emulator: Switch fastop src operand to RDX
KVM: x86 emulator: convert single-operand MUL/IMUL to fastop
KVM: x86 emulator: convert DIV/IDIV to fastop
KVM: x86 emulator: drop unused old-style inline emulation
KVM: x86 emulator: convert XADD to fastop

 arch/x86/kvm/emulate.c | 388 ++++++++++++++-----------------------------------
 1 file changed, 106 insertions(+), 282 deletions(-)
Signature · 1 line
1.8.1.2