public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: hongtao Liu <liuhongt@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-3189] Fix unrecognizable insn of cvtss2si.
Date: Mon, 10 Oct 2022 07:58:18 +0000 (GMT)	[thread overview]
Message-ID: <20221010075818.1FDC83858D37@sourceware.org> (raw)

https://gcc.gnu.org/g:9b8520fa9d745b3a974d5eb98cb4b9a9021b215d

commit r13-3189-g9b8520fa9d745b3a974d5eb98cb4b9a9021b215d
Author: liuhongt <hongtao.liu@intel.com>
Date:   Sun Oct 9 15:30:10 2022 +0800

    Fix unrecognizable insn of cvtss2si.
    
    Adjust lrintmn2 operand preidcates according to real instructions.
    
    gcc/ChangeLog:
    
            PR target/107185
            * config/i386/i386.md (lrint<MODEF:mode><SWI48:mode>2): Swap
            predicate of operands[0] and operands[1].
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr107185.c: New test.

Diff:
---
 gcc/config/i386/i386.md                  | 4 ++--
 gcc/testsuite/gcc.target/i386/pr107185.c | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 1be9b669909..947513701b9 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -20145,8 +20145,8 @@
    (set_attr "mode" "<MODE>")])
 
 (define_expand "lrint<MODEF:mode><SWI48:mode>2"
-  [(set (match_operand:SWI48 0 "nonimmediate_operand")
-     (unspec:SWI48 [(match_operand:MODEF 1 "register_operand")]
+  [(set (match_operand:SWI48 0 "register_operand")
+     (unspec:SWI48 [(match_operand:MODEF 1 "nonimmediate_operand")]
 		   UNSPEC_FIX_NOTRUNC))]
   "SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH")
 
diff --git a/gcc/testsuite/gcc.target/i386/pr107185.c b/gcc/testsuite/gcc.target/i386/pr107185.c
new file mode 100644
index 00000000000..333191a9a89
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr107185.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+void
+foo (float f)
+{
+  long p =  __builtin_lrintf (f);
+}

                 reply	other threads:[~2022-10-10  7:58 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=20221010075818.1FDC83858D37@sourceware.org \
    --to=liuhongt@gcc.gnu.org \
    --cc=gcc-cvs@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).