Commit 1875cc88 by Jim Wilson

(print_operand_address): When TARGET_MINIMAL_TOC, use r30 instead of r2 for TOC references.

(print_operand_address): When TARGET_MINIMAL_TOC, use
r30 instead of r2 for TOC references.
(output_prologue): If TARGET_MINIMAL_TOC, and the constant pool
is needed, then setup r30.
(output_toc): When TARGET_MINIMAL_TOC, use .long instead of .tc.

From-SVN: r5218
parent b5a9fbb3
...@@ -1171,6 +1171,11 @@ print_operand_address (file, x) ...@@ -1171,6 +1171,11 @@ print_operand_address (file, x)
else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST) else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST)
{ {
output_addr_const (file, x); output_addr_const (file, x);
/* When TARGET_MINIMAL_TOC, use the indirected toc table pointer instead
of the toc pointer. */
if (TARGET_MINIMAL_TOC)
fprintf (file, "(30)");
else
fprintf (file, "(2)"); fprintf (file, "(2)");
} }
else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG)
...@@ -1372,6 +1377,11 @@ output_prolog (file, size) ...@@ -1372,6 +1377,11 @@ output_prolog (file, size)
/* Set frame pointer, if needed. */ /* Set frame pointer, if needed. */
if (frame_pointer_needed) if (frame_pointer_needed)
fprintf (file, "\toril 31,1,0\n"); fprintf (file, "\toril 31,1,0\n");
/* If TARGET_MINIMAL_TOC, and the constant pool is needed, then load the
TOC_TABLE address into register 30. */
if (TARGET_MINIMAL_TOC && get_pool_size () != 0)
fprintf (file, "\tl 30,LCTOC..0(2)\n");
} }
/* Write function epilogue. */ /* Write function epilogue. */
...@@ -1643,6 +1653,10 @@ output_toc (file, x, labelno) ...@@ -1643,6 +1653,10 @@ output_toc (file, x, labelno)
&& BITS_PER_WORD == HOST_BITS_PER_INT && BITS_PER_WORD == HOST_BITS_PER_INT
&& TARGET_FP_IN_TOC) && TARGET_FP_IN_TOC)
{ {
if (TARGET_MINIMAL_TOC)
fprintf (file, "\t.long %d\n\t.long %d\n",
CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x));
else
fprintf (file, "\t.tc FD_%x_%x[TC],%d,%d\n", fprintf (file, "\t.tc FD_%x_%x[TC],%d,%d\n",
CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x),
CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x)); CONST_DOUBLE_LOW (x), CONST_DOUBLE_HIGH (x));
...@@ -1656,6 +1670,9 @@ output_toc (file, x, labelno) ...@@ -1656,6 +1670,9 @@ output_toc (file, x, labelno)
if (val == 0 || GET_CODE (val) != CONST_INT) if (val == 0 || GET_CODE (val) != CONST_INT)
abort (); abort ();
if (TARGET_MINIMAL_TOC)
fprintf (file, "\t.long %d\n", INTVAL (val));
else
fprintf (file, "\t.tc FS_%x[TC],%d\n", INTVAL (val), INTVAL (val)); fprintf (file, "\t.tc FS_%x[TC],%d\n", INTVAL (val), INTVAL (val));
return; return;
} }
...@@ -1675,6 +1692,10 @@ output_toc (file, x, labelno) ...@@ -1675,6 +1692,10 @@ output_toc (file, x, labelno)
else else
abort (); abort ();
if (TARGET_MINIMAL_TOC)
fprintf (file, "\t.long ");
else
{
fprintf (file, "\t.tc "); fprintf (file, "\t.tc ");
RS6000_OUTPUT_BASENAME (file, name); RS6000_OUTPUT_BASENAME (file, name);
...@@ -1684,6 +1705,7 @@ output_toc (file, x, labelno) ...@@ -1684,6 +1705,7 @@ output_toc (file, x, labelno)
fprintf (file, ".P%d", offset); fprintf (file, ".P%d", offset);
fprintf (file, "[TC],"); fprintf (file, "[TC],");
}
output_addr_const (file, x); output_addr_const (file, x);
fprintf (file, "\n"); fprintf (file, "\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment