diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e51c0e09722..b796203aed6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2020-05-05 Jakub Jelinek + PR target/94942 + * config/i386/mmx.md (*vec_dupv4hi): Use xYw constraints instead of Yv. + PR tree-optimization/94914 * match.pd ((((type)A * B) >> prec) != 0 to .MUL_OVERFLOW(A, B) != 0): New simplification. diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index c3f195bb34a..472f90f9bc1 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1613,10 +1613,10 @@ (set_attr "mode" "DI")]) (define_insn_and_split "*vec_dupv4hi" - [(set (match_operand:V4HI 0 "register_operand" "=y,Yv,Yw") + [(set (match_operand:V4HI 0 "register_operand" "=y,xYw,Yw") (vec_duplicate:V4HI (truncate:HI - (match_operand:SI 1 "register_operand" "0,Yv,r"))))] + (match_operand:SI 1 "register_operand" "0,xYw,r"))))] "(TARGET_MMX || TARGET_MMX_WITH_SSE) && (TARGET_SSE || TARGET_3DNOW_A)" "@ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a44c70a777..6475b7d6ff4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2020-05-05 Jakub Jelinek + PR target/94942 + * gcc.target/i386/pr94942.c: New test. + PR tree-optimization/94914 * gcc.target/i386/pr94914.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr94942.c b/gcc/testsuite/gcc.target/i386/pr94942.c new file mode 100644 index 00000000000..b20f7a62e91 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr94942.c @@ -0,0 +1,24 @@ +/* PR target/94942 */ +/* { dg-do compile } */ +/* { dg-options "-O -flive-range-shrinkage -ftree-vrp -mavx512vl -mno-avx512bw -Wno-div-by-zero" } */ + +typedef unsigned __attribute__((__vector_size__(8))) U; +typedef short __attribute__((__vector_size__(8))) V; +typedef char __attribute__((__vector_size__(16))) W; +typedef int __attribute__((__vector_size__(16))) Z; +int i, j, n, o; +W k; +Z l; +char m; + +U +foo (U q, long long r, V s) +{ + Z t = (i & i - (Z){10} & 4) - (0 != j); + Z u = o * (j * l); + s -= (char)__builtin_clrsbll (n); + W v = (k | k >> m + (W){4}) % 0; + W w = v + (W)t + (W)u; + U x = ((union { W a; U b; })w).b + q + (U)s + (U)r; + return x; +}