qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v5 33/35] target/arm: Implement SVE dot product (indexed)
Date: Tue, 26 Jun 2018 09:17:52 -0700	[thread overview]
Message-ID: <d778b758-6041-aa19-ed48-09749ba572fc@linaro.org> (raw)
In-Reply-To: <CAFEAcA_-39brD_S6SiDfaQRO16bE1pw79JDywnPfzybbPc_hCg@mail.gmail.com>

On 06/26/2018 08:30 AM, Peter Maydell wrote:
> On 21 June 2018 at 02:53, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>  target/arm/helper.h        |  5 ++
>>  target/arm/translate-sve.c | 18 +++++++
>>  target/arm/vec_helper.c    | 96 ++++++++++++++++++++++++++++++++++++++
>>  target/arm/sve.decode      |  8 +++-
>>  4 files changed, 126 insertions(+), 1 deletion(-)
>>
> 
>> +void HELPER(gvec_sdot_idx_b)(void *vd, void *vn, void *vm, uint32_t desc)
>> +{
>> +    intptr_t i, j, opr_sz = simd_oprsz(desc), opr_sz_4 = opr_sz / 4;
>> +    intptr_t index = simd_data(desc);
>> +    uint32_t *d = vd;
>> +    int8_t *n = vn, *m = vm;
>> +
>> +    for (i = 0; i < opr_sz_4; i = j) {
>> +        int8_t m0 = m[(i + index) * 4 + 0];
>> +        int8_t m1 = m[(i + index) * 4 + 1];
>> +        int8_t m2 = m[(i + index) * 4 + 2];
>> +        int8_t m3 = m[(i + index) * 4 + 3];
>> +
>> +        j = i;
>> +        do {
>> +            d[j] += n[j * 4 + 0] * m0
>> +                  + n[j * 4 + 1] * m1
>> +                  + n[j * 4 + 2] * m2
>> +                  + n[j * 4 + 3] * m3;
>> +        } while (++j < MIN(i + 4, opr_sz_4));
>> +    }
>> +    clear_tail(d, opr_sz, simd_maxsz(desc));
>> +}
> 
> Maybe I'm just half asleep this afternoon, but this is pretty
> confusing -- nested loops where the outer loop's increment
> uses the inner loop's index, and the inner loop's conditions
> depend on the outer loop index...

Yeah, well.

There is an edge case of aa64 advsimd, reusing this same helper,

	sdot	v0.2s, v1.8b, v0.4b[0]

where m values must be read (and held) before writing d results,
and there are not 16/4=4 elements to process but only 2.

I suppose I could special-case oprsz == 8 in order to simplify
iteration of what is otherwise a multiple of 16.

I thought iterating J from I to I+4 was easier to read than
writing out I+J everywhere.  Perhaps not.


>> -DOT_zzz         01000100 1 sz:1 0 rm:5 00000 u:1 rn:5 rd:5
>> +DOT_zzz         01000100 1 sz:1 0 rm:5 00000 u:1 rn:5 rd:5      ra=%reg_movprfx
> 
> Should this have been in the previous patch ?

Yes, thanks.


r~

  reply	other threads:[~2018-06-26 16:18 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  1:53 [Qemu-devel] [PATCH v5 00/35] target/arm SVE patches Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 01/35] target/arm: Implement SVE Memory Contiguous Load Group Richard Henderson
2018-06-22 15:29   ` Peter Maydell
2018-06-26  9:55   ` Alex Bennée
2018-06-26 14:04     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 02/35] target/arm: Implement SVE Contiguous Load, first-fault and no-fault Richard Henderson
2018-06-22 16:04   ` Peter Maydell
2018-06-22 18:37     ` Richard Henderson
2018-06-26 12:52   ` Alex Bennée
2018-06-26 14:06     ` Richard Henderson
2018-06-27 11:37       ` Alex Bennée
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 03/35] target/arm: Implement SVE Memory Contiguous Store Group Richard Henderson
2018-06-25 15:03   ` Peter Maydell
2018-06-27 11:38   ` Alex Bennée
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 04/35] target/arm: Implement SVE load and broadcast quadword Richard Henderson
2018-06-25 15:08   ` Peter Maydell
2018-06-27 14:05   ` Alex Bennée
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 05/35] target/arm: Implement SVE integer convert to floating-point Richard Henderson
2018-06-25 15:21   ` Peter Maydell
2018-06-27 14:19   ` Alex Bennée
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 06/35] target/arm: Implement SVE floating-point arithmetic (predicated) Richard Henderson
2018-06-25 15:24   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 07/35] target/arm: Implement SVE FP Multiply-Add Group Richard Henderson
2018-06-25 15:32   ` Peter Maydell
2018-06-26 14:08     ` Richard Henderson
2018-06-26 14:11       ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 08/35] target/arm: Implement SVE Floating Point Accumulating Reduction Group Richard Henderson
2018-06-25 15:35   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 09/35] target/arm: Implement SVE load and broadcast element Richard Henderson
2018-06-25 15:46   ` Peter Maydell
2018-06-26 14:10     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 10/35] target/arm: Implement SVE store vector/predicate register Richard Henderson
2018-06-25 15:51   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 11/35] target/arm: Implement SVE scatter stores Richard Henderson
2018-06-25 16:13   ` Peter Maydell
2018-06-26 14:21     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 12/35] target/arm: Implement SVE prefetches Richard Henderson
2018-06-25 16:18   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 13/35] target/arm: Implement SVE gather loads Richard Henderson
2018-06-25 16:55   ` Peter Maydell
2018-06-26 14:39     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 14/35] target/arm: Implement SVE first-fault " Richard Henderson
2018-06-25 16:57   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 15/35] target/arm: Implement SVE scatter store vector immediate Richard Henderson
2018-06-25 17:00   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 16/35] target/arm: Implement SVE floating-point compare vectors Richard Henderson
2018-06-25 17:20   ` Peter Maydell
2018-06-26 16:41     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 17/35] target/arm: Implement SVE floating-point arithmetic with immediate Richard Henderson
2018-06-25 17:27   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 18/35] target/arm: Implement SVE Floating Point Multiply Indexed Group Richard Henderson
2018-06-25 17:47   ` Peter Maydell
2018-06-26 14:50     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 19/35] target/arm: Implement SVE FP Fast Reduction Group Richard Henderson
2018-06-26 10:09   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 20/35] target/arm: Implement SVE Floating Point Unary Operations - Unpredicated Group Richard Henderson
2018-06-26 10:13   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 21/35] target/arm: Implement SVE FP Compare with Zero Group Richard Henderson
2018-06-26 10:18   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 22/35] target/arm: Implement SVE floating-point trig multiply-add coefficient Richard Henderson
2018-06-26 10:25   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 23/35] target/arm: Implement SVE floating-point convert precision Richard Henderson
2018-06-26 10:44   ` Peter Maydell
2018-06-27  4:02     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 24/35] target/arm: Implement SVE floating-point convert to integer Richard Henderson
2018-06-26 10:58   ` Peter Maydell
2018-06-26 18:24     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 25/35] target/arm: Implement SVE floating-point round to integral value Richard Henderson
2018-06-26 12:09   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 26/35] target/arm: Implement SVE floating-point unary operations Richard Henderson
2018-06-26 12:13   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 27/35] target/arm: Implement SVE MOVPRFX Richard Henderson
2018-06-26 12:24   ` Peter Maydell
2018-06-26 14:57     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 28/35] target/arm: Implement SVE floating-point complex add Richard Henderson
2018-06-26 13:17   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 29/35] target/arm: Implement SVE fp complex multiply add Richard Henderson
2018-06-26 13:29   ` Peter Maydell
2018-06-26 15:04     ` Richard Henderson
2018-06-26 15:17       ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 30/35] target/arm: Pass index to AdvSIMD FCMLA (indexed) Richard Henderson
2018-06-26 13:38   ` Peter Maydell
2018-06-26 15:07     ` Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 31/35] target/arm: Implement SVE fp complex multiply add (indexed) Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 32/35] target/arm: Implement SVE dot product (vectors) Richard Henderson
2018-06-26 13:47   ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 33/35] target/arm: Implement SVE dot product (indexed) Richard Henderson
2018-06-26 15:30   ` Peter Maydell
2018-06-26 16:17     ` Richard Henderson [this message]
2018-06-26 16:30       ` Peter Maydell
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 34/35] target/arm: Enable SVE for aarch64-linux-user Richard Henderson
2018-06-21  1:53 ` [Qemu-devel] [PATCH v5 35/35] target/arm: Implement ARMv8.2-DotProd Richard Henderson
2018-06-26 15:38   ` Peter Maydell
2018-06-21  5:18 ` [Qemu-devel] [PATCH v5 00/35] target/arm SVE patches no-reply
2018-06-26  9:41 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d778b758-6041-aa19-ed48-09749ba572fc@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).