[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 14/20] target/arm: Generalize inl_qrdmlah_* helper functions
From: |
Peter Maydell |
Subject: |
Re: [PATCH 14/20] target/arm: Generalize inl_qrdmlah_* helper functions |
Date: |
Tue, 25 Aug 2020 14:06:52 +0100 |
On Sat, 15 Aug 2020 at 02:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Unify add/sub helpers and add a parameter for rounding.
> This will allow saturating non-rounding to reuse this code.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> /* Signed saturating rounding doubling multiply-accumulate high half, 32-bit
> */
> -static int32_t inl_qrdmlah_s32(int32_t src1, int32_t src2,
> - int32_t src3, uint32_t *sat)
> +static int32_t do_sqrdmlah_s(int32_t src1, int32_t src2, int32_t src3,
> + bool neg, bool round, uint32_t *sat)
> {
> /* Simplify similarly to int_qrdmlah_s16 above. */
> int64_t ret = (int64_t)src1 * src2;
> - ret = ((int64_t)src3 << 31) + ret + (1 << 30);
> + if (neg) {
> + ret = -ret;
> + }
> + ret = ((int64_t)src3 << 31) + (round << 30);
Shouldn't this be "+=" as with the _h version earlier ?
(risu testing ought to catch this -- do we have a coverage hole?)
> ret >>= 31;
> +
> if (ret != (int32_t)ret) {
> *sat = 1;
> ret = (ret < 0 ? INT32_MIN : INT32_MAX);
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- Re: [PATCH 04/20] target/arm: Rearrange {sve,fp}_check_access assert, (continued)
- [PATCH 10/20] target/arm: Split out gen_gvec_ool_zzp, Richard Henderson, 2020/08/15
- [PATCH 05/20] target/arm: Merge do_vector2_p into do_mov_p, Richard Henderson, 2020/08/15
- [PATCH 14/20] target/arm: Generalize inl_qrdmlah_* helper functions, Richard Henderson, 2020/08/15
- Re: [PATCH 14/20] target/arm: Generalize inl_qrdmlah_* helper functions,
Peter Maydell <=
- [PATCH 18/20] target/arm: Convert integer multiply (indexed) to gvec for aa64 advsimd, Richard Henderson, 2020/08/15
- [PATCH 03/20] target/arm: Split out gen_gvec_fn_zzz, do_zzz_fn, Richard Henderson, 2020/08/15
- Re: [PATCH 00/20] target/arm: SVE2 preparatory patches, no-reply, 2020/08/15
- Re: [PATCH 00/20] target/arm: SVE2 preparatory patches, Peter Maydell, 2020/08/27