public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] i386: Fix <rounding_insn><mode>2 expander [PR95255]
@ 2020-08-22 21:30 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 21:30 UTC (permalink / raw)
  To: gcc-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 3325 bytes --]

https://gcc.gnu.org/g:7c8fc3d3534e7515808df95c7cb1e7d5ececec02

commit 7c8fc3d3534e7515808df95c7cb1e7d5ececec02
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri May 22 18:02:49 2020 +0200

    i386: Fix <rounding_insn><mode>2 expander [PR95255]
    
    2020-05-22  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/ChangeLog:
            PR target/95255
            * config/i386/i386.md (<rounding_insn><mode>2): Do not try to
            expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.
    
    gcc/testsuite/ChangeLog:
            PR target/95255
            * gcc.target/i386/pr95255.c: New test.

Diff:
---
 gcc/ChangeLog                           |  6 ++++++
 gcc/config/i386/i386.md                 | 12 +++++++-----
 gcc/testsuite/ChangeLog                 |  5 +++++
 gcc/testsuite/gcc.target/i386/pr95255.c |  8 ++++++++
 4 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cef15b09314..8f80df5d6d5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-22  Uroš Bizjak  <ubizjak@gmail.com>
+
+	PR target/95255
+	* config/i386/i386.md (<rounding_insn><mode>2): Do not try to
+	expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.
+
 2020-05-22  Jan Hubicka  <hubicka@ucw.cz>
 
 	* lto-streamer-out.c (lto_output_tree): Do not stream final ref if
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e81c737b7bc..459cf62b0de 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -17115,16 +17115,18 @@
     && (flag_fp_int_builtin_inexact || !flag_trapping_math))
    || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
        && (TARGET_SSE4_1
-	  || (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
-	      && (flag_fp_int_builtin_inexact || !flag_trapping_math))))"
+	   || (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
+	       && (flag_fp_int_builtin_inexact || !flag_trapping_math))))"
 {
   if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
-      && (TARGET_SSE4_1 || flag_fp_int_builtin_inexact || !flag_trapping_math))
+      && (TARGET_SSE4_1
+	  || (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
+	      && (flag_fp_int_builtin_inexact || !flag_trapping_math))))
     {
       if (TARGET_SSE4_1)
 	emit_insn (gen_sse4_1_round<mode>2
-		   (operands[0], operands[1], GEN_INT (ROUND_<ROUNDING>
-						       | ROUND_NO_EXC)));
+		   (operands[0], operands[1],
+		    GEN_INT (ROUND_<ROUNDING> | ROUND_NO_EXC)));
       else if (TARGET_64BIT || (<MODE>mode != DFmode))
 	{
 	  if (ROUND_<ROUNDING> == ROUND_FLOOR)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7812e3f0f57..1dbdc389ab9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-22  Uroš Bizjak  <ubizjak@gmail.com>
+
+	PR target/95255
+	* gcc.target/i386/pr95255.c: New test.
+
 2020-05-22  Hongtao.liu  <hongtao.liu@intel.com>
 
 	* gcc.target/i386/pr92658-avx512f.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr95255.c b/gcc/testsuite/gcc.target/i386/pr95255.c
new file mode 100644
index 00000000000..5b731941f72
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95255.c
@@ -0,0 +1,8 @@
+/* PR target/95255 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2 -mno-sse4.1 -mfpmath=both" } */
+
+double foo (double x)
+{
+  return __builtin_roundeven (x);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 21:30 [gcc/devel/autopar_devel] i386: Fix <rounding_insn><mode>2 expander [PR95255] Giuliano Belinassi

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