[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH v1 4/5] s390x/tcg: Implement VECTOR
From: |
Richard Henderson |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH v1 4/5] s390x/tcg: Implement VECTOR ISOLATE STRING |
Date: |
Fri, 17 May 2019 11:20:01 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
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~