qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Aurélien Jarno" <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} to TCG
Date: Wed, 3 Sep 2008 21:26:39 +0300	[thread overview]
Message-ID: <f43fc5580809031126i62418122n14a02c723f8ef5c0@mail.gmail.com> (raw)
In-Reply-To: <7F235F5C-A1C9-4617-8C8D-900778862BBD@web.de>

On 9/3/08, Andreas Färber <andreas.faerber@web.de> wrote:
>
>  Am 03.09.2008 um 13:28 schrieb Thiemo Seufer:
>
>
> > Andreas Färber wrote:
> > [snip]
> >
> > > Would there be a problem with using i64 in the 32-on-64 case? That is,
> > > would it hurt to do i32 TCG operations on i64 variables on a 64-bit
> > > host?
> > >
> >
> > I did that accidentially for the mips target and got hard to debug
> > segfaults. I believe TCG requires ops and registers to have the
> > same type, abart from explicit conversion functions.
> >
> > Another problem might be sign/zero extensions.
> >
>
>  tcg-op.h actually uses two i32 ops (one with TCGV_HIGH) to implement i64
> ops on 32-bit host.
>
>  Any suggestion how to get i32 var(s) into i64 without using i32 ops? There
> appears to be no special TCG function for this.
>
>  Since it was decided that for a 32-bit guest we should use tl==i32
> registers vars, I need to get two of those into an i64 temporary (cpu_T64).
>
>  Here's what I've pieced together:
>
>  - for ppc64 just use i64 op
>  - for ppc on 32-bit host use 2x i32 move, w/ TCGV_HIGH and w/o
>  - for ppc on 64-bit host use i32 move + i64 shift + i32 move
>
>  static always_inline void gen_op_load_gpr64(TCGv t, int reg) {
>  #if defined(TARGET_PPC64)
>     tcg_gen_mov_i64(t, cpu_gpr[reg]);
>  #else
>  #if TCG_TARGET_REG_BITS == 32
>     tcg_gen_mov_i32(TCGV_HIGH(t), cpu_gprh[reg]);
>  #else
>     tcg_gen_mov_i32(t, cpu_gprh[reg]);
>     tcg_gen_shli_i64(t, t, 32);
>  #endif
>     tcg_gen_mov_i32(t, cpu_gpr[reg]);
>  #endif
>  }

Can't you use extu_i32_i64 followed by shift and then or? I think you
should not use TCGV_HIGH outside tcg directory, it's an implementation
detail.

  reply	other threads:[~2008-09-03 18:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 13:36 [Qemu-devel] [PATCH] [ppc] Convert gen_set_{T0,T1} to TCG Andreas Färber
2008-09-02 14:32 ` [Qemu-devel] [PATCH] [ppc] Convert op_reset_T0, op_set_{T0, T1} " Andreas Färber
2008-09-02 15:39   ` [Qemu-devel] [PATCH] [ppc] Convert op_move_{T1,T2}_T0 " Andreas Färber
2008-09-02 16:19     ` Aurelien Jarno
2008-09-02 16:57     ` [Qemu-devel] [PATCH 4/x] [ppc] Convert op_moven_T2_T0 " Andreas Färber
2008-09-02 22:22       ` [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0,T1,T2} " Andreas Färber
2008-09-02 23:20         ` Aurelien Jarno
2008-09-03  0:39           ` [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} " Andreas Färber
2008-09-03  5:07             ` Aurelien Jarno
2008-09-03 10:41               ` Andreas Färber
2008-09-03 11:28                 ` Thiemo Seufer
2008-09-03 18:07                   ` Andreas Färber
2008-09-03 18:26                     ` Blue Swirl [this message]
2008-09-03 19:00                       ` Andreas Färber
2008-09-03 19:12                         ` Blue Swirl
2008-09-03 20:04                           ` [Qemu-devel] [PATCH 5/x v2] ppc: Convert GPR moves " Andreas Färber
2008-09-04  5:25                             ` Aurelien Jarno
2008-09-04 10:21                               ` Andreas Färber
2008-09-04 12:24                             ` [Qemu-devel] [PATCH 6/x] ppc: Convert Altivec register " Andreas Färber
2008-09-04 14:08                               ` [Qemu-devel] [PATCH 7/x] ppc: Convert FPR " Andreas Färber
2008-09-04 14:39                                 ` Aurélien Jarno
2008-09-04 17:59                                   ` [Qemu-devel] [PATCH 8/x] ppc: Convert op_set_FT0 " Andreas Färber
2008-09-04 20:36                                     ` Aurélien Jarno
2008-09-04 22:53                                       ` [Qemu-devel] [PATCH 9/x] ppc: Convert op_add, op_addi " Andreas Färber
2008-09-05 14:18                                         ` Aurélien Jarno
2008-09-05 17:17                                           ` Andreas Färber
2008-09-05 17:49                                             ` Aurelien Jarno
2008-09-04 23:46                                       ` [Qemu-devel] [PATCH 10/x] ppc: Convert op_subf " Andreas Färber
2008-09-05 14:18                                         ` Aurélien Jarno
2008-09-04 14:39                               ` [Qemu-devel] [PATCH 6/x] ppc: Convert Altivec register moves " Aurélien Jarno
2008-09-07 14:22                         ` [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} " Paul Brook
2008-09-03 12:41                 ` Aurélien Jarno
2008-09-03 12:58                   ` Andreas Färber
2008-09-03 13:00                     ` Aurélien Jarno
2008-09-03 13:23                     ` Thiemo Seufer
2008-09-03 13:45                       ` Tristan Gingold
2008-09-03 16:04                     ` Andreas Färber
2008-09-02 23:27       ` [Qemu-devel] [PATCH 4/x] [ppc] Convert op_moven_T2_T0 " Aurélien Jarno
2008-09-02 15:58   ` [Qemu-devel] [PATCH] [ppc] Convert op_reset_T0, op_set_{T0, T1} " Aurelien Jarno
2008-09-02 16:44     ` [Qemu-devel] [PATCH 2/x v2] " Andreas Färber
2008-09-02 23:28       ` Aurélien Jarno
2008-09-02 16:18 ` [Qemu-devel] [PATCH] [ppc] Convert gen_set_{T0,T1} " 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=f43fc5580809031126i62418122n14a02c723f8ef5c0@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=aurelien@aurel32.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).