public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work058)] Add -msection-anchor-offset.
@ 2021-07-06 15:03 Michael Meissner
0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2021-07-06 15:03 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:78fc212da74885da1dad839d22811a4ddef4e60a
commit 78fc212da74885da1dad839d22811a4ddef4e60a
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Tue Jul 6 11:03:29 2021 -0400
Add -msection-anchor-offset.
This patch is part of a patch first posted in March, 2021, and it sets the
minimum and maximum section anchor offsets. The patch is at:
https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566744.html
2021-07-06 Michael Meissner <meissner@linux.ibm.com>
gcc/
* config/rs6000/rs6000.c (rs6000_option_override_internal) If
-msection-anchor-offset, set the minimum and maximum section
anchor offsets.
* config/rs6000/rs6000.opt (-msection-anchor-offset): New switch.
Diff:
---
gcc/config/rs6000/rs6000.c | 11 +++++++++++
gcc/config/rs6000/rs6000.opt | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e127913a9ad..20a30727787 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4550,6 +4550,17 @@ rs6000_option_override_internal (bool global_init_p)
if (TARGET_CONST_ANCHOR)
targetm.const_anchor = HOST_WIDE_INT_1 << (TARGET_PREFIXED ? 33 : 15);
+ /* Possibly set the minimum/maximum section anchor offset to the maximum
+ value, based on whether we have prefixed addressing. */
+ if (TARGET_SECTION_ANCHOR_OFFSET)
+ {
+ HOST_WIDE_INT shift_amount = TARGET_PREFIXED ? 33 : 15;
+ targetm.min_anchor_offset = -(HOST_WIDE_INT_1 << shift_amount);
+ targetm.max_anchor_offset = (HOST_WIDE_INT_1 << shift_amount) - 1;
+ if (!global_options_set.x_flag_section_anchors)
+ flag_section_anchors = true;
+ }
+
if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
rs6000_print_isa_options (stderr, 0, "after subtarget", rs6000_isa_flags);
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 8ac78c369a4..a66d7a39938 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -644,6 +644,10 @@ mconst-anchor
Target Undocumented Var(TARGET_CONST_ANCHOR) Save
Set targetm.const_anchor
+msection-anchor-offset
+Target Undocumented Var(TARGET_SECTION_ANCHOR_OFFSET) Save
+Set targetm.{min,max}_anchor_offset
+
mprefixed-large-consts
Target Undocumented Var(TARGET_PREFIXED_LARGE_CONSTS) Init(-1) Save
Generate (do not generate) PLI/SLDI/PADDI to load large constants.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-06 15:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 15:03 [gcc(refs/users/meissner/heads/work058)] Add -msection-anchor-offset Michael Meissner
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).