sparc.c (label_ref_operand): New function.

* sparc/sparc.c (label_ref_operand): New function.
	(emit_move_sequence): Pass label_ref to gen_move_label_di to not
	lose flags.
	* sparc/sparc.md (move_label_di): Operand one is label_ref now.
	* genattrtab.c (write_test_expr): Allow label_ref in match_dup.

From-SVN: r12643
This commit is contained in:
Doug Evans 1996-08-15 19:05:21 +00:00
parent 1271a76a07
commit 5ab7138b86
3 changed files with 22 additions and 3 deletions

View File

@ -441,6 +441,20 @@ symbolic_memory_operand (op, mode)
|| GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF);
}
/* Return truth value of statement that OP is a LABEL_REF of mode MODE. */
int
label_ref_operand (op, mode)
rtx op;
enum machine_mode mode;
{
if (GET_CODE (op) != LABEL_REF)
return 0;
if (GET_MODE (op) != mode)
return 0;
return 1;
}
/* Return 1 if the operand is an argument used in generating pic references
in either the medium/low or medium/anywhere code models of sparc64. */
@ -1502,6 +1516,8 @@ emit_move_sequence (operands, mode)
{
if (TARGET_ARCH64)
abort ();
/* ??? This might suffer from the same problem the DImode case did:
flags in operand1 not being propagated. */
emit_insn (gen_move_pic_label_si (operand0, XEXP (operand1, 0)));
return 1;
}
@ -1512,7 +1528,7 @@ emit_move_sequence (operands, mode)
{
if (! TARGET_ARCH64)
abort ();
emit_insn (gen_move_label_di (operands[0], XEXP (operands[1], 0)));
emit_insn (gen_move_label_di (operand0, operand1));
return 1;
}
/* DImode HIGH values in sparc64 need a clobber added. */

View File

@ -1573,7 +1573,9 @@
(define_insn "move_label_di"
[(set (match_operand:DI 0 "register_operand" "=r")
(label_ref:DI (match_operand 1 "" "")))
; This was previously (label_ref:DI (match_operand 1 "" "")) but that
; loses the volatil and other flags of the original label_ref.
(match_operand:DI 1 "label_ref_operand" ""))
(set (reg:DI 15) (pc))]
"TARGET_ARCH64"
"*

View File

@ -4488,7 +4488,8 @@ write_test_expr (exp, in_comparison)
/* The address of the branch target. */
case MATCH_DUP:
printf ("insn_addresses[INSN_UID (operands[%d])]", XINT (exp, 0));
printf ("insn_addresses[INSN_UID (GET_CODE (operands[%d]) == LABEL_REF ? XEXP (operands[%d], 0) : operands[%d])]",
XINT (exp, 0), XINT (exp, 0), XINT (exp, 0));
break;
/* The address of the current insn. It would be more consistent with