* [SPARC] Enable REE at -O2 by default in 64-bit mode
@ 2016-11-24 15:30 Eric Botcazou
2016-11-24 15:36 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: Eric Botcazou @ 2016-11-24 15:30 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Tests showed that it helps to eliminates redundant 32-to-64-bit extensions.
Tested on SPARC/Solaris, applied on the mainline.
2016-11-24 Eric Botcazou <ebotcazou@adacore.com>
* common/config/sparc/sparc-common.c (option_optimization_table):
Enable REE at -O2 and higher.
* config/sparc/sparc.c (sparc_option_override): Disable it by default
in 32-bit mode.
--
Eric Botcazou
[-- Attachment #2: sparc_ree.diff --]
[-- Type: text/x-patch, Size: 1207 bytes --]
Index: common/config/sparc/sparc-common.c
===================================================================
--- common/config/sparc/sparc-common.c (revision 242632)
+++ common/config/sparc/sparc-common.c (working copy)
@@ -28,6 +28,8 @@ along with GCC; see the file COPYING3.
static const struct default_options sparc_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+ /* Enable redundant extension instructions removal at -O2 and higher. */
+ { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c (revision 242632)
+++ config/sparc/sparc.c (working copy)
@@ -1713,6 +1713,11 @@ sparc_option_override (void)
pessimizes for double floating-point registers. */
if (!global_options_set.x_flag_ira_share_save_slots)
flag_ira_share_save_slots = 0;
+
+ /* Only enable REE by default in 64-bit mode where it helps to eliminate
+ redundant 32-to-64-bit extensions. */
+ if (!global_options_set.x_flag_ree && TARGET_ARCH32)
+ flag_ree = 0;
}
\f
/* Miscellaneous utilities. */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [SPARC] Enable REE at -O2 by default in 64-bit mode
2016-11-24 15:30 [SPARC] Enable REE at -O2 by default in 64-bit mode Eric Botcazou
@ 2016-11-24 15:36 ` Jeff Law
2016-11-24 16:06 ` Eric Botcazou
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2016-11-24 15:36 UTC (permalink / raw)
To: Eric Botcazou, gcc-patches
On 11/24/2016 08:30 AM, Eric Botcazou wrote:
> Tests showed that it helps to eliminates redundant 32-to-64-bit extensions.
>
> Tested on SPARC/Solaris, applied on the mainline.
>
>
> 2016-11-24 Eric Botcazou <ebotcazou@adacore.com>
>
> * common/config/sparc/sparc-common.c (option_optimization_table):
> Enable REE at -O2 and higher.
> * config/sparc/sparc.c (sparc_option_override): Disable it by default
> in 32-bit mode.
Very cool. Ideally all targets would enable REE, but we're obviously
not there yet.
With the fixes you've just done it's probably a lot more feasible to
experiment with REE on other risc targets.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [SPARC] Enable REE at -O2 by default in 64-bit mode
2016-11-24 15:36 ` Jeff Law
@ 2016-11-24 16:06 ` Eric Botcazou
0 siblings, 0 replies; 3+ messages in thread
From: Eric Botcazou @ 2016-11-24 16:06 UTC (permalink / raw)
To: Jeff Law; +Cc: gcc-patches
> With the fixes you've just done it's probably a lot more feasible to
> experiment with REE on other risc targets.
I didn't experiment much, but I saw no effects at all in 32-bit mode, only in
64-bit mode. That being said, SPARC is one of the very few RISC targets that
do _not_ define PROMOTE_MODE, this could be an explanation.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-24 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 15:30 [SPARC] Enable REE at -O2 by default in 64-bit mode Eric Botcazou
2016-11-24 15:36 ` Jeff Law
2016-11-24 16:06 ` Eric Botcazou
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).