Commit 3871c609 by Gavin Koch Committed by Gavin Romig-Koch

mips.c (movdi_operand): Direct referances to symbols that arn't mips16 consts in…

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
parent 2e72fa6a
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
......
......@@ -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,10 +2319,46 @@ mips_move_2words (operands, insn)
}
}
else if (code1 == LABEL_REF
|| code1 == SYMBOL_REF
else if (code1 == LABEL_REF)
{
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 (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);
......@@ -2333,6 +2372,7 @@ mips_move_2words (operands, insn)
ret = "dla\t%0,%a1";
}
}
}
else if (code0 == MEM)
{
......
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