public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch][x86] Remove old rounding code
@ 2017-06-21  8:41 Koval, Julia
  2017-07-06 11:04 ` Kirill Yukhin
  0 siblings, 1 reply; 2+ messages in thread
From: Koval, Julia @ 2017-06-21  8:41 UTC (permalink / raw)
  To: GCC Patches; +Cc: Uros Bizjak, Kirill Yukhin

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

Hi,
This patch removes old parallel code for avx512er. Parallel in this case can't be generated anymore, because all existing patterns were reworked to unspec in r249423 and r249009. Ok for trunk?

gcc/
	* gcc/config/i386/i386.c (ix86_erase_embedded_rounding):
	Remove code for old rounding pattern.

Thanks,
Julia

[-- Attachment #2: 0001-remove-code-for-old-rounding.patch --]
[-- Type: application/octet-stream, Size: 2633 bytes --]

From 1704a30a7ed5815f8eae62777015fa99b6ed2e47 Mon Sep 17 00:00:00 2001
From: "julia.koval" <jkoval@gkliclel110.igk.intel.com>
Date: Wed, 21 Jun 2017 10:20:55 +0300
Subject: [PATCH] remove code for old rounding

---
 gcc/config/i386/i386.c | 68 +++++++++-----------------------------------------
 1 file changed, 12 insertions(+), 56 deletions(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 9f7290a..ff7968ecc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -36438,21 +36438,11 @@ ix86_expand_args_builtin (const struct builtin_description *d,
 }
 
 /* Transform pattern of following layout:
-     (parallel [
-       set (A B)
-       (unspec [C] UNSPEC_EMBEDDED_ROUNDING)])
-     ])
+     (set A
+       (unspec [B C] UNSPEC_EMBEDDED_ROUNDING))
+     )
    into:
-     (set (A B))
-
-   Or:
-     (parallel [ A B
-     ...
-     (unspec [C] UNSPEC_EMBEDDED_ROUNDING)
-     ...
-     ])
-   into:
-     (parallel [ A B ... ])  */
+     (set (A B)) */
 
 static rtx
 ix86_erase_embedded_rounding (rtx pat)
@@ -36460,48 +36450,14 @@ ix86_erase_embedded_rounding (rtx pat)
   if (GET_CODE (pat) == INSN)
     pat = PATTERN (pat);
 
-  if (GET_CODE (pat) == PARALLEL)
-  {
-    if (XVECLEN (pat, 0) == 2)
-      {
-	rtx p0 = XVECEXP (pat, 0, 0);
-	rtx p1 = XVECEXP (pat, 0, 1);
-	gcc_assert (GET_CODE (p0) == SET
-		    && GET_CODE (p1) == UNSPEC
-		    && XINT (p1, 1) == UNSPEC_EMBEDDED_ROUNDING);
-	return p0;
-      }
-    else
-      {
-	rtx *res = XALLOCAVEC (rtx, XVECLEN (pat, 0));
-	int i = 0;
-	int j = 0;
-
-	for (; i < XVECLEN (pat, 0); ++i)
-	  {
-	    rtx elem = XVECEXP (pat, 0, i);
-	    if (GET_CODE (elem) != UNSPEC
-		|| XINT (elem, 1) != UNSPEC_EMBEDDED_ROUNDING)
-	      res[j++] = elem;
-	  }
-
-	/*  No more than 1 occurence was removed.  */
-	gcc_assert (j >= XVECLEN (pat, 0) - 1);
-
-	return gen_rtx_PARALLEL (GET_MODE (pat), gen_rtvec_v (j, res));
-    }
-  }
-  else
-  {
-    gcc_assert (GET_CODE (pat) == SET);
-    rtx src = SET_SRC (pat);
-    gcc_assert (XVECLEN (src, 0) == 2);
-    rtx p0 = XVECEXP (src, 0, 0);
-    gcc_assert (GET_CODE (src) == UNSPEC
-		&& XINT (src, 1) == UNSPEC_EMBEDDED_ROUNDING);
-    rtx res = gen_rtx_SET (SET_DEST (pat), p0);
-    return res;
-  }
+  gcc_assert (GET_CODE (pat) == SET);
+  rtx src = SET_SRC (pat);
+  gcc_assert (XVECLEN (src, 0) == 2);
+  rtx p0 = XVECEXP (src, 0, 0);
+  gcc_assert (GET_CODE (src) == UNSPEC
+	      && XINT (src, 1) == UNSPEC_EMBEDDED_ROUNDING);
+  rtx res = gen_rtx_SET (SET_DEST (pat), p0);
+  return res;
 }
 
 /* Subroutine of ix86_expand_round_builtin to take care of comi insns
-- 
2.5.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch][x86] Remove old rounding code
  2017-06-21  8:41 [patch][x86] Remove old rounding code Koval, Julia
@ 2017-07-06 11:04 ` Kirill Yukhin
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill Yukhin @ 2017-07-06 11:04 UTC (permalink / raw)
  To: Koval, Julia; +Cc: GCC Patches, Uros Bizjak

Hello Julia,
On 21 Jun 08:41, Koval, Julia wrote:
> Hi,
> This patch removes old parallel code for avx512er. Parallel in this case can't be generated anymore, because all existing patterns were reworked to unspec in r249423 and r249009. Ok for trunk?
Your patch is OK for trunk. I've comitted it.

> Thanks,
> Julia

--
Thanks, K


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-06 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21  8:41 [patch][x86] Remove old rounding code Koval, Julia
2017-07-06 11:04 ` Kirill Yukhin

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).