diff mbox series

i386: Fix some patterns's mem attribute.

Message ID 20241010034603.31847-1-lin1.hu@intel.com
State New
Headers show
Series i386: Fix some patterns's mem attribute. | expand

Commit Message

Hu, Lin1 Oct. 10, 2024, 3:46 a.m. UTC
Hi, all

This is another patch to modify some pattern's type attr from ssemov to
ssemov2.

Some ssemov pattern's mem attr should be load when their 2 operand is a memory
operand.

Bootstrapped and regtested on x86-64-linux-pc, OK for trunk?

BRs,
Lin

gcc/ChangeLog:

	* config/i386/sse.md
	(sse_movhlps): Change type attr from ssemov to ssemov2.
	(sse_loadhps): Ditto.
	(*vec_concat<mode>): Ditto.
	(vec_setv2df_0): Ditto.
	(sse_loadlps): Change attr from ssemov to ssemov2 except for 2, 3.
	(sse2_loadhps): Change attr from ssemov to ssemov2 except for 0, 1.
	(sse2_loadlpd): Change attr from ssemov to ssemov2 except for 0, 1,
	2.
	(sse2_movsd_<mode>): Change attr from ssemov to ssemov2 except for 5.
	(vec_concatv2df): Change attr from ssemov to ssemov2 except for 0, 1,
	2.
	(*vec_concat<mode>): Change attr from ssemov to ssemov2 for 3, 4.
	(vec_concatv2di): Change attr from ssemov to ssemov2 except for 0, 1,
	2, 3, 4, 5.
---
 gcc/config/i386/sse.md | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Comments

Uros Bizjak Oct. 10, 2024, 7:57 a.m. UTC | #1
On Thu, Oct 10, 2024 at 5:46 AM Hu, Lin1 <lin1.hu@intel.com> wrote:
>
> Hi, all
>
> This is another patch to modify some pattern's type attr from ssemov to
> ssemov2.
>
> Some ssemov pattern's mem attr should be load when their 2 operand is a memory
> operand.
>
> Bootstrapped and regtested on x86-64-linux-pc, OK for trunk?
>
> BRs,
> Lin
>
> gcc/ChangeLog:
>
>         * config/i386/sse.md
>         (sse_movhlps): Change type attr from ssemov to ssemov2.
>         (sse_loadhps): Ditto.
>         (*vec_concat<mode>): Ditto.
>         (vec_setv2df_0): Ditto.
>         (sse_loadlps): Change attr from ssemov to ssemov2 except for 2, 3.
>         (sse2_loadhps): Change attr from ssemov to ssemov2 except for 0, 1.
>         (sse2_loadlpd): Change attr from ssemov to ssemov2 except for 0, 1,
>         2.
>         (sse2_movsd_<mode>): Change attr from ssemov to ssemov2 except for 5.
>         (vec_concatv2df): Change attr from ssemov to ssemov2 except for 0, 1,
>         2.
>         (*vec_concat<mode>): Change attr from ssemov to ssemov2 for 3, 4.
>         (vec_concatv2di): Change attr from ssemov to ssemov2 except for 0, 1,
>         2, 3, 4, 5.

LGTM.

Thanks,
Uros.

> ---
>  gcc/config/i386/sse.md | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> index ccef3e063ec..a45b50ad732 100644
> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -10995,7 +10995,7 @@ (define_insn "sse_movhlps"
>     vmovlps\t{%H2, %1, %0|%0, %1, %H2}
>     %vmovhps\t{%2, %0|%q0, %2}"
>    [(set_attr "isa" "noavx,avx,noavx,avx,*")
> -   (set_attr "type" "ssemov")
> +   (set_attr "type" "ssemov2")
>     (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex")
>     (set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")])
>
> @@ -11557,7 +11557,7 @@ (define_insn "sse_loadhps"
>     vmovlhps\t{%2, %1, %0|%0, %1, %2}
>     %vmovlps\t{%2, %H0|%H0, %2}"
>    [(set_attr "isa" "noavx,avx,noavx,avx,*")
> -   (set_attr "type" "ssemov")
> +   (set_attr "type" "ssemov2")
>     (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex")
>     (set_attr "mode" "V2SF,V2SF,V4SF,V4SF,V2SF")])
>
> @@ -11610,7 +11610,7 @@ (define_insn "sse_loadlps"
>     vmovlps\t{%2, %1, %0|%0, %1, %q2}
>     %vmovlps\t{%2, %0|%q0, %2}"
>    [(set_attr "isa" "noavx,avx,noavx,avx,*")
> -   (set_attr "type" "sseshuf,sseshuf,ssemov,ssemov,ssemov")
> +   (set_attr "type" "sseshuf,sseshuf,ssemov2,ssemov2,ssemov")
>     (set (attr "length_immediate")
>       (if_then_else (eq_attr "alternative" "0,1")
>                    (const_string "1")
> @@ -11766,7 +11766,7 @@ (define_insn "*vec_concat<mode>"
>     movhps\t{%2, %0|%0, %q2}
>     vmovhps\t{%2, %1, %0|%0, %1, %q2}"
>    [(set_attr "isa" "noavx,avx,noavx,avx")
> -   (set_attr "type" "ssemov")
> +   (set_attr "type" "ssemov2")
>     (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex")
>     (set_attr "mode" "V4SF,V4SF,V2SF,V2SF")])
>
> @@ -12214,7 +12214,7 @@ (define_insn "vec_setv2df_0"
>     movlpd\t{%2, %0|%0, %2}
>     vmovlpd\t{%2, %1, %0|%0, %1, %2}"
>    [(set_attr "isa" "noavx,avx,noavx,avx")
> -   (set_attr "type" "ssemov")
> +   (set_attr "type" "ssemov2")
>     (set_attr "mode" "DF")])
>
>  (define_expand "vec_set<mode>"
> @@ -14665,7 +14665,7 @@ (define_insn "sse2_loadhpd"
>     #
>     #"
>    [(set_attr "isa" "noavx,avx,noavx,avx,*,*,*")
> -   (set_attr "type" "ssemov,ssemov,sselog,sselog,ssemov,fmov,imov")
> +   (set_attr "type" "ssemov2,ssemov2,sselog,sselog,ssemov,fmov,imov")
>     (set (attr "prefix_data16")
>       (if_then_else (eq_attr "alternative" "0")
>                    (const_string "1")
> @@ -14735,6 +14735,8 @@ (define_insn "sse2_loadlpd"
>               (const_string "fmov")
>             (eq_attr "alternative" "10")
>               (const_string "imov")
> +           (eq_attr "alternative" "0,1,2")
> +             (const_string "ssemov2")
>            ]
>            (const_string "ssemov")))
>     (set (attr "prefix_data16")
> @@ -14787,7 +14789,7 @@ (define_insn "sse2_movsd_<mode>"
>       (if_then_else
>         (eq_attr "alternative" "5")
>         (const_string "sselog")
> -       (const_string "ssemov")))
> +       (const_string "ssemov2")))
>     (set (attr "prefix_data16")
>       (if_then_else
>         (and (eq_attr "alternative" "2,4")
> @@ -14859,7 +14861,7 @@ (define_insn "vec_concatv2df"
>       (if_then_else
>         (eq_attr "alternative" "0,1,2")
>         (const_string "sselog")
> -       (const_string "ssemov")))
> +       (const_string "ssemov2")))
>     (set (attr "prefix_data16")
>         (if_then_else (eq_attr "alternative" "3")
>                       (const_string "1")
> @@ -21545,7 +21547,7 @@ (define_insn "*vec_concat<mode>"
>     movhps\t{%2, %0|%0, %q2}
>     vmovhps\t{%2, %1, %0|%0, %1, %q2}"
>    [(set_attr "isa" "sse2_noavx,avx,noavx,noavx,avx")
> -   (set_attr "type" "sselog,sselog,ssemov,ssemov,ssemov")
> +   (set_attr "type" "sselog,sselog,ssemov,ssemov2,ssemov2")
>     (set_attr "prefix" "orig,maybe_evex,orig,orig,maybe_evex")
>     (set_attr "mode" "TI,TI,V4SF,V2SF,V2SF")])
>
> @@ -21653,7 +21655,7 @@ (define_insn "vec_concatv2di"
>       (if_then_else
>         (eq_attr "alternative" "0,1,2,3,4,5")
>         (const_string "sselog")
> -       (const_string "ssemov")))
> +       (const_string "ssemov2")))
>     (set (attr "addr")
>       (if_then_else (eq_attr "alternative" "0,1")
>                    (const_string "gpr16")
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index ccef3e063ec..a45b50ad732 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -10995,7 +10995,7 @@  (define_insn "sse_movhlps"
    vmovlps\t{%H2, %1, %0|%0, %1, %H2}
    %vmovhps\t{%2, %0|%q0, %2}"
   [(set_attr "isa" "noavx,avx,noavx,avx,*")
-   (set_attr "type" "ssemov")
+   (set_attr "type" "ssemov2")
    (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex")
    (set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")])
 
@@ -11557,7 +11557,7 @@  (define_insn "sse_loadhps"
    vmovlhps\t{%2, %1, %0|%0, %1, %2}
    %vmovlps\t{%2, %H0|%H0, %2}"
   [(set_attr "isa" "noavx,avx,noavx,avx,*")
-   (set_attr "type" "ssemov")
+   (set_attr "type" "ssemov2")
    (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex,maybe_vex")
    (set_attr "mode" "V2SF,V2SF,V4SF,V4SF,V2SF")])
 
@@ -11610,7 +11610,7 @@  (define_insn "sse_loadlps"
    vmovlps\t{%2, %1, %0|%0, %1, %q2}
    %vmovlps\t{%2, %0|%q0, %2}"
   [(set_attr "isa" "noavx,avx,noavx,avx,*")
-   (set_attr "type" "sseshuf,sseshuf,ssemov,ssemov,ssemov")
+   (set_attr "type" "sseshuf,sseshuf,ssemov2,ssemov2,ssemov")
    (set (attr "length_immediate")
      (if_then_else (eq_attr "alternative" "0,1")
 		   (const_string "1")
@@ -11766,7 +11766,7 @@  (define_insn "*vec_concat<mode>"
    movhps\t{%2, %0|%0, %q2}
    vmovhps\t{%2, %1, %0|%0, %1, %q2}"
   [(set_attr "isa" "noavx,avx,noavx,avx")
-   (set_attr "type" "ssemov")
+   (set_attr "type" "ssemov2")
    (set_attr "prefix" "orig,maybe_evex,orig,maybe_evex")
    (set_attr "mode" "V4SF,V4SF,V2SF,V2SF")])
 
@@ -12214,7 +12214,7 @@  (define_insn "vec_setv2df_0"
    movlpd\t{%2, %0|%0, %2}
    vmovlpd\t{%2, %1, %0|%0, %1, %2}"
   [(set_attr "isa" "noavx,avx,noavx,avx")
-   (set_attr "type" "ssemov")
+   (set_attr "type" "ssemov2")
    (set_attr "mode" "DF")])
 
 (define_expand "vec_set<mode>"
@@ -14665,7 +14665,7 @@  (define_insn "sse2_loadhpd"
    #
    #"
   [(set_attr "isa" "noavx,avx,noavx,avx,*,*,*")
-   (set_attr "type" "ssemov,ssemov,sselog,sselog,ssemov,fmov,imov")
+   (set_attr "type" "ssemov2,ssemov2,sselog,sselog,ssemov,fmov,imov")
    (set (attr "prefix_data16")
      (if_then_else (eq_attr "alternative" "0")
 		   (const_string "1")
@@ -14735,6 +14735,8 @@  (define_insn "sse2_loadlpd"
 	      (const_string "fmov")
 	    (eq_attr "alternative" "10")
 	      (const_string "imov")
+	    (eq_attr "alternative" "0,1,2")
+	      (const_string "ssemov2")
 	   ]
 	   (const_string "ssemov")))
    (set (attr "prefix_data16")
@@ -14787,7 +14789,7 @@  (define_insn "sse2_movsd_<mode>"
      (if_then_else
        (eq_attr "alternative" "5")
        (const_string "sselog")
-       (const_string "ssemov")))
+       (const_string "ssemov2")))
    (set (attr "prefix_data16")
      (if_then_else
        (and (eq_attr "alternative" "2,4")
@@ -14859,7 +14861,7 @@  (define_insn "vec_concatv2df"
      (if_then_else
        (eq_attr "alternative" "0,1,2")
        (const_string "sselog")
-       (const_string "ssemov")))
+       (const_string "ssemov2")))
    (set (attr "prefix_data16")
 	(if_then_else (eq_attr "alternative" "3")
 		      (const_string "1")
@@ -21545,7 +21547,7 @@  (define_insn "*vec_concat<mode>"
    movhps\t{%2, %0|%0, %q2}
    vmovhps\t{%2, %1, %0|%0, %1, %q2}"
   [(set_attr "isa" "sse2_noavx,avx,noavx,noavx,avx")
-   (set_attr "type" "sselog,sselog,ssemov,ssemov,ssemov")
+   (set_attr "type" "sselog,sselog,ssemov,ssemov2,ssemov2")
    (set_attr "prefix" "orig,maybe_evex,orig,orig,maybe_evex")
    (set_attr "mode" "TI,TI,V4SF,V2SF,V2SF")])
 
@@ -21653,7 +21655,7 @@  (define_insn "vec_concatv2di"
      (if_then_else
        (eq_attr "alternative" "0,1,2,3,4,5")
        (const_string "sselog")
-       (const_string "ssemov")))
+       (const_string "ssemov2")))
    (set (attr "addr")
      (if_then_else (eq_attr "alternative" "0,1")
 		   (const_string "gpr16")