public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH] i386: Robustify V2QI and V4QI move patterns
Date: Fri, 7 Jan 2022 20:43:33 +0100	[thread overview]
Message-ID: <CAFULd4aB=uedSWAJGCMPTUGv=zL+n=Qf-nR4yp-94jFPfA4gDA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Add sse2 isa attribute where needed and remove where not needed.

2022-01-07  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

    * config/i386/mmx.md (*move<V_32:mode>_internal): Add isa attribute.
    (*movv2qi_internal): Remve sse2 requirement for alternatives 4,5.

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

Pushed to master.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1323 bytes --]

diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 8e0a6490b7b..4fc3e00f100 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -285,7 +285,12 @@
       gcc_unreachable ();
     }
 }
-  [(set (attr "type")
+  [(set (attr "isa")
+     (cond [(eq_attr "alternative" "6,7")
+	      (const_string "sse2")
+	   ]
+	   (const_string "*")))
+   (set (attr "type")
      (cond [(eq_attr "alternative" "2")
 	      (const_string "sselog1")
 	    (eq_attr "alternative" "3,4,5,6,7")
@@ -306,12 +311,15 @@
 		       (const_string "V4SF")
 		     (match_test "TARGET_AVX")
 		       (const_string "TI")
-		     (match_test "optimize_function_for_size_p (cfun)")
+		     (ior (not (match_test "TARGET_SSE2"))
+			  (match_test "optimize_function_for_size_p (cfun)"))
 		       (const_string "V4SF")
 		    ]
 		    (const_string "TI"))
+
 	    (and (eq_attr "alternative" "4,5")
-		 (match_test "<MODE>mode == V2HFmode"))
+		 (ior (match_test "<MODE>mode == V2HFmode")
+		      (not (match_test "TARGET_SSE2"))))
 	      (const_string "SF")
 	   ]
 	   (const_string "SI")))
@@ -401,7 +409,7 @@
     }
 }
   [(set (attr "isa")
-	(cond [(eq_attr "alternative" "4,5,6,8,9")
+	(cond [(eq_attr "alternative" "6,8,9")
 		  (const_string "sse2")
 	       (eq_attr "alternative" "7")
 		  (const_string "sse4")

                 reply	other threads:[~2022-01-07 19:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFULd4aB=uedSWAJGCMPTUGv=zL+n=Qf-nR4yp-94jFPfA4gDA@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).