From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH for-1.8 00/61] target-i386 improvements
Date: Thu, 7 Nov 2013 11:04:23 +1000 [thread overview]
Message-ID: <1383786324-18415-1-git-send-email-rth@twiddle.net> (raw)
This started out merely to update the i386 target to use the
new tcg_gen_qemu_{ld,st}_{i32,i64,tl} entry points. This goal
is complete around patch 18.
But in the process of doing that, I noticed a lot of room for
cleanup wrt "helper" functions that only obfuscate the goal.
That's primarily what all of the "Remove" patches are about.
We also had "size-like" variables in two different domains:
(1) the operand-type ("ot") domain using OT_{BYTE,WORD,LONG,QUAD},
which was log2(byte_size); and (2) the dflag/aflag domain using
bare integer constants which was log2(byte_size)-1. Moving to the
log2(byte_size) domain using MO_SIZE constants cleans up everything
nicely, reducing confusion.
Finally, there are a set of bugs fixed with regard to failing to
zero-extend 32-bit addresses in the x86-64 translator. This is
easiest to see in patch 38 (Fix addr32 prefix in gen_lea_modrm)
which fixes an existing test case. But I believe that introducing
gen_lea_v_seg and using it everywhere fixes quite a few similar
bugs that would be more difficult to notice.
This does wind up adding some zero-extensions that by inspection
can be seen to be redundant (each generated by different subroutines),
but I believe the tcg optimizer improvements that Aurelien has
posted (but not committed) would clean those up.
r~
Richard Henderson (61):
exec: Delay CPU_LOG_TB_CPU until we actually execute a TB
target-i386: Push DisasContext into load/store helpers
target-i386: Stop encoding DisasContext.mem_index
target-i386: Use new tcg_gen_qemu_ld_* helpers
target-i386: Use new tcg_gen_qemu_st_* helpers
target-i386: Replace OT_* constants with MO_* constants
target-i386: Remove gen_op_ld_T0_A0
target-i386: Remove gen_op_ldu_T0_A0
target-i386: Remove gen_op_ld_T1_A0
target-i386: Remove gen_op_lds_T0_A0
target-i386: Introduce gen_op_st_rm_T0_A0
target-i386: Remove gen_op_st_T0_A0
target-i386: Remove gen_op_st_T1_A0
target-i386: Fix typo in gen_push_T1
target-i386: Tidy mov[sz][bw]
target-i386: Tidy movsl
target-i386: Remove unused arguments to gen_lea_modrm
target-i386: Use MO_BE for movbe
target-i386: Tidy gen_op_mov_TN_reg+tcg_gen_trunc_tl_i32
target-i386: Tidy load + truncate
target-i386: Tidy extend + store
target-i386: Tidy extend + move
target-i386: Remove gen_op_movl_T0_0
target-i386: Remove gen_op_movl_T0_im*
target-i386: Remove gen_op_movl_T0_im*
target-i386: Remove gen_op_mov*_A0_im
target-i386: Remove gen_movtl_T*_im
target-i386: Remove gen_op_andl_T0_ffff
target-i386: Remove gen_op_andl_T0_im
target-i386: Remove gen_op_movl_T0_T1
target-i386: Remove gen_op_andl_A0_ffff
target-i386: Use TCGMemOp for 'ot' variables
target-i386: Change gen_op_add_reg_* size parameter to TCGMemOp
target-i386: Change gen_op_j*z_ecx size parameter to TCGMemOp
target-i386: Change aflag to TCGMemOp
target-i386: Change gen_op_mov_reg_A0 size parameter to TCGMemOp
target-i386: Change dflag to TCGMemOp
target-i386: Fix addr32 prefix in gen_lea_modrm
target-i386: Tidy addr16 code in gen_lea_modrm
target-i386: Combine gen_push_T* into gen_push_v
target_i386: Clean up gen_pop_T0
target-i386: Create gen_lea_v_seg
target-i386: Use gen_lea_v_seg in gen_lea_modrm
target-i386: Use gen_lea_v_seg in stack subroutines
target-i386: Tidy cpu_regs initialization
target-i386: Access segs via TCG registers
target-i386: Use gen_lea_v_seg in pusha/popa
target-i386: Rewrite gen_enter inline
target-i386: Introduce mo_stacksize
target-i386: Rewrite leave
target-i386: Remove gen_op_mov_reg_T0
target-i386: Remove gen_op_mov_reg_T1
target-i386: Remove gen_op_addl_T0_T1
target-i386: Remove gen_op_mov_TN_reg
target-i386: Remove gen_op_mov_reg_A0
target-i386: Remove gen_op_movl_A0_reg
target-i386: Tidy gen_add_A0_im
target-i386: Tidy some size computation
target-i386: Rename gen_op_jmp_T0 to gen_op_jmp_v
target-i386: Tidy ljmp
target-i386: Deconstruct the cpu_T array
cpu-exec.c | 36 +-
target-i386/helper.h | 4 -
target-i386/seg_helper.c | 68 -
target-i386/translate.c | 3806 ++++++++++++++++++++--------------------------
4 files changed, 1654 insertions(+), 2260 deletions(-)
--
1.8.3.1
next reply other threads:[~2013-11-07 1:06 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 1:04 Richard Henderson [this message]
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 01/61] exec: Delay CPU_LOG_TB_CPU until we actually execute a TB Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 02/61] target-i386: Push DisasContext into load/store helpers Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 03/61] target-i386: Stop encoding DisasContext.mem_index Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 04/61] target-i386: Use new tcg_gen_qemu_ld_* helpers Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 05/61] target-i386: Use new tcg_gen_qemu_st_* helpers Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 06/61] target-i386: Replace OT_* constants with MO_* constants Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 07/61] target-i386: Remove gen_op_ld_T0_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 08/61] target-i386: Remove gen_op_ldu_T0_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 09/61] target-i386: Remove gen_op_ld_T1_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 10/61] target-i386: Remove gen_op_lds_T0_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 11/61] target-i386: Introduce gen_op_st_rm_T0_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 12/61] target-i386: Remove gen_op_st_T0_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 13/61] target-i386: Remove gen_op_st_T1_A0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 14/61] target-i386: Fix typo in gen_push_T1 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 15/61] target-i386: Tidy mov[sz][bw] Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 16/61] target-i386: Tidy movsl Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 17/61] target-i386: Remove unused arguments to gen_lea_modrm Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 18/61] target-i386: Use MO_BE for movbe Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 19/61] target-i386: Tidy gen_op_mov_TN_reg+tcg_gen_trunc_tl_i32 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 20/61] target-i386: Tidy load + truncate Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 21/61] target-i386: Tidy extend + store Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 22/61] target-i386: Tidy extend + move Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 23/61] target-i386: Remove gen_op_movl_T0_0 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 24/61] target-i386: Remove gen_op_movl_T0_im* Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 25/61] " Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 26/61] target-i386: Remove gen_op_mov*_A0_im Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 27/61] target-i386: Remove gen_movtl_T*_im Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 28/61] target-i386: Remove gen_op_andl_T0_ffff Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 29/61] target-i386: Remove gen_op_andl_T0_im Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 30/61] target-i386: Remove gen_op_movl_T0_T1 Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 31/61] target-i386: Remove gen_op_andl_A0_ffff Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 32/61] target-i386: Use TCGMemOp for 'ot' variables Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 33/61] target-i386: Change gen_op_add_reg_* size parameter to TCGMemOp Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 34/61] target-i386: Change gen_op_j*z_ecx " Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 35/61] target-i386: Change aflag " Richard Henderson
2013-11-07 1:04 ` [Qemu-devel] [PATCH for-1.8 36/61] target-i386: Change gen_op_mov_reg_A0 size parameter " Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 37/61] target-i386: Change dflag " Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 38/61] target-i386: Fix addr32 prefix in gen_lea_modrm Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 39/61] target-i386: Tidy addr16 code " Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 40/61] target-i386: Combine gen_push_T* into gen_push_v Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 41/61] target_i386: Clean up gen_pop_T0 Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 42/61] target-i386: Create gen_lea_v_seg Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 43/61] target-i386: Use gen_lea_v_seg in gen_lea_modrm Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 44/61] target-i386: Use gen_lea_v_seg in stack subroutines Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 45/61] target-i386: Tidy cpu_regs initialization Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 46/61] target-i386: Access segs via TCG registers Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 47/61] target-i386: Use gen_lea_v_seg in pusha/popa Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 48/61] target-i386: Rewrite gen_enter inline Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 49/61] target-i386: Introduce mo_stacksize Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 50/61] target-i386: Rewrite leave Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 51/61] target-i386: Remove gen_op_mov_reg_T0 Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 52/61] target-i386: Remove gen_op_mov_reg_T1 Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 53/61] target-i386: Remove gen_op_addl_T0_T1 Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 54/61] target-i386: Remove gen_op_mov_TN_reg Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 55/61] target-i386: Remove gen_op_mov_reg_A0 Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 56/61] target-i386: Remove gen_op_movl_A0_reg Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 57/61] target-i386: Tidy gen_add_A0_im Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 58/61] target-i386: Tidy some size computation Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 59/61] target-i386: Rename gen_op_jmp_T0 to gen_op_jmp_v Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 60/61] target-i386: Tidy ljmp Richard Henderson
2013-11-07 1:05 ` [Qemu-devel] [PATCH for-1.8 61/61] target-i386: Deconstruct the cpu_T array Richard Henderson
2013-11-07 10:53 ` [Qemu-devel] [PATCH for-1.8 61/61] target-i386: Deconstruct thecpu_T arrayy Alex Bennée
2013-11-07 20:38 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383786324-18415-1-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).