aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-10-20 18:44:58 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-10-20 18:44:58 -0400
commit5b5040b9e6591f56e1d6280ad430eb38d2011234 (patch)
tree88922707c62024f2f5ec4d3aef5d0708bf72978d
parent9fe320d7933404a9dd3f2d6a4ecdb849c4ef3fae (diff)
downloadgcc-5b5040b9e6591f56e1d6280ad430eb38d2011234.zip
gcc-5b5040b9e6591f56e1d6280ad430eb38d2011234.tar.gz
gcc-5b5040b9e6591f56e1d6280ad430eb38d2011234.tar.bz2
(float_conv_temp): Delete global variable.
(stack_temps): New static array to hold stack temps. (offsettable_mem_operand): Delete function. (offsettable_addr_operand, rs6000_stack_temp): New functions. (output_epilog): Zero stack_temps. From-SVN: r10485
-rw-r--r--gcc/config/rs6000/rs6000.c67
1 files changed, 55 insertions, 12 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ca0a9b8..ad7872d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -75,7 +75,7 @@ int rs6000_pic_labelno;
int rs6000_sysv_varargs_p;
/* Temporary memory used to convert integer -> float */
-struct rtx_def *float_conv_temp;
+static rtx stack_temps[NUM_MACHINE_MODES];
/* Print the options used in the assembly file. */
@@ -486,21 +486,15 @@ easy_fp_constant (op, mode)
|| (low != 0 && input_operand (low, word_mode)));
}
-/* Return 1 if the operand is an offsettable memory operand. */
+/* Return 1 if the operand is an offsettable memory address. */
int
-offsettable_mem_operand (op, mode)
+offsettable_addr_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- if (GET_CODE (op) != MEM)
- return 0;
-
- if (mode != GET_MODE (op))
- return 0;
-
return offsettable_address_p (reload_completed | reload_in_progress,
- mode, XEXP (op, 0));
+ mode, op);
}
/* Return 1 if the operand is either a floating-point register, a pseudo
@@ -1131,6 +1125,53 @@ expand_builtin_saveregs (args)
}
+/* Allocate a stack temp. Only allocate one stack temp per type for a
+ function. */
+
+struct rtx_def *
+rs6000_stack_temp (mode, size)
+ enum machine_mode mode;
+ int size;
+{
+ rtx temp = stack_temps[ (int)mode ];
+ rtx addr;
+
+ if (temp == NULL_RTX)
+ {
+ temp = assign_stack_local (mode, size, 0);
+ addr = XEXP (temp, 0);
+
+ if ((size > 4 && !offsettable_address_p (0, mode, addr))
+ || (size <= 4 && !memory_address_p (mode, addr)))
+ {
+ XEXP (temp, 0) = copy_addr_to_reg (addr);
+ }
+
+ stack_temps[ (int)mode ] = temp;
+ }
+
+ return temp;
+}
+
+
+/* Generate a memory reference for expand_block_move, copying volatile,
+ and other bits from an original memory reference. */
+
+static rtx
+expand_block_move_mem (mode, addr, orig_mem)
+ enum machine_mode mode;
+ rtx addr;
+ rtx orig_mem;
+{
+ rtx mem = gen_rtx (MEM, mode, addr);
+ MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (orig_mem);
+ MEM_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (orig_mem);
+ /* CYGNUS LOCAL unaligned-pointers */
+ MEM_UNALIGNED_P (mem) = MEM_UNALIGNED_P (orig_mem);
+ /* END CYGNUS LOCAL unaligned-pointers */
+ return mem;
+}
+
/* Expand a block move operation, and return 1 if successful. Return 0
if we should let the compiler generate normal code.
@@ -2753,9 +2794,11 @@ output_epilog (file, size)
rs6000_stack_t *info = rs6000_stack_info ();
char *load_reg = (TARGET_64BIT) ? "\tld %s,%d(%s)" : "\t{l|lwz} %s,%d(%s)\n";
rtx insn = get_last_insn ();
+ int i;
- /* Forget about the float conversion temporary used. */
- float_conv_temp = NULL_RTX;
+ /* Forget about any temporaries created */
+ for (i = 0; i < NUM_MACHINE_MODES; i++)
+ stack_temps[i] = NULL_RTX;
/* If the last insn was a BARRIER, we don't have to write anything except
the trace table. */