]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Add variable vec_set for 32bit vectors [PR97194]
authorUros Bizjak <ubizjak@gmail.com>
Tue, 6 Jul 2021 17:27:34 +0000 (19:27 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Tue, 6 Jul 2021 17:28:35 +0000 (19:28 +0200)
commitf65878178ab05180a5937f11f8fdb755678a82ce
tree7ac7267296f21e9246f3ac19a4b5b81687cf633e
parent6b096c17314a46f285fa26670048f287a399573f
i386: Add variable vec_set for 32bit vectors [PR97194]

To generate sane code a SSE4.1 variable PBLENDV instruction is needed.

Also enable variable vec_set through vec_setm_operand predicate
for TARGET_SSE4_1 instead of TARGET_AVX2.  ix86_expand_vector_init_duplicate
is able to emulate vpbroadcast{b,w} with pxor/pshufb.

2021-07-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/97194
* config/i386/predicates.md (vec_setm_operand): Enable
register_operand for TARGET_SSE4_1.
* config/i386/mmx.md (vec_setv2hi): Use vec_setm_operand
as operand 2 predicate.  Call ix86_expand_vector_set_var
for non-constant index operand.
(vec_setv4qi): Use vec_setm_mmx_operand as operand 2 predicate.
Call ix86_expand_vector_set_var for non-constant index operand.

gcc/testsuite/

PR target/97194
* gcc.target/i386/sse4_1-vec-set-1a.c: New test.
* gcc.target/i386/sse4_1-vec-set-2a.c: Ditto.
gcc/config/i386/mmx.md
gcc/config/i386/predicates.md
gcc/testsuite/gcc.target/i386/sse4_1-vec-set-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse4_1-vec-set-2a.c [new file with mode: 0644]