public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Restore Skylake SImode hard register store cost
@ 2019-09-18 18:06 H.J. Lu
  2019-09-18 19:42 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2019-09-18 18:06 UTC (permalink / raw)
  To: GCC Patches, Uros Bizjak

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

On Skylake, we should move integer register to SSE register without
going through memory.  This patch restores Skylake SImode hard register
store cost to 6.

gcc/

PR target/90878
* config/i386/x86-tune-costs.h (skylake_cost): Restore SImode
hard register store cost to 6.

gcc/testsuite/

PR target/90878
* gcc.target/i386/pr90878.c: New test.

OK for trunk?

Thanks.

-- 
H.J.

[-- Attachment #2: 0001-i386-Restore-Skylake-SImode-hard-register-store-cost.patch --]
[-- Type: text/x-patch, Size: 2104 bytes --]

From 827748528f5418fb3d28d4f023bd158e7951d33c Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 14 Aug 2019 19:42:52 -0700
Subject: [PATCH] i386: Restore Skylake SImode hard register store cost

On Skylake, we should move integer register to SSE register without
going through memory.  This patch restores Skylake SImode hard register
store cost to 6.

gcc/

	PR target/90878
	* config/i386/x86-tune-costs.h (skylake_cost): Restore SImode
	hard register store cost to 6.

gcc/testsuite/

	PR target/90878
	* gcc.target/i386/pr90878.c: New test.
---
 gcc/config/i386/x86-tune-costs.h        |  2 +-
 gcc/testsuite/gcc.target/i386/pr90878.c | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90878.c

diff --git a/gcc/config/i386/x86-tune-costs.h b/gcc/config/i386/x86-tune-costs.h
index 00edece3eb68..7a2c7c55b4cc 100644
--- a/gcc/config/i386/x86-tune-costs.h
+++ b/gcc/config/i386/x86-tune-costs.h
@@ -1594,7 +1594,7 @@ struct processor_costs skylake_cost = {
   {4, 4, 4},				/* cost of loading integer registers
 					   in QImode, HImode and SImode.
 					   Relative to reg-reg move (2).  */
-  {6, 6, 3},				/* cost of storing integer registers */
+  {6, 6, 6},				/* cost of storing integer registers */
   2,					/* cost of reg,reg fld/fst */
   {6, 6, 8},				/* cost of loading fp registers
 					   in SFmode, DFmode and XFmode */
diff --git a/gcc/testsuite/gcc.target/i386/pr90878.c b/gcc/testsuite/gcc.target/i386/pr90878.c
new file mode 100644
index 000000000000..18dd64bdaa7a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr90878.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=skylake" } */
+
+union ieee754_float
+  {
+    float f;
+
+    struct
+      {
+	unsigned int mantissa:23;
+	unsigned int exponent:8;
+	unsigned int negative:1;
+      } ieee;
+};
+
+double
+foo (float f)
+{
+  union ieee754_float u;
+  u.f = f;
+  u.ieee.negative = 0;
+  return u.f;
+}
+
+/* { dg-final { scan-assembler-not "vcvtss2sd\[^\\n\]*\\\(%.sp\\\)" } } */
-- 
2.20.1


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

* Re: [PATCH] i386: Restore Skylake SImode hard register store cost
  2019-09-18 18:06 [PATCH] i386: Restore Skylake SImode hard register store cost H.J. Lu
@ 2019-09-18 19:42 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2019-09-18 19:42 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GCC Patches

On Wed, Sep 18, 2019 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Skylake, we should move integer register to SSE register without
> going through memory.  This patch restores Skylake SImode hard register
> store cost to 6.
>
> gcc/
>
> PR target/90878
> * config/i386/x86-tune-costs.h (skylake_cost): Restore SImode
> hard register store cost to 6.
>
> gcc/testsuite/
>
> PR target/90878
> * gcc.target/i386/pr90878.c: New test.
>
> OK for trunk?

OK, as with your previous patch.

Thanks,
Uros.

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

end of thread, other threads:[~2019-09-18 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 18:06 [PATCH] i386: Restore Skylake SImode hard register store cost H.J. Lu
2019-09-18 19:42 ` Uros Bizjak

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