https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98461

--- Comment #2 from Hongtao.liu <crazylht at gmail dot com> ---
> So add combine splitter?

I'm testing this patch

1 file changed, 15 insertions(+), 1 deletion(-)
gcc/config/i386/sse.md | 16 +++++++++++++++-

modified   gcc/config/i386/sse.md
@@ -640,7 +640,8 @@ (define_mode_attr ssedoublemode

 (define_mode_attr ssebytemode
   [(V8DI "V64QI") (V4DI "V32QI") (V2DI "V16QI")
-   (V16SI "V64QI") (V8SI "V32QI") (V4SI "V16QI")])
+   (V16SI "V64QI") (V8SI "V32QI") (V4SI "V16QI")
+   (V32HI "V64QI") (V16HI "V32QI") (V8HI "V16QI")])

 ;; All 128bit vector integer modes
 (define_mode_iterator VI_128 [V16QI V8HI V4SI V2DI])
@@ -16065,6 +16066,19 @@ (define_insn "<sse2_avx2>_pmovmskb"
    (set_attr "prefix" "maybe_vex")
    (set_attr "mode" "SI")])

+(define_split
+  [(set (match_operand:SI 0 "register_operand")
+       (unspec:SI
+         [(subreg:<ssebytemode>
+            (not:VI248_AVX2
+              (match_operand:VI248_AVX2 1 "register_operand")) 0)]
+         UNSPEC_MOVMSK))]
+  "TARGET_SSE2"
+  [(set (match_dup 0)
+       (unspec:SI [(match_dup 2)] UNSPEC_MOVMSK))
+   (set (match_dup 0) (not:SI (match_dup 0)))]
+  "operands[2] = lowpart_subreg (<ssebytemode>mode, operands[1],
<MODE>mode);")
+
 (define_insn "*<sse2_avx2>_pmovmskb_zext"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (zero_extend:DI

Reply via email to