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>, Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
	David Miller <dmiller423@gmail.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PULL 06/15] target/s390x: vxeh2: vector string search
Date: Fri, 13 May 2022 09:16:25 -0700	[thread overview]
Message-ID: <faa22312-d676-cd28-ccd9-438acd57cd6c@linaro.org> (raw)
In-Reply-To: <CAFEAcA-smunqB+Q9NfD=1=QJT2pAZ+OqZTe==ZYbZkx9Rp=pMA@mail.gmail.com>

On 5/13/22 08:54, Peter Maydell wrote:
>> +    s390_vec_write_element64(v1, 0, k << es);
> 
> Specifically here, because k is 32 bit but s390_vec_write_element64()
> takes a uint64_t argument, we will do the shift as a signed 32 bit
> value before widening to 64 bits, so if the values of 'k' and 'es'
> are such that we might shift beyond bit 32 we'll get the wrong
> value. It looks like 'es' is one of the MO_* values, so generally
> small, but the upper bound on 'k' is a bit less obvious to me.
> Is the overflow-of-32-bits case impossible?

No, the upper bound of (k << es) is 16.

We perform the operation with k in units of element size, so that indexing works nicely, 
then convert back to units of bytes at the end to report results.  It's a byte index into 
the vector register, with 16 as an indicator of match not found + eos not found.


r~


  reply	other threads:[~2022-05-13 16:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 11:05 [PULL 00/15] s390x patches Thomas Huth
2022-05-04 11:05 ` [PULL 01/15] target/s390x: Fix writeback to v1 in helper_vstl Thomas Huth
2022-05-04 11:05 ` [PULL 02/15] s390x/cpu_models: drop "msa5" from the TCG "max" model Thomas Huth
2022-05-04 11:05 ` [PULL 03/15] s390x/cpu_models: make "max" match the unmodified "qemu" CPU model under TCG Thomas Huth
2022-05-04 11:05 ` [PULL 04/15] tcg: Implement tcg_gen_{h,w}swap_{i32,i64} Thomas Huth
2022-05-04 11:05 ` [PULL 05/15] target/s390x: vxeh2: vector convert short/32b Thomas Huth
2022-05-04 11:05 ` [PULL 06/15] target/s390x: vxeh2: vector string search Thomas Huth
2022-05-13 15:54   ` Peter Maydell
2022-05-13 16:16     ` Richard Henderson [this message]
2022-05-13 16:21       ` Peter Maydell
2022-05-04 11:05 ` [PULL 07/15] target/s390x: vxeh2: Update for changes to vector shifts Thomas Huth
2022-05-04 11:05 ` [PULL 08/15] target/s390x: vxeh2: vector shift double by bit Thomas Huth
2022-05-04 11:05 ` [PULL 09/15] target/s390x: vxeh2: vector {load, store} elements reversed Thomas Huth
2022-05-04 11:05 ` [PULL 10/15] target/s390x: vxeh2: vector {load, store} byte reversed elements Thomas Huth
2022-05-04 11:05 ` [PULL 11/15] target/s390x: vxeh2: vector {load, store} byte reversed element Thomas Huth
2022-05-04 11:05 ` [PULL 12/15] target/s390x: add S390_FEAT_VECTOR_ENH2 to qemu CPU model Thomas Huth
2022-05-04 11:05 ` [PULL 13/15] tests/tcg/s390x: Tests for Vector Enhancements Facility 2 Thomas Huth
2022-05-04 11:05 ` [PULL 14/15] disas: Remove old libopcode s390 disassembler Thomas Huth
2022-05-04 11:05 ` [PULL 15/15] tests/tcg/s390x: Use a different PCRel32 notation in branch-relative-long.c Thomas Huth
2022-05-04 20:43 ` [PULL 00/15] s390x patches Richard Henderson

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=faa22312-d676-cd28-ccd9-438acd57cd6c@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=david@redhat.com \
    --cc=dmiller423@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /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).