Received: from eggs.gnu.org ([208.118.235.92]:51597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVfLm-0002jQ-RY for qemu-devel@nongnu.org; Fri, 26 Apr 2013 05:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVfLj-00064q-MW for qemu-devel@nongnu.org; Fri, 26 Apr 2013 05:53:54 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20130426093819.GA25132@hall.aurel32.net> Date: Fri, 26 Apr 2013 11:53:49 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1366484182-29187-1-git-send-email-aurelien@aurel32.net> <1366484182-29187-6-git-send-email-aurelien@aurel32.net> <4D01E430-54DC-412E-9C8E-A5F94AB7796C@suse.de> <20130426093819.GA25132@hall.aurel32.net> Subject: Re: [Qemu-devel] [PATCH v2 05/10] target-ppc: emulate prtyw and prtyd instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 26.04.2013, at 11:38, Aurelien Jarno wrote: > On Fri, Apr 26, 2013 at 09:50:31AM +0200, Alexander Graf wrote: >>=20 >> On 20.04.2013, at 20:56, Aurelien Jarno wrote: >>=20 >>> Needed for Power ISA version 2.05 compliance. >>>=20 >>> Reviewed-by: Richard Henderson >>> Signed-off-by: Aurelien Jarno >>> --- >>> target-ppc/translate.c | 38 ++++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 38 insertions(+) >>>=20 >>> diff --git a/target-ppc/translate.c b/target-ppc/translate.c >>> index 6bee6db..977f9ef 100644 >>> --- a/target-ppc/translate.c >>> +++ b/target-ppc/translate.c >>> @@ -1458,6 +1458,42 @@ static void gen_popcntd(DisasContext *ctx) >>> } >>> #endif >>>=20 >>> +/* prtyw: PowerPC 2.05 specification */ >>> +static void gen_prtyw(DisasContext *ctx) >>> +{ >>> + TCGv ra =3D cpu_gpr[rA(ctx->opcode)]; >>> + TCGv rs =3D cpu_gpr[rS(ctx->opcode)]; >>> + TCGv t0 =3D tcg_temp_new(); >>> + tcg_gen_shri_tl(t0, rs, 16); >>> + tcg_gen_xor_tl(ra, rs, t0); >>> + tcg_gen_shri_tl(t0, ra, 8); >>> + tcg_gen_xor_tl(ra, ra, t0); >>> +#if defined(TARGET_PPC64) >>> + tcg_gen_andi_tl(ra, ra, 0x100000001); >>=20 >> This will break on 32-bit host systems. Let me fix it to ULL for you = :). In fact, any reason for the #ifdef here? We could just always pass = 0x100000001ULL and have the target_ulong cast take the upper 32bit away, = no? >=20 > Good catch. The #ifdef version matches the instruction definition in = the > manual, but for QEMU I agree a version using a cast with target_ulong > looks better. Should I send a new patch? I already fixed it up while applying the patch, thanks :) Alex