qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 16/18] tcg-i386: Use intptr_t appropriately
Date: Thu, 29 Aug 2013 18:45:07 +0200	[thread overview]
Message-ID: <20130829164507.GE2287@ohm.aurel32.net> (raw)
In-Reply-To: <1377190729-14008-17-git-send-email-rth@twiddle.net>

On Thu, Aug 22, 2013 at 09:58:47AM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/i386/tcg-target.c | 38 ++++++++++++++++++--------------------
>  1 file changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
> index b1e4e5b..f3083b8 100644
> --- a/tcg/i386/tcg-target.c
> +++ b/tcg/i386/tcg-target.c
> @@ -430,8 +430,7 @@ static void tcg_out_modrm(TCGContext *s, int opc, int r, int rm)
>     that will follow the instruction.  */
>  
>  static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm,
> -                                     int index, int shift,
> -                                     tcg_target_long offset)
> +                                     int index, int shift, intptr_t offset)
>  {
>      int mod, len;
>  
> @@ -439,8 +438,8 @@ static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm,
>          if (TCG_TARGET_REG_BITS == 64) {
>              /* Try for a rip-relative addressing mode.  This has replaced
>                 the 32-bit-mode absolute addressing encoding.  */
> -            tcg_target_long pc = (tcg_target_long)s->code_ptr + 5 + ~rm;
> -            tcg_target_long disp = offset - pc;
> +            intptr_t pc = (intptr_t)s->code_ptr + 5 + ~rm;
> +            intptr_t disp = offset - pc;
>              if (disp == (int32_t)disp) {
>                  tcg_out_opc(s, opc, r, 0, 0);
>                  tcg_out8(s, (LOWREGMASK(r) << 3) | 5);
> @@ -514,7 +513,7 @@ static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm,
>  
>  /* A simplification of the above with no index or shift.  */
>  static inline void tcg_out_modrm_offset(TCGContext *s, int opc, int r,
> -                                        int rm, tcg_target_long offset)
> +                                        int rm, intptr_t offset)
>  {
>      tcg_out_modrm_sib_offset(s, opc, r, rm, -1, 0, offset);
>  }
> @@ -735,7 +734,7 @@ static void tcg_out_jxx(TCGContext *s, int opc, int label_index, int small)
>      TCGLabel *l = &s->labels[label_index];
>  
>      if (l->has_value) {
> -        val = l->u.value - (tcg_target_long)s->code_ptr;
> +        val = l->u.value - (intptr_t)s->code_ptr;
>          val1 = val - 2;
>          if ((int8_t)val1 == val1) {
>              if (opc == -1) {
> @@ -975,9 +974,9 @@ static void tcg_out_movcond64(TCGContext *s, TCGCond cond, TCGArg dest,
>  }
>  #endif
>  
> -static void tcg_out_branch(TCGContext *s, int call, tcg_target_long dest)
> +static void tcg_out_branch(TCGContext *s, int call, uintptr_t dest)
>  {
> -    tcg_target_long disp = dest - (tcg_target_long)s->code_ptr - 5;
> +    intptr_t disp = dest - (intptr_t)s->code_ptr - 5;
>  
>      if (disp == (int32_t)disp) {
>          tcg_out_opc(s, call ? OPC_CALL_Jz : OPC_JMP_long, 0, 0, 0);
> @@ -989,12 +988,12 @@ static void tcg_out_branch(TCGContext *s, int call, tcg_target_long dest)
>      }
>  }
>  
> -static inline void tcg_out_calli(TCGContext *s, tcg_target_long dest)
> +static inline void tcg_out_calli(TCGContext *s, uintptr_t dest)
>  {
>      tcg_out_branch(s, 1, dest);
>  }
>  
> -static void tcg_out_jmp(TCGContext *s, tcg_target_long dest)
> +static void tcg_out_jmp(TCGContext *s, uintptr_t dest)
>  {
>      tcg_out_branch(s, 0, dest);
>  }
> @@ -1130,8 +1129,7 @@ static inline void setup_guest_base_seg(void) { }
>  #endif /* SOFTMMU */
>  
>  static void tcg_out_qemu_ld_direct(TCGContext *s, int datalo, int datahi,
> -                                   int base, tcg_target_long ofs, int seg,
> -                                   int sizeop)
> +                                   int base, intptr_t ofs, int seg, int sizeop)
>  {
>  #ifdef TARGET_WORDS_BIGENDIAN
>      const int bswap = 1;
> @@ -1281,7 +1279,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
>  }
>  
>  static void tcg_out_qemu_st_direct(TCGContext *s, int datalo, int datahi,
> -                                   int base, tcg_target_long ofs, int seg,
> +                                   int base, intptr_t ofs, int seg,
>                                     int sizeop)
>  {
>  #ifdef TARGET_WORDS_BIGENDIAN
> @@ -1499,7 +1497,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
>         jmp next_code : jump to the code corresponding to next IR of qemu_ld/st
>      */
>  
> -    tcg_out_calli(s, (tcg_target_long)qemu_ld_helpers[s_bits]);
> +    tcg_out_calli(s, (uintptr_t)qemu_ld_helpers[s_bits]);
>  
>      /* Jump to post-processing code */
>      tcg_out8(s, OPC_JMP_short);
> @@ -1556,7 +1554,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
>      }
>  
>      /* Jump to the code corresponding to next IR of qemu_st */
> -    tcg_out_jmp(s, (tcg_target_long)raddr);
> +    tcg_out_jmp(s, (uintptr_t)raddr);
>  }
>  
>  /*
> @@ -1621,7 +1619,7 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
>         jmp next_code : jump to the code corresponding to next IR of qemu_ld/st
>      */
>  
> -    tcg_out_calli(s, (tcg_target_long)qemu_st_helpers[s_bits]);
> +    tcg_out_calli(s, (uintptr_t)qemu_st_helpers[s_bits]);
>  
>      /* Jump to post-processing code */
>      tcg_out8(s, OPC_JMP_short);
> @@ -1639,7 +1637,7 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
>      }
>  
>      /* Jump to the code corresponding to next IR of qemu_st */
> -    tcg_out_jmp(s, (tcg_target_long)raddr);
> +    tcg_out_jmp(s, (uintptr_t)raddr);
>  }
>  
>  /*
> @@ -1680,7 +1678,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
>      switch(opc) {
>      case INDEX_op_exit_tb:
>          tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_EAX, args[0]);
> -        tcg_out_jmp(s, (tcg_target_long) tb_ret_addr);
> +        tcg_out_jmp(s, (uintptr_t)tb_ret_addr);
>          break;
>      case INDEX_op_goto_tb:
>          if (s->tb_jmp_offset) {
> @@ -1691,7 +1689,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
>          } else {
>              /* indirect jump method */
>              tcg_out_modrm_offset(s, OPC_GRP5, EXT5_JMPN_Ev, -1,
> -                                 (tcg_target_long)(s->tb_next + args[0]));
> +                                 (intptr_t)(s->tb_next + args[0]));
>          }
>          s->tb_next_offset[args[0]] = s->code_ptr - s->code_buf;
>          break;
> @@ -2384,7 +2382,7 @@ static DebugFrame debug_frame = {
>  #if defined(ELF_HOST_MACHINE)
>  void tcg_register_jit(void *buf, size_t buf_size)
>  {
> -    debug_frame.fde.func_start = (tcg_target_long) buf;
> +    debug_frame.fde.func_start = (uintptr_t)buf;
>      debug_frame.fde.func_len = buf_size;
>  
>      tcg_register_jit_int(buf, buf_size, &debug_frame, sizeof(debug_frame));

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2013-08-29 16:53 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 16:58 [Qemu-devel] [PATCH 00/18] tcg: decouple tcg_target_long from pointer size Richard Henderson
2013-08-22 16:58 ` [Qemu-devel] [PATCH 01/18] qtest: Fix FMT_timeval vs time_t Richard Henderson
2013-08-22 17:09   ` Andreas Färber
2013-08-22 17:53     ` Richard Henderson
2013-08-22 18:01       ` Andreas Färber
2013-08-22 18:05         ` Richard Henderson
2013-08-22 16:58 ` [Qemu-devel] [PATCH 02/18] tcg: Change flush_icache_range arguments to uintptr_t Richard Henderson
2013-08-28 21:06   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 03/18] tcg: Change tcg_qemu_tb_exec return " Richard Henderson
2013-08-28 21:06   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 04/18] tcg: Fix next_tb type in cpu_exec Richard Henderson
2013-08-28 21:07   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 05/18] tcg: Define TCG_TYPE_PTR properly Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 06/18] tcg: Define TCG_ptr properly Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 07/18] tcg: Change frame pointer offsets to intptr_t Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 08/18] tcg: Change memory " Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 09/18] tcg: Change relocation " Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 10/18] tcg: Use uintptr_t in TCGHelperInfo Richard Henderson
2013-08-29 10:53   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 11/18] tcg: Change tcg_gen_exit_tb argument to uintptr_t Richard Henderson
2013-08-29 10:54   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 12/18] tcg: Change tcg_out_ld/st offset to intptr_t Richard Henderson
2013-08-29 16:44   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 13/18] tcg: Use appropriate types in tcg_reg_alloc_call Richard Henderson
2013-08-29 16:44   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 14/18] tcg: Fix jit debug for pointer size != register size Richard Henderson
2013-08-29 16:44   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 15/18] tcg: Allow TCG_TARGET_REG_BITS to be specified independantly Richard Henderson
2013-08-29 16:45   ` Aurelien Jarno
2013-08-22 16:58 ` [Qemu-devel] [PATCH 16/18] tcg-i386: Use intptr_t appropriately Richard Henderson
2013-08-29 16:45   ` Aurelien Jarno [this message]
2013-08-22 16:58 ` [Qemu-devel] [PATCH 17/18] tcg-i386: Adjust tcg_out_tlb_load for x32 Richard Henderson
2013-08-29 16:45   ` Aurelien Jarno
2013-08-29 17:53     ` Richard Henderson
2013-08-29 20:52     ` Richard Henderson
2013-08-22 16:58 ` [Qemu-devel] [PATCH 18/18] configure: Allow x32 as a host Richard Henderson
2013-08-29 16:45   ` Aurelien Jarno

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=20130829164507.GE2287@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).