* [PATCH] add reassociation width target function for power8
@ 2016-05-04 16:20 Aaron Sawdey
2016-05-09 16:09 ` Segher Boessenkool
0 siblings, 1 reply; 2+ messages in thread
From: Aaron Sawdey @ 2016-05-04 16:20 UTC (permalink / raw)
To: gcc-patches
Hi,
This patch enables TARGET_SCHED_REASSOCIATION_WIDTH for power8 and up.
The widths returned are derived from testing with SPEC 2006 and some
simple tests on power8.
Bootstrapped and regtested on powerpc64le-unknown-linux-gnu, ok for
trunk?
2016-05-04 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_reassociation_width): Add
function for TARGET_SCHED_REASSOCIATION_WIDTH to enable
parallel reassociation for power8 and forward.
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 235841)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -1755,6 +1755,9 @@
#undef TARGET_CONDITIONAL_REGISTER_USAGE
#define TARGET_CONDITIONAL_REGISTER_USAGE rs6000_conditional_register_usage
+#undef TARGET_SCHED_REASSOCIATION_WIDTH
+#define TARGET_SCHED_REASSOCIATION_WIDTH rs6000_reassociation_width
+
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT rs6000_trampoline_init
@@ -8633,6 +8636,40 @@
true, worst_case);
}
+/* Determine the reassociation width to be used in reassociate_bb.
+ This takes into account how many parallel operations we
+ can actually do of a given type, and also the latency.
+ P8:
+ int add/sub 6/cycle
+ mul 2/cycle
+ vect add/sub/mul 2/cycle
+ fp add/sub/mul 2/cycle
+ dfp 1/cycle
+*/
+
+static int
+rs6000_reassociation_width (unsigned int opc ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
+{
+ switch (rs6000_cpu)
+ {
+ case PROCESSOR_POWER8:
+ case PROCESSOR_POWER9:
+ if (DECIMAL_FLOAT_MODE_P (mode))
+ return 1;
+ if (VECTOR_MODE_P (mode))
+ return 4;
+ if (INTEGRAL_MODE_P (mode))
+ return opc == MULT_EXPR ? 4 : 6;
+ if (FLOAT_MODE_P (mode))
+ return 4;
+ break;
+ default:
+ break;
+ }
+ return 1;
+}
+
/* Change register usage conditional on target flags. */
static void
rs6000_conditional_register_usage (void)
--
Aaron Sawdey, Ph.D. acsawdey@linux.vnet.ibm.com
050-2/C113 (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] add reassociation width target function for power8
2016-05-04 16:20 [PATCH] add reassociation width target function for power8 Aaron Sawdey
@ 2016-05-09 16:09 ` Segher Boessenkool
0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2016-05-09 16:09 UTC (permalink / raw)
To: Aaron Sawdey; +Cc: gcc-patches
Hi Aaron,
On Wed, May 04, 2016 at 11:20:12AM -0500, Aaron Sawdey wrote:
> This patch enables TARGET_SCHED_REASSOCIATION_WIDTH for power8 and up.
> The widths returned are derived from testing with SPEC 2006 and some
> simple tests on power8.
>
> Bootstrapped and regtested on powerpc64le-unknown-linux-gnu, ok for
> trunk?
>
> 2016-05-04 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
Two spaces before the email address.
> * config/rs6000/rs6000.c (rs6000_reassociation_width): Add
> function for TARGET_SCHED_REASSOCIATION_WIDTH to enable
> parallel reassociation for power8 and forward.
This is okay for trunk. Thanks,
Segher
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-09 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 16:20 [PATCH] add reassociation width target function for power8 Aaron Sawdey
2016-05-09 16:09 ` Segher Boessenkool
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).