On 6/12/20 9:20 PM, Lijun Pan wrote:
> +#define VMULH_DO(name, op, element, cast_orig, cast_temp)            \
> +    void helper_vmulh##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)        
> \
> +    {                                                                        
> \
> +     int i;                                                          \
> +                                                                     \
> +     for (i = 0; i < ARRAY_SIZE(r->element); i++) {                  \
> +             r->element[i] = (cast_orig)(((cast_temp)a->element[i] op \
> +                             (cast_temp)b->element[i]) >> 32);       \
> +     }                                                               \
> +    }
> +VMULH_DO(sw, *, s32, int32_t, int64_t)
> +VMULH_DO(uw, *, u32, uint32_t, uint64_t)
> +#undef VMULH_DO

There's no point in calling the macro "VMUL" and then passing in "op" as a
parameter.  Just inline the multiply directly.

Also, fix your indentation.


r~

Reply via email to