[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2 05/10] target-ppc: emulate prtyw and prtyd inst
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-ppc] [PATCH v2 05/10] target-ppc: emulate prtyw and prtyd instructions |
Date: |
Fri, 26 Apr 2013 11:58:14 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Fri, Apr 26, 2013 at 11:53:49AM +0200, Alexander Graf wrote:
>
> On 26.04.2013, at 11:38, Aurelien Jarno wrote:
>
> > On Fri, Apr 26, 2013 at 09:50:31AM +0200, Alexander Graf wrote:
> >>
> >> On 20.04.2013, at 20:56, Aurelien Jarno wrote:
> >>
> >>> Needed for Power ISA version 2.05 compliance.
> >>>
> >>> Reviewed-by: Richard Henderson <address@hidden>
> >>> Signed-off-by: Aurelien Jarno <address@hidden>
> >>> ---
> >>> target-ppc/translate.c | 38 ++++++++++++++++++++++++++++++++++++++
> >>> 1 file changed, 38 insertions(+)
> >>>
> >>> 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
> >>>
> >>> +/* prtyw: PowerPC 2.05 specification */
> >>> +static void gen_prtyw(DisasContext *ctx)
> >>> +{
> >>> + TCGv ra = cpu_gpr[rA(ctx->opcode)];
> >>> + TCGv rs = cpu_gpr[rS(ctx->opcode)];
> >>> + TCGv t0 = 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);
> >>
> >> 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?
> >
> > 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 :)
Ok, thanks.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
address@hidden http://www.aurel32.net
[Qemu-ppc] [PATCH v2 09/10] target-ppc: emulate store doubleword pair instructions, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 03/10] target-ppc: add instruction flags for Book I 2.05, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 07/10] target-ppc: emulate lfiwax instruction, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 02/10] disas: Disassemble all ppc insns for the guest, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 08/10] target-ppc: emulate load doubleword pair instructions, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 06/10] target-ppc: emulate fcpsgn instruction, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 04/10] target-ppc: emulate cmpb instruction, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 01/10] target-ppc: optimize fabs, fnabs, fneg, Aurelien Jarno, 2013/04/20
[Qemu-ppc] [PATCH v2 10/10] target-ppc: add support for extended mtfsf/mtfsfi forms, Aurelien Jarno, 2013/04/20
Re: [Qemu-ppc] [PATCH v2 00/10] target-ppc: emulate Power ISA 2.05 instructions, Alexander Graf, 2013/04/26