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: Nikunj A Dadhania
Subject: Re: [Qemu-devel] [PATCH v1 02/14] target-ppc: Add xxinsertw instruction
Date: Fri, 06 Jan 2017 13:58:19 +0530
User-agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu)

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.

Regards
Nikunj




reply via email to

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