re PR target/88547 (missed optimization for vector comparisons)
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 Dec 2018 10:37:11 +0000 (11:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 21 Dec 2018 10:37:11 +0000 (11:37 +0100)
commitd6b612a76f77e7c9ae7712df9312bbcf4a92f048
tree910352153ed156492ad084f92249f0efd6be8f32
parent10d26d9dd2653c251a1c182ceac21baaeb45e83e
re PR target/88547 (missed optimization for vector comparisons)

PR target/88547
* config/i386/i386.c (ix86_expand_int_sse_cmp): Optimize
x > y ? 0 : -1 into min (x, y) == x ? -1 : 0.

* gcc.target/i386/pr88547-1.c: Expect only 2 knotb and 2 knotw
insns instead of 4, check for vpminud, vpminuq and no vpsubd or
vpsubq.
* gcc.target/i386/sse2-pr88547-1.c: New test.
* gcc.target/i386/sse2-pr88547-2.c: New test.
* gcc.target/i386/sse4_1-pr88547-1.c: New test.
* gcc.target/i386/sse4_1-pr88547-2.c: New test.
* gcc.target/i386/avx2-pr88547-1.c: New test.
* gcc.target/i386/avx2-pr88547-2.c: New test.
* gcc.target/i386/avx512f-pr88547-2.c: New test.
* gcc.target/i386/avx512vl-pr88547-1.c: New test.
* gcc.target/i386/avx512vl-pr88547-2.c: New test.
* gcc.target/i386/avx512vl-pr88547-3.c: New test.
* gcc.target/i386/avx512f_cond_move.c (y): Change from unsigned int
array to int array.

From-SVN: r267322
15 files changed:
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx2-pr88547-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx2-pr88547-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-pr88547-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f_cond_move.c
gcc/testsuite/gcc.target/i386/avx512vl-pr88547-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512vl-pr88547-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512vl-pr88547-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr88547-1.c
gcc/testsuite/gcc.target/i386/sse2-pr88547-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse2-pr88547-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse4_1-pr88547-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse4_1-pr88547-2.c [new file with mode: 0644]