[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/31] target/arm: Implement SVE2 integer add/subtract long
From: |
Laurent Desnogues |
Subject: |
Re: [PATCH 11/31] target/arm: Implement SVE2 integer add/subtract long |
Date: |
Mon, 13 Apr 2020 18:09:18 +0200 |
On Fri, Mar 27, 2020 at 12:09 AM Richard Henderson
<address@hidden> wrote:
[...]
> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
> index bee00eaa44..7d7a59f620 100644
> --- a/target/arm/sve_helper.c
> +++ b/target/arm/sve_helper.c
> @@ -1088,6 +1088,49 @@ DO_ZZW(sve_lsl_zzw_s, uint32_t, uint64_t, H1_4, DO_LSL)
> #undef DO_ZPZ
> #undef DO_ZPZ_D
>
> +/*
> + * Three-operand expander, unpredicated, in which the two inputs are
> + * selected from the top or bottom half of the wide column.
> + */
> +#define DO_ZZZ_TB(NAME, TYPE, TYPEN, OP) \
> +void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
> +{ \
> + intptr_t i, opr_sz = simd_oprsz(desc); \
> + int sel1 = (simd_data(desc) & 1) * sizeof(TYPE); \
> + int sel2 = (simd_data(desc) & 2) * (sizeof(TYPE) / 2); \
> + for (i = 0; i < opr_sz; i += sizeof(TYPE)) { \
> + TYPE nn = (TYPEN)(*(TYPE *)(vn + i) >> sel1); \
> + TYPE mm = (TYPEN)(*(TYPE *)(vm + i) >> sel2); \
> + *(TYPE *)(vd + i) = OP(nn, mm); \
> + } \
> +}
For sel1/sel2 the multiplicand should be the number of bits in TYPEN.
Laurent
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 11/31] target/arm: Implement SVE2 integer add/subtract long,
Laurent Desnogues <=