[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v4 75/75] target/i386: convert pmovmskb/movm
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [RFC PATCH v4 75/75] target/i386: convert pmovmskb/movmskps/movmskpd helpers to gvec style |
Date: |
Wed, 21 Aug 2019 16:53:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/21/19 10:29 AM, Jan Bobek wrote:
> + for (intptr_t i = 0; i * sizeof(uint8_t) < oprsz; ++i) {
> + const uint8_t t = a->B(i) & (1 << 7);
> + ret |= i < 8 ? t >> (7 - i) : t << (i - 7);
You can avoid this variable shift by doing
uint32_t t = a->B(i) >> 7;
ret |= t << i;
> +uint64_t glue(helper_pmovmskbq, SUFFIX)(Reg *a, uint32_t desc)
> +{
> + return glue(helper_pmovmskbd, SUFFIX)(a, desc);
> }
...
> +DEF_GEN_INSN2_GVEC(vpmovmskb, Gd, Uqq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ,
> pmovmskbd_xmm)
> +DEF_GEN_INSN2_GVEC(vpmovmskb, Gq, Uqq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ,
> pmovmskbq_xmm)
What is the difference between these two?
Given that we aren't attempting avx512, uint32_t is sufficient for all of the
bytes of a YMM register.
I have a feeling that some of this should simply use target_ulong, so that a
direct assignment to the general register can be done without extra extensions
within the generated code.
r~
- [Qemu-devel] [RFC PATCH v4 70/75] target/i386: convert pavgb/pavgw helpers to gvec style, (continued)
- [Qemu-devel] [RFC PATCH v4 70/75] target/i386: convert pavgb/pavgw helpers to gvec style, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 71/75] target/i386: convert pmuludq/pmaddwd helpers to gvec style, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 73/75] target/i386: remove obsoleted helper_mov(l, q)_mm_T0, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 68/75] target/i386: convert ps((l, r)l(w, d, q), ra(w, d)) to helpers to gvec style, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 63/75] target/i386: introduce AVX2 code generators, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 74/75] target/i386: convert pshuf(w, lw, hw, d), shuf(pd, ps) helpers to gvec style, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 64/75] target/i386: introduce AVX2 vector instructions to sse-opcode.inc.h, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 60/75] target/i386: introduce AVX code generators, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 72/75] target/i386: convert psadbw helper to gvec style, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 75/75] target/i386: convert pmovmskb/movmskps/movmskpd helpers to gvec style, Jan Bobek, 2019/08/21
- Re: [Qemu-devel] [RFC PATCH v4 75/75] target/i386: convert pmovmskb/movmskps/movmskpd helpers to gvec style,
Richard Henderson <=
- [Qemu-devel] [RFC PATCH v4 61/75] target/i386: introduce AVX vector instructions to sse-opcode.inc.h, Jan Bobek, 2019/08/21