diff mbox series

[committed] i386: Add SSE2 alternative to mmx_pswapd2vsi2

Message ID CAFULd4bZ3fix+-qXeRL5Fm_4gzOYcW3tVDzvZxQyU-b08LY7XQ@mail.gmail.com
State New
Headers show
Series [committed] i386: Add SSE2 alternative to mmx_pswapd2vsi2 | expand

Commit Message

Uros Bizjak May 26, 2020, 5:19 p.m. UTC
2020-05-26  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
    * config/i386/mmx.md (mmx_pswapdv2si2): Add SSE2 alternative.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Uros.
diff mbox series

Patch

diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index c31b4f81079..215162dedb5 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -2011,15 +2011,21 @@ 
    (set_attr "mode" "TI")])
 
 (define_insn "mmx_pswapdv2si2"
-  [(set (match_operand:V2SI 0 "register_operand" "=y")
+  [(set (match_operand:V2SI 0 "register_operand" "=y,Yv")
 	(vec_select:V2SI
-	  (match_operand:V2SI 1 "nonimmediate_operand" "ym")
+	  (match_operand:V2SI 1 "register_mmxmem_operand" "ym,Yv")
 	  (parallel [(const_int 1) (const_int 0)])))]
-  "TARGET_3DNOW_A"
-  "pswapd\t{%1, %0|%0, %1}"
-  [(set_attr "type" "mmxcvt")
-   (set_attr "prefix_extra" "1")
-   (set_attr "mode" "DI")])
+  "TARGET_3DNOW_A || TARGET_MMX_WITH_SSE"
+  "@
+   pswapd\t{%1, %0|%0, %1}
+   %vpshufd\t{$0xe1, %1, %0|%0, %1, 0xe1}";
+  [(set_attr "isa" "*,sse2")
+   (set_attr "mmx_isa" "native,*")
+   (set_attr "type" "mmxcvt,sselog1")
+   (set_attr "prefix_extra" "1,*")
+   (set_attr "prefix_data16" "*,1")
+   (set_attr "length_immediate" "*,1")
+   (set_attr "mode" "DI,TI")])
 
 (define_insn "*vec_dupv4hi"
   [(set (match_operand:V4HI 0 "register_operand" "=y,xYw")