qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/25] target/i386: more progress towards new decoder
@ 2024-06-08  8:40 Paolo Bonzini
  2024-06-08  8:40 ` [PATCH 01/25] target/i386: remove CPUX86State argument from generator functions Paolo Bonzini
                   ` (24 more replies)
  0 siblings, 25 replies; 56+ messages in thread
From: Paolo Bonzini @ 2024-06-08  8:40 UTC (permalink / raw)
  To: qemu-devel

Just like in previous installments, this series ends with a specific
thing that is now done entirely in the new decoder.  After removing
the legacy prefix decoding in the previous series, now it's _all_ decoding
that is done by decode-new.c.inc.  Most two byte opcodes are converted,
leaving out only five plus the x87 instructions, but even those only
use the X86DecodedInsn; they do not use anymore the CPUX86State (env)
to fetch bytes from the instruction stream.

The only reason why those five are left behind is that the decoding is a
bit gnarly and, having little or no commonality with the other opcodes,
there isn't much duplication between translate.c and emit.c.inc that
supports them.

It's nothing that's particularly hard, but this is just a nice place
to stop for now; and also I think it's enough to implement APX's 32
GPRs and REX2 prefix without the legacy translator getting in the way.
Of course APX quite some more work---there's all the EVEX special cases
and flags, and the new conditional instructions (CFCMOV, CCMP, CTEST)
to consider---but it's a start.

As in previous installments, there is some reduction in the total number
of lines of code, which is a bit surprising; but then again many of these
opcodes have modrm bytes for which there a lot of repeated lines, and
also it's possible to share some existing emit.c.inc code (for example
SHLD/SHRD mostly reuse the flag computations of SHL/SHR).

Patches 1-7: simplifications/cleanups in decode-new.c.inc

Patches 8-20: move all two-byte opcodes except for 00/01/1A/1B/C7
to new decoder.

Patches 21-25: move decoding of modrm bytes entirely to new decoder,
and cleanup.

Paolo Bonzini (25):
  target/i386: remove CPUX86State argument from generator functions
  target/i386: rewrite flags writeback for ADCX/ADOX
  target/i386: put BLS* input in T1, use generic flag writeback
  target/i386: change X86_ENTRYr to use T0
  target/i386: change X86_ENTRYwr to use T0, use it for moves
  target/i386: replace NoSeg special with NoLoadEA
  target/i386: fix processing of intercept 0 (read CR0)
  target/i386: convert MOV from/to CR and DR to new decoder
  target/i386: fix bad sorting of entries in the 0F table
  target/i386: finish converting 0F AE to the new decoder
  target/i386: replace read_crN helper with read_cr8
  target/i386: split X86_CHECK_prot into PE and VM86 checks
  target/i386: convert non-grouped, helper-based 2-byte opcodes
  target/i386: convert bit test instructions to new decoder
  target/i386: pull load/writeback out of gen_shiftd_rm_T1
  target/i386: adapt gen_shift_count for SHLD/SHRD
  target/i386: convert SHLD/SHRD to new decoder
  target/i386: convert LZCNT/TZCNT/BSF/BSR/POPCNT to new decoder
  target/i386: convert XADD to new decoder
  target/i386: convert CMPXCHG to new decoder
  target/i386: decode address before going back to translate.c
  target/i386: list instructions still in translate.c
  target/i386: assert that cc_op* and pc_save are preserved
  target/i386: do not check PREFIX_LOCK in old-style decoder
  target/i386: remove gen_ext_tl

 target/i386/cpu.h                    |    9 +-
 target/i386/helper.h                 |    2 +-
 target/i386/tcg/decode-new.h         |   46 +-
 target/i386/tcg/seg_helper.c         |   16 +-
 target/i386/tcg/sysemu/misc_helper.c |   20 +-
 target/i386/tcg/translate.c          | 1089 ++--------------------
 target/i386/tcg/decode-new.c.inc     |  473 +++++++---
 target/i386/tcg/emit.c.inc           | 1290 +++++++++++++++++++-------
 8 files changed, 1417 insertions(+), 1528 deletions(-)

-- 
2.45.1



^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2024-10-21 13:55 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-08  8:40 [PATCH 00/25] target/i386: more progress towards new decoder Paolo Bonzini
2024-06-08  8:40 ` [PATCH 01/25] target/i386: remove CPUX86State argument from generator functions Paolo Bonzini
2024-06-08 14:47   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 02/25] target/i386: rewrite flags writeback for ADCX/ADOX Paolo Bonzini
2024-06-08 18:05   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 03/25] target/i386: put BLS* input in T1, use generic flag writeback Paolo Bonzini
2024-06-08 18:07   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 04/25] target/i386: change X86_ENTRYr to use T0 Paolo Bonzini
2024-06-08 18:10   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 05/25] target/i386: change X86_ENTRYwr to use T0, use it for moves Paolo Bonzini
2024-06-08 18:13   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 06/25] target/i386: replace NoSeg special with NoLoadEA Paolo Bonzini
2024-06-08 18:16   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 07/25] target/i386: fix processing of intercept 0 (read CR0) Paolo Bonzini
2024-06-08 18:17   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 08/25] target/i386: convert MOV from/to CR and DR to new decoder Paolo Bonzini
2024-06-08 18:24   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 09/25] target/i386: fix bad sorting of entries in the 0F table Paolo Bonzini
2024-06-08 18:26   ` Richard Henderson
2024-06-08  8:40 ` [PATCH 10/25] target/i386: finish converting 0F AE to the new decoder Paolo Bonzini
2024-06-08 18:42   ` Richard Henderson
2024-10-21  1:49   ` Guenter Roeck
2024-10-21  6:57     ` Paolo Bonzini
2024-10-21 13:54       ` Guenter Roeck
2024-06-08  8:40 ` [PATCH 11/25] target/i386: replace read_crN helper with read_cr8 Paolo Bonzini
2024-06-08 18:45   ` Richard Henderson
2024-06-10 17:14     ` Paolo Bonzini
2024-06-08  8:41 ` [PATCH 12/25] target/i386: split X86_CHECK_prot into PE and VM86 checks Paolo Bonzini
2024-06-08 18:47   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 13/25] target/i386: convert non-grouped, helper-based 2-byte opcodes Paolo Bonzini
2024-06-08 19:03   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 14/25] target/i386: convert bit test instructions to new decoder Paolo Bonzini
2024-06-08 19:37   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 15/25] target/i386: pull load/writeback out of gen_shiftd_rm_T1 Paolo Bonzini
2024-06-08 19:39   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 16/25] target/i386: adapt gen_shift_count for SHLD/SHRD Paolo Bonzini
2024-06-08 19:42   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 17/25] target/i386: convert SHLD/SHRD to new decoder Paolo Bonzini
2024-06-08 19:47   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 18/25] target/i386: convert LZCNT/TZCNT/BSF/BSR/POPCNT " Paolo Bonzini
2024-06-08 19:53   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 19/25] target/i386: convert XADD " Paolo Bonzini
2024-06-08 20:00   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 20/25] target/i386: convert CMPXCHG " Paolo Bonzini
2024-06-08 20:04   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 21/25] target/i386: decode address before going back to translate.c Paolo Bonzini
2024-06-08 20:13   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 22/25] target/i386: list instructions still in translate.c Paolo Bonzini
2024-06-08 20:14   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 23/25] target/i386: assert that cc_op* and pc_save are preserved Paolo Bonzini
2024-06-08 20:14   ` Richard Henderson
2024-06-08  8:41 ` [PATCH 24/25] target/i386: do not check PREFIX_LOCK in old-style decoder Paolo Bonzini
2024-06-08 20:15   ` Richard Henderson
2024-06-10 17:10     ` Paolo Bonzini
2024-06-08  8:41 ` [PATCH 25/25] target/i386: remove gen_ext_tl Paolo Bonzini
2024-06-08 20:17   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).