aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGavin Koch <gavin@cygnus.com>1998-02-12 08:37:06 +0000
committerGavin Romig-Koch <gavin@gcc.gnu.org>1998-02-12 08:37:06 +0000
commit3871c609278860dacf2b324449a6d00e550d5121 (patch)
tree28d04dcda5a79c52a12bb29f1ae2c2dfa0d43fa4 /gcc
parent2e72fa6af1d3d3a808b2f0d3d951d35163c11d11 (diff)
downloadgcc-3871c609278860dacf2b324449a6d00e550d5121.zip
gcc-3871c609278860dacf2b324449a6d00e550d5121.tar.gz
gcc-3871c609278860dacf2b324449a6d00e550d5121.tar.bz2
mips.c (movdi_operand): Direct referances to symbols that arn't mips16 consts in mips16 mode arn't...
* mips/mips.c (movdi_operand): Direct referances to symbols that arn't mips16 consts in mips16 mode arn't valid operands. * mips/mips.c (mips_move_2words): Add gprel handling. From-SVN: r17867
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/mips/mips.c48
2 files changed, 51 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f72266e..e4a07cb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Thu Feb 12 11:34:55 1998 Gavin Koch <gavin@cygnus.com>
+
+ * mips/mips.c (movdi_operand): Direct referances to symbols
+ that arn't mips16 consts in mips16 mode arn't valid operands.
+
+ * mips/mips.c (mips_move_2words): Add gprel handling.
+
Thu Feb 12 11:18:37 1998 Gavin Koch <gavin@cygnus.com>
* mips.md (extendsidi2): Allow extension to/from a non-mips16
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 072fb86..b7774b3 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -985,7 +985,10 @@ movdi_operand (op, mode)
|| immediate_operand (XEXP (op, 0), SImode)))
return 1;
- return general_operand (op, mode);
+ return (general_operand (op, mode)
+ && ! (TARGET_MIPS16
+ && GET_CODE (op) == SYMBOL_REF
+ && ! mips16_constant (op, mode, 1, 0)));
}
/* Like register_operand, but when in 64 bit mode also accept a sign
@@ -2316,9 +2319,7 @@ mips_move_2words (operands, insn)
}
}
- else if (code1 == LABEL_REF
- || code1 == SYMBOL_REF
- || code1 == CONST)
+ else if (code1 == LABEL_REF)
{
if (TARGET_STATS)
mips_count_memory_refs (op1, 2);
@@ -2332,6 +2333,45 @@ mips_move_2words (operands, insn)
else
ret = "dla\t%0,%a1";
}
+ else if (code1 == SYMBOL_REF
+ || code1 == CONST)
+ {
+ if (TARGET_MIPS16
+ && code1 == CONST
+ && GET_CODE (XEXP (op1, 0)) == REG
+ && REGNO (XEXP (op1, 0)) == GP_REG_FIRST + 28)
+ {
+ /* This case arises on the mips16; see
+ mips16_gp_pseudo_reg. */
+ ret = "move\t%0,%+";
+ }
+ else if (TARGET_MIPS16
+ && code1 == SYMBOL_REF
+ && SYMBOL_REF_FLAG (op1)
+ && (XSTR (op1, 0)[0] != '*'
+ || strncmp (XSTR (op1, 0) + 1,
+ LOCAL_LABEL_PREFIX,
+ sizeof LOCAL_LABEL_PREFIX - 1) != 0))
+ {
+ /* This can occur when reloading the address of a GP
+ relative symbol on the mips16. */
+ ret = "move\t%0,%+\n\taddu\t%0,%%gprel(%a1)";
+ }
+ else
+ {
+ if (TARGET_STATS)
+ mips_count_memory_refs (op1, 2);
+
+ if (GET_CODE (operands[1]) == SIGN_EXTEND)
+ /* We deliberately remove the 'a' from '%1', so that we don't
+ have to add SIGN_EXTEND support to print_operand_address.
+ print_operand will just call print_operand_address in this
+ case, so there is no problem. */
+ ret = "la\t%0,%1";
+ else
+ ret = "dla\t%0,%a1";
+ }
+ }
}
else if (code0 == MEM)