qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 3/6] targetc/ppc: add vmulh{su}w instructions


From: Richard Henderson
Subject: Re: [PATCH 3/6] targetc/ppc: add vmulh{su}w instructions
Date: Fri, 19 Jun 2020 14:17:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 6/18/20 10:37 PM, Lijun Pan wrote:
> Do you mean writing two functions directly, 
> 
> void helper_vmulhsw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
> {
>     int i;
> 
>     for (i = 0; i < 4; i++) {
>         r->s32[i] = (int32_t)((int64_t)a->s32[i] * (int64_t)b->s32[i]) >> 32);
>     }
> }
> 
> void helper_vmulhuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
> {
>     int i;
> 
>     for (i = 0; i < 4; i++) {
>         r->u32[i] = (uint32_t)((uint64_t)a->u32[i] * (uint64_t)b->u32[i]) >> 
> 32);
>     }
> }

That works for me.


r~



reply via email to

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