i386: Add ssse3_pmulhrswv4hi3 expander
authorH.J. Lu <hongjiu.lu@intel.com>
Sat, 16 Feb 2019 22:16:04 +0000 (22:16 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sat, 16 Feb 2019 22:16:04 +0000 (14:16 -0800)
There is no V4HI pmulhrsw in AVX512BW and V4HI/V8HI pmulhrsw don't require
AVX2.

PR target/89372
* config/i386/sse.md (ssedoublemode): Remove V4HI.
(PMULHRSW): Likewise.
(<ssse3_avx2>_pmulhrsw<mode>3): Require TARGET_SSSE3, not
TARGET_AVX2.
(ssse3_pmulhrswv4hi3): New expander.

From-SVN: r268964

gcc/ChangeLog
gcc/config/i386/sse.md

index 58e991d9455723227b6b199a2a3a7395ed669617..d80e4f46e5aa1fa3e4f6f9491895e4a8459d529e 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/89372
+       * config/i386/sse.md (ssedoublemode): Remove V4HI.
+       (PMULHRSW): Likewise.
+       (<ssse3_avx2>_pmulhrsw<mode>3): Require TARGET_SSSE3, not
+       TARGET_AVX2.
+       (ssse3_pmulhrswv4hi3): New expander.
+
 2019-02-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/mmx.md (*vec_extractv2si_zext_mem): Doesn't require
index 8281fe2d3986ae9899dd2df5470f2c80a9050743..8036136752ad7dde03911d0af72da8923212d4b9 100644 (file)
   [(V4SF "V8SF") (V8SF "V16SF") (V16SF "V32SF")
    (V2DF "V4DF") (V4DF "V8DF") (V8DF "V16DF")
    (V16QI "V16HI") (V32QI "V32HI") (V64QI "V64HI")
-   (V4HI "V4SI") (V8HI "V8SI") (V16HI "V16SI") (V32HI "V32SI")
+   (V8HI "V8SI") (V16HI "V16SI") (V32HI "V32SI")
    (V4SI "V4DI") (V8SI "V16SI") (V16SI "V32SI")
    (V4DI "V8DI") (V8DI "V16DI")])
 
    (set_attr "mode" "DI")])
 
 (define_mode_iterator PMULHRSW
-  [V4HI V8HI (V16HI "TARGET_AVX2")])
+  [V8HI (V16HI "TARGET_AVX2")])
 
 (define_expand "<ssse3_avx2>_pmulhrsw<mode>3_mask"
   [(set (match_operand:PMULHRSW 0 "register_operand")
                (const_int 14))
              (match_dup 3))
            (const_int 1))))]
-  "TARGET_AVX2"
+  "TARGET_SSSE3"
 {
   operands[3] = CONST1_RTX(<MODE>mode);
   ix86_fixup_binary_operands_no_copy (MULT, <MODE>mode, operands);
    (set_attr "prefix" "orig,maybe_evex,evex")
    (set_attr "mode" "<sseinsnmode>")])
 
+(define_expand "ssse3_pmulhrswv4hi3"
+  [(set (match_operand:V4HI 0 "register_operand")
+       (truncate:V4HI
+         (lshiftrt:V4SI
+           (plus:V4SI
+             (lshiftrt:V4SI
+               (mult:V4SI
+                 (sign_extend:V4SI
+                   (match_operand:V4HI 1 "nonimmediate_operand"))
+                 (sign_extend:V4SI
+                   (match_operand:V4HI 2 "nonimmediate_operand")))
+               (const_int 14))
+             (match_dup 3))
+           (const_int 1))))]
+  "TARGET_SSSE3"
+{
+  operands[3] = CONST1_RTX(V4HImode);
+  ix86_fixup_binary_operands_no_copy (MULT, V4HImode, operands);
+})
+
 (define_insn "*ssse3_pmulhrswv4hi3"
   [(set (match_operand:V4HI 0 "register_operand" "=y")
        (truncate:V4HI