aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-05-15 05:58:28 +0000
committerRichard Stallman <rms@gnu.org>1992-05-15 05:58:28 +0000
commitbc961ed7f48abfe041e4585404208eeb8891dd0b (patch)
tree23ecb78f6f9221995078ad885dab3c69bda5593a /gcc
parente16c591a119cfadadb854ee51dffc724d9ee97f8 (diff)
downloadgcc-bc961ed7f48abfe041e4585404208eeb8891dd0b.zip
gcc-bc961ed7f48abfe041e4585404208eeb8891dd0b.tar.gz
gcc-bc961ed7f48abfe041e4585404208eeb8891dd0b.tar.bz2
*** empty log message ***
From-SVN: r986
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sparc/sparc.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f02f77c..f9eeef8 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1048,6 +1048,47 @@ output_move_double (operands)
|| (optype0 != REGOP && optype0 != CNSTOP && optype1 == REGOP
&& (REGNO (operands[1]) & 1) == 0))
{
+ /* Now that all misaligned double parms are copied
+ on function entry, we can assume any 64-bit object
+ is 64-bit aligned. */
+#if 1
+ rtx addr;
+ rtx base, offset;
+
+ if (optype0 == REGOP)
+ addr = operands[1];
+ else
+ addr = operands[0];
+
+ /* See what register we use in the address. */
+ base = 0;
+ if (GET_CODE (XEXP (addr, 0)) == PLUS)
+ {
+ rtx temp = XEXP (addr, 0);
+ if (GET_CODE (XEXP (temp, 0)) == REG
+ && GET_CODE (XEXP (temp, 1)) == CONST_INT)
+ base = XEXP (temp, 0), offset = XEXP (temp, 1);
+ }
+ else if (GET_CODE (XEXP (addr, 0)) == REG)
+ base = XEXP (addr, 0), offset = const0_rtx;
+
+ /* If it's the stack or frame pointer, check offset alignment.
+ We can have improper aligment in the function entry code. */
+ if (base
+ && (REGNO (base) == FRAME_POINTER_REGNUM
+ || REGNO (base) == STACK_POINTER_REGNUM))
+ {
+ if ((INTVAL (offset) & 0x7) == 0)
+ return (addr == operands[1] ? "ldd %1,%0" : "std %1,%0");
+ }
+ else
+ /* Anything else, we know is properly aligned. */
+ return (addr == operands[1] ? "ldd %1,%0" : "std %1,%0");
+#else
+ /* This old code is preserved in case we ever need
+ it for Fortran. It won't be complete right;
+ In Fortran, doubles can be just 32-bit aligned
+ even in global variables and arrays. */
rtx addr;
rtx base, offset;
@@ -1098,6 +1139,7 @@ output_move_double (operands)
|| MEM_IN_STRUCT_P (addr)
|| TARGET_HOPE_ALIGN))
return (addr == operands[1] ? "ldd %1,%0" : "std %1,%0");
+#endif /* 0 */
}
if (optype0 == REGOP && optype1 == REGOP