From: "Koval, Julia" <julia.koval@intel.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Uros Bizjak <ubizjak@gmail.com>,
"Peryt, Sebastian" <sebastian.peryt@intel.com>
Subject: [PATCH][x86][PR73350][PR80862]
Date: Fri, 26 May 2017 09:30:00 -0000 [thread overview]
Message-ID: <4E89A029A0F8D443B436A5167BA3C53F1994C3CC@IRSMSX101.ger.corp.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Hi,
This patch fixes these PR's. Ok for trunk?
gcc/
* config/i386/subst.md (round): Fix round pattern.
* config/i386/i386.c (ix86_erase_embedded_rounding):
Fix erasing rounding for the fixed pattern.
Thanks,
Julia
[-- Attachment #2: 0001-patch_1.patch --]
[-- Type: application/octet-stream, Size: 3350 bytes --]
From 41c2f87eaae29f2d3fcea3e8253308cad058dcee Mon Sep 17 00:00:00 2001
From: "julia.koval" <jkoval@gkliclel110.igk.intel.com>
Date: Fri, 26 May 2017 00:07:59 +0300
Subject: [PATCH] patch_1
---
gcc/config/i386/i386.c | 64 ++++++++++++++++++++++++++++--------------------
gcc/config/i386/subst.md | 10 ++++----
2 files changed, 42 insertions(+), 32 deletions(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6413aa3..707351f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -36483,38 +36483,48 @@ ix86_erase_embedded_rounding (rtx pat)
if (GET_CODE (pat) == INSN)
pat = PATTERN (pat);
- gcc_assert (GET_CODE (pat) == PARALLEL);
+ 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;
- if (XVECLEN (pat, 0) == 2)
- {
- rtx p0 = XVECEXP (pat, 0, 0);
- rtx p1 = XVECEXP (pat, 0, 1);
+ 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;
+ }
- gcc_assert (GET_CODE (p0) == SET
- && GET_CODE (p1) == UNSPEC
- && XINT (p1, 1) == UNSPEC_EMBEDDED_ROUNDING);
+ /* No more than 1 occurence was removed. */
+ gcc_assert (j >= XVECLEN (pat, 0) - 1);
- return p0;
+ return gen_rtx_PARALLEL (GET_MODE (pat), gen_rtvec_v (j, res));
}
+ }
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));
- }
+ {
+ 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
diff --git a/gcc/config/i386/subst.md b/gcc/config/i386/subst.md
index 0bc22fd..2e632b9 100644
--- a/gcc/config/i386/subst.md
+++ b/gcc/config/i386/subst.md
@@ -137,12 +137,12 @@
(define_subst "round"
[(set (match_operand:SUBST_A 0)
- (match_operand:SUBST_A 1))]
+ (match_operand:SUBST_A 1))]
"TARGET_AVX512F"
- [(parallel[
- (set (match_dup 0)
- (match_dup 1))
- (unspec [(match_operand:SI 2 "const_4_or_8_to_11_operand")] UNSPEC_EMBEDDED_ROUNDING)])])
+ [(set (match_dup 0)
+ (unspec:SUBST_A [(match_dup 1)
+ (match_operand:SI 2 "const_4_or_8_to_11_operand")]
+ UNSPEC_EMBEDDED_ROUNDING))])
(define_subst_attr "round_saeonly_name" "round_saeonly" "" "_round")
(define_subst_attr "round_saeonly_mask_operand2" "mask" "%r2" "%r4")
--
2.5.5
next reply other threads:[~2017-05-26 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 9:30 Koval, Julia [this message]
2017-05-30 7:13 ` [PATCH][x86][PR73350][PR80862] Uros Bizjak
2017-05-31 8:48 ` [PATCH][x86][PR73350][PR80862] Kirill Yukhin
2017-05-31 10:34 ` [PATCH][x86][PR73350][PR80862] Kirill Yukhin
2017-06-05 10:13 ` [PATCH][x86][PR73350][PR80862] Koval, Julia
2017-06-08 11:26 ` [PATCH][x86][PR73350][PR80862] Kirill Yukhin
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=4E89A029A0F8D443B436A5167BA3C53F1994C3CC@IRSMSX101.ger.corp.intel.com \
--to=julia.koval@intel.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=sebastian.peryt@intel.com \
--cc=ubizjak@gmail.com \
/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).