qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 02/14] target-ppc: Add xxinsertw instruction


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH v1 02/14] target-ppc: Add xxinsertw instruction
Date: Sat, 7 Jan 2017 12:02:49 +1100
User-agent: Mutt/1.7.1 (2016-10-04)

On Fri, Jan 06, 2017 at 01:58:19PM +0530, Nikunj A Dadhania wrote:
> David Gibson <address@hidden> writes:
> 
> > [ Unknown signature status ]
> > On Fri, Jan 06, 2017 at 11:44:44AM +0530, Nikunj A Dadhania wrote:
> >> xxinsertw: VSX Vector Insert Word
> >> 
> >> Signed-off-by: Nikunj A Dadhania <address@hidden>
> >
> > The comments I had about out of bounds shifts don't seem to have been
> > addressed here.
> 
> Bounds are addressed inside the for condition:
> 
> #if defined(HOST_WORDS_BIGENDIAN)
>     ins_index = index;
>     for (i = 0; i < es && ins_index < 16; i++, ins_index++) {
>                           ^^^^^^^^^^^^^^
>         xt.u8[ins_index] = xb.u8[8 - es + i];
>     }
> #else
>     ins_index = 15 - index;
>     for (i = es - 1; i >= 0 && ins_index >= 0; i--, ins_index--) {
>                                ^^^^^^^^^^^^^^
>         xt.u8[ins_index] = xb.u8[8 + i];
>     }
> #endif
> 
> That way ins_index will be within 0 - 15. Let me know if I have missed
> something.

Oh, yes, I missed that.  Sorry.
-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]