public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Michael Meissner <meissner@linux.ibm.com>,
	gcc-patches@gcc.gnu.org,        dje.gcc@gmail.com
Subject: [PATCH, committed] PowerPC Prefixed Memory, Patch #5 (move create_TOC_reference)
Date: Tue, 09 Jul 2019 17:36:00 -0000	[thread overview]
Message-ID: <20190709173226.GA24666@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <20190708185313.GH30355@gate.crashing.org>

On Mon, Jul 08, 2019 at 01:53:13PM -0500, Segher Boessenkool wrote:
> Please do; as a separate patch.  Thanks in advance.  A patch purely moving
> it back is pre-approved.

I just committed this patch:

2019-07-09  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-internal.h (create_TOC_reference): Delete.
	* config/rs6000/rs6000-logue.c (create_TOC_reference): Move
	function from rs6000-logue.c back to rs6000.c.
	* config/rs6000/rs6000.c (create_TOC_reference): Likewise.

Index: gcc/config/rs6000/rs6000-internal.h
===================================================================
--- gcc/config/rs6000/rs6000-internal.h	(revision 273308)
+++ gcc/config/rs6000/rs6000-internal.h	(working copy)
@@ -92,7 +92,6 @@ extern void rs6000_emit_prologue_compone
 extern void rs6000_emit_epilogue_components (sbitmap components);
 extern void rs6000_set_handled_components (sbitmap components);
 extern rs6000_stack_t * rs6000_stack_info (void);
-extern rtx create_TOC_reference (rtx symbol, rtx largetoc_reg);
 extern rtx rs6000_got_sym (void);
 extern struct machine_function *rs6000_init_machine_status (void);
 extern bool save_reg_p (int reg);
Index: gcc/config/rs6000/rs6000-logue.c
===================================================================
--- gcc/config/rs6000/rs6000-logue.c	(revision 273308)
+++ gcc/config/rs6000/rs6000-logue.c	(working copy)
@@ -1406,41 +1406,6 @@ uses_TOC (void)
 }
 #endif
 
-rtx
-create_TOC_reference (rtx symbol, rtx largetoc_reg)
-{
-  rtx tocrel, tocreg, hi;
-
-  if (TARGET_DEBUG_ADDR)
-    {
-      if (SYMBOL_REF_P (symbol))
-	fprintf (stderr, "\ncreate_TOC_reference, (symbol_ref %s)\n",
-		 XSTR (symbol, 0));
-      else
-	{
-	  fprintf (stderr, "\ncreate_TOC_reference, code %s:\n",
-		   GET_RTX_NAME (GET_CODE (symbol)));
-	  debug_rtx (symbol);
-	}
-    }
-
-  if (!can_create_pseudo_p ())
-    df_set_regs_ever_live (TOC_REGISTER, true);
-
-  tocreg = gen_rtx_REG (Pmode, TOC_REGISTER);
-  tocrel = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, symbol, tocreg), UNSPEC_TOCREL);
-  if (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p ())
-    return tocrel;
-
-  hi = gen_rtx_HIGH (Pmode, copy_rtx (tocrel));
-  if (largetoc_reg != NULL)
-    {
-      emit_move_insn (largetoc_reg, hi);
-      hi = largetoc_reg;
-    }
-  return gen_rtx_LO_SUM (Pmode, hi, tocrel);
-}
-
 /* Issue assembly directives that create a reference to the given DWARF
    FRAME_TABLE_LABEL from the current function section.  */
 void
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 273308)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -7735,6 +7735,45 @@ constant_pool_expr_p (rtx op)
 	  && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (base), Pmode));
 }
 
+/* Create a TOC reference for symbol_ref SYMBOL.  If LARGETOC_REG is non-null,
+   use that as the register to put the HIGH value into if register allocation
+   is already done.  */
+
+rtx
+create_TOC_reference (rtx symbol, rtx largetoc_reg)
+{
+  rtx tocrel, tocreg, hi;
+
+  if (TARGET_DEBUG_ADDR)
+    {
+      if (SYMBOL_REF_P (symbol))
+	fprintf (stderr, "\ncreate_TOC_reference, (symbol_ref %s)\n",
+		 XSTR (symbol, 0));
+      else
+	{
+	  fprintf (stderr, "\ncreate_TOC_reference, code %s:\n",
+		   GET_RTX_NAME (GET_CODE (symbol)));
+	  debug_rtx (symbol);
+	}
+    }
+
+  if (!can_create_pseudo_p ())
+    df_set_regs_ever_live (TOC_REGISTER, true);
+
+  tocreg = gen_rtx_REG (Pmode, TOC_REGISTER);
+  tocrel = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, symbol, tocreg), UNSPEC_TOCREL);
+  if (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p ())
+    return tocrel;
+
+  hi = gen_rtx_HIGH (Pmode, copy_rtx (tocrel));
+  if (largetoc_reg != NULL)
+    {
+      emit_move_insn (largetoc_reg, hi);
+      hi = largetoc_reg;
+    }
+  return gen_rtx_LO_SUM (Pmode, hi, tocrel);
+}
+
 /* These are only used to pass through from print_operand/print_operand_address
    to rs6000_output_addr_const_extra over the intervening function
    output_addr_const which is not target code.  */

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797

  reply	other threads:[~2019-07-09 17:32 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  0:06 Add support for PowerPC prefixed memory instructions and pc-relative support (Intro) Michael Meissner
2019-06-28  0:12 ` [PATCH] PowerPC Prefixed Memory, Patch #3, Update predicates Michael Meissner
2019-06-28 13:20   ` Segher Boessenkool
2019-06-28 14:56     ` Bill Schmidt
2019-06-28 18:54     ` Michael Meissner
2019-06-28 18:50 ` [PATCH] PowerPC Prefixed Memory, Patch #4, Add pc-relative reference support Michael Meissner
2019-07-03 22:20   ` Segher Boessenkool
2019-07-08 18:53     ` Michael Meissner
2019-07-08 18:54       ` Segher Boessenkool
2019-07-09 17:36         ` Michael Meissner [this message]
2019-07-09 18:34           ` [PATCH, committed] PowerPC Prefixed Memory, Patch #5 (move create_TOC_reference) Segher Boessenkool
2019-07-09 22:42 ` [PATCH], PowerPC, Patch #6, Create pc-relative addressing insns Michael Meissner
2019-07-10 17:43   ` Segher Boessenkool
2019-07-10 17:57     ` Michael Meissner
2019-07-10 18:55       ` Segher Boessenkool
2019-07-10 21:51   ` [PATCH], PowerPC, Patch #6, revision 2, " Michael Meissner
2019-07-11 20:10     ` Segher Boessenkool
2019-07-11 21:04       ` Michael Meissner
2019-07-11 21:38         ` Segher Boessenkool
2019-07-10  0:28 ` [PATCH], PowerPC, Patch #7, Split up SIGNED_34BIT and SIGNED_16BIT macros Michael Meissner
2019-07-10 18:37   ` Segher Boessenkool
2019-07-11 12:17 ` [PATCH], PowerPC, Patch #8, rename rs6000_prefixed_address Michael Meissner
2019-07-11 21:37   ` Segher Boessenkool
2019-07-11 19:45 ` [PATCH], PowerPC, Patch #9, Refine calculation of whether an address offset is d-form, ds-form, or dq-form Michael Meissner
2019-07-12 17:05   ` Segher Boessenkool
2019-07-16 18:00     ` Michael Meissner
2019-07-16 23:31       ` Segher Boessenkool
2019-07-16  6:35 ` [PATCH], Patch #6, revision 3, Create pc-relative addressing insns Michael Meissner
2019-07-16 21:09   ` Segher Boessenkool
2019-07-18 19:34     ` Michael Meissner
2019-07-18 19:43       ` Segher Boessenkool
2019-07-17  5:44   ` [PATCH], Patch #6, revision 3, (Test on AIX and Darwin) Michael Meissner
2019-07-20 16:28 ` [PATCH], Patch #10, move PowerPC data structures & helper functions from rs6000.c to rs6000-internal.h Michael Meissner
2019-07-20 16:54   ` David Edelsohn
2019-07-22 18:37     ` Michael Meissner
2019-07-22 19:55       ` Segher Boessenkool
2019-07-21 18:13   ` Segher Boessenkool
2019-07-22 18:59     ` Michael Meissner
2019-07-22 20:45       ` Segher Boessenkool
2019-07-22  5:56   ` Segher Boessenkool
2019-07-22 19:33     ` Michael Meissner
2019-07-22 21:33       ` Segher Boessenkool
2019-07-22 23:11         ` Michael Meissner
2019-07-25 13:30           ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709173226.GA24666@ibm-toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).