qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v1 4/5] s390x/tcg: Implement VECTOR ISOLATE STRING
Date: Fri, 17 May 2019 11:20:01 -0700	[thread overview]
Message-ID: <f2659286-a445-cfcb-56d6-3afa61757773@linaro.org> (raw)
In-Reply-To: <20190515203112.506-5-david@redhat.com>

On 5/15/19 1:31 PM, David Hildenbrand wrote:
> +#define DEF_VISTR(BITS)                                                        \
> +static int vistr##BITS(void *v1, const void *v2)
> +{
> +    S390Vector tmp = {};
> +    int i, cc = 3;
> +
> +    for (i = 0; i < (128 / BITS); i++) {
> +        const uint##BITS##_t data = s390_vec_read_element##BITS(v2, i);
> +
> +        if (!data) {
> +            cc = 0;
> +            break;
> +        }
> +        s390_vec_write_element##BITS(&tmp, i, data);
> +    }
> +    *(S390Vector *)v1 = tmp;
> +    return cc;
> +}
> +DEF_VISTR(8)
> +DEF_VISTR(16)
> +DEF_VISTR(32)

Based on previous, this becomes

    cc = 3;
    a0 = s390_vec_read_element64(v2, 0);
    a1 = s390_vec_read_element64(v2, 1);

    z0 = zero_search(a0, m);
    if (z0) {
        i = clz64(z0);
        a0 &= ~(UINT64_MAX >> i);
        a1 = 0;
        cc = 0;
    } else {
        z1 = zero_search(a1, m);
        if (z1) {
            i = clz64(z1);
            a1 &= ~(UINT64_MAX >> i);
            cc = 0;
        }
    }

    s390_vec_write_element64(v1, 0, a0);
    s390_vec_write_element64(v1, 1, a1);
    return cc;


r~


  reply	other threads:[~2019-05-17 18:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 20:31 [Qemu-devel] [PATCH v1 0/5] s390x/tcg: Vector Instruction Support Part 3 David Hildenbrand
2019-05-15 20:31 ` [Qemu-devel] [PATCH v1 1/5] s390x/tcg: Implement VECTOR FIND ANY ELEMENT EQUAL David Hildenbrand
2019-05-17 16:16   ` Richard Henderson
2019-05-20  9:51     ` David Hildenbrand
2019-05-22 11:01     ` David Hildenbrand
2019-05-22 11:09       ` Richard Henderson
2019-05-22 11:16         ` David Hildenbrand
2019-05-22 15:59           ` Richard Henderson
2019-05-22 18:16             ` David Hildenbrand
2019-05-22 18:46               ` Richard Henderson
2019-05-23  7:50                 ` David Hildenbrand
2019-05-23 12:27                   ` Richard Henderson
2019-05-23 12:34                     ` David Hildenbrand
2019-05-23 12:59                       ` David Hildenbrand
2019-05-23 13:50                         ` Richard Henderson
2019-05-23 10:58           ` Alex Bennée
2019-05-15 20:31 ` [Qemu-devel] [PATCH v1 2/5] s390x/tcg: Implement VECTOR FIND " David Hildenbrand
2019-05-17 16:47   ` Richard Henderson
2019-05-17 17:42     ` Richard Henderson
2019-05-20  9:17       ` David Hildenbrand
2019-05-15 20:31 ` [Qemu-devel] [PATCH v1 3/5] s390x/tcg: Implement VECTOR FIND ELEMENT NOT EQUAL David Hildenbrand
2019-05-17 17:56   ` Richard Henderson
2019-05-20  9:48     ` David Hildenbrand
2019-05-15 20:31 ` [Qemu-devel] [PATCH v1 4/5] s390x/tcg: Implement VECTOR ISOLATE STRING David Hildenbrand
2019-05-17 18:20   ` Richard Henderson [this message]
2019-05-15 20:31 ` [Qemu-devel] [PATCH v1 5/5] s390x/tcg: Implement VECTOR STRING RANGE COMPARE David Hildenbrand
2019-05-17 18:37   ` 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=f2659286-a445-cfcb-56d6-3afa61757773@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --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).