From 0c0b5b658c651d4b8161790ebad8fceb27aee945 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 11 Apr 2018 13:37:01 +0200 Subject: [PATCH] re PR target/85281 (Assembler messages: Error: operand size mismatch for `vpbroadcastb' with -mavx512bw -masm=intel) PR target/85281 * config/i386/sse.md (iptr): Add V16SFmode and V8DFmode cases. (_vec_dup): Use a single pattern for modes other than V2DFmode using iptr mode attribute. (_vec_dup): Use iptr mode attribute. * gcc.target/i386/pr85281.c: New test. From-SVN: r259316 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/sse.md | 8 +++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr85281.c | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr85281.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b17a9e4ea5..9c86c5565d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-04-11 Jakub Jelinek + + PR target/85281 + * config/i386/sse.md (iptr): Add V16SFmode and V8DFmode cases. + (_vec_dup): Use a single pattern for modes + other than V2DFmode using iptr mode attribute. + (_vec_dup): Use iptr mode attribute. + 2018-04-11 Alexander Monakov PR rtl-optimization/84659 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index caca42d9e0d..8c970e0cc8a 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -804,6 +804,7 @@ [(V64QI "b") (V32HI "w") (V16SI "k") (V8DI "q") (V32QI "b") (V16HI "w") (V8SI "k") (V4DI "q") (V16QI "b") (V8HI "w") (V4SI "k") (V2DI "q") + (V16SF "k") (V8DF "q") (V8SF "k") (V4DF "q") (V4SF "k") (V2DF "q") (SF "k") (DF "q")]) @@ -17686,10 +17687,7 @@ if (mode == V2DFmode) return "vpbroadcastq\t{%1, %0|%0, %q1}"; - if (GET_MODE_SIZE (GET_MODE_INNER (mode)) == 4) - return "vbroadcast\t{%1, %0|%0, %k1}"; - else - return "vbroadcast\t{%1, %0|%0, %q1}"; + return "vbroadcast\t{%1, %0|%0, %1}"; } [(set_attr "type" "ssemov") (set_attr "prefix" "evex") @@ -17702,7 +17700,7 @@ (match_operand: 1 "nonimmediate_operand" "vm") (parallel [(const_int 0)]))))] "TARGET_AVX512BW" - "vpbroadcast\t{%1, %0|%0, %1}" + "vpbroadcast\t{%1, %0|%0, %1}" [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 27e92c51cb4..8deaeb95974 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-11 Jakub Jelinek + + PR target/85281 + * gcc.target/i386/pr85281.c: New test. + 2018-04-11 Alexander Monakov PR rtl-optimization/84659 diff --git a/gcc/testsuite/gcc.target/i386/pr85281.c b/gcc/testsuite/gcc.target/i386/pr85281.c new file mode 100644 index 00000000000..29039866c95 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85281.c @@ -0,0 +1,15 @@ +/* PR target/85281 */ +/* { dg-do assemble { target avx512bw } } */ +/* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target masm_intel } */ +/* { dg-options "-O -mavx512bw -masm=intel -w" } */ + +typedef char V __attribute__ ((__vector_size__ (64))); + +V +foo (V v) +{ + v[8] /= (unsigned __int128) 0; + v[0] -= ~255; + return v; +} -- 2.30.2