[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 04/13] target-ppc: implement lxvll in
From: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 04/13] target-ppc: implement lxvll instruction |
Date: |
Tue, 06 Dec 2016 11:15:11 +0530 |
User-agent: |
Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) |
Richard Henderson <address@hidden> writes:
> On 12/05/2016 03:25 AM, Nikunj A Dadhania wrote:
>> +void helper_lxvll(CPUPPCState *env, target_ulong addr,
>> + target_ulong xt_num, target_ulong rb)
>> +{
>> + ppc_vsr_t xt;
>> +
>> + getVSR(xt_num, &xt, env);
>> + if (unlikely((rb & 0xFF) == 0)) {
>> + xt.s128 = int128_make128(0, 0);
>
> Nit: int128_zero.
Sure.
>> + } else {
>> + target_ulong end = ((rb & 0xFF) * 8) - 1;
>> + if (msr_le) {
>> + xt.u64[LO_IDX] = cpu_ldq_data_ra(env, addr, GETPC());
>> + addr = addr_add(env, addr, 8);
>> + xt.u64[HI_IDX] = cpu_ldq_data_ra(env, addr, GETPC());
>> + xt.s128 = int128_and(xt.s128, mask_u128(127 - end, 127));
>
> The ISA document says that this is a sequence of byte operations. Which means
> that END < 127 will not access bytes outside of the length. Which means that
> your code will trigger SIGSEGV near page boundaries when real hardware
> won't.
In that case, I can use I can use cpu_ldub_data_ra()
> I also don't see how this does the right thing for little-endian.
Needs to be in big-endian order - two things
1) LO/HI swapped
2) No byte swapping
AFAIU the example given in ISA, i see the right output in my test.
Regards
Nikunj
- [Qemu-ppc] [PATCH 02/13] target-ppc: add mask_u128 routine, (continued)
- [Qemu-ppc] [PATCH 02/13] target-ppc: add mask_u128 routine, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 03/13] target-ppc: implement lxvl instruction, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 04/13] target-ppc: implement lxvll instruction, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 05/13] target-ppc: implement stxvl instruction, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 07/13] target-ppc: implement xxextractuw instruction, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 09/13] target-ppc: implement stop instruction, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 06/13] target-ppc: implement stxvll instructions, Nikunj A Dadhania, 2016/12/05
- [Qemu-ppc] [PATCH 08/13] target-ppc: implement xxinsertw instruction, Nikunj A Dadhania, 2016/12/05