sh.c (fixup_addr_diff_vecs): Emit braf reference label.

* sh.c (fixup_addr_diff_vecs): Emit braf reference label.
	(braf_label_ref_operand): Delete.
	* sh.h (PREDICATE_CODES): Remove braf_label_ref_operand.
	* sh.md (casesi_jump_2): Operand1 is now the inside of a
	label_ref, and has no predicate.
	The patten has a predicate to guard against invalid substitutions.
	(dummy_jump): Delete.
	(casesi): Update use of casesi_jump_2.

From-SVN: r27329
This commit is contained in:
J"orn Rennecke 1999-06-03 20:00:16 +00:00 committed by Joern Rennecke
parent b89c5a7b53
commit eb3881bf7d
4 changed files with 23 additions and 48 deletions

View File

@ -1,3 +1,14 @@
Fri Jun 4 03:20:40 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh.c (fixup_addr_diff_vecs): Emit braf reference label.
(braf_label_ref_operand): Delete.
* sh.h (PREDICATE_CODES): Remove braf_label_ref_operand.
* sh.md (casesi_jump_2): Operand1 is now the inside of a
label_ref, and has no predicate.
The patten has a predicate to guard against invalid substitutions.
(dummy_jump): Delete.
(casesi): Update use of casesi_jump_2.
Thu Jun 3 07:48 1999 Bruce Korb <ddsinc09@ix.netcom.com>
*fixinc/inclhack.def(Io_Def_Quotes): corrected sed expression

View File

@ -2641,7 +2641,7 @@ fixup_addr_diff_vecs (first)
for (insn = first; insn; insn = NEXT_INSN (insn))
{
rtx vec_lab, pat, prev, prevpat, x;
rtx vec_lab, pat, prev, prevpat, x, braf_label;
if (GET_CODE (insn) != JUMP_INSN
|| GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
@ -2664,10 +2664,15 @@ fixup_addr_diff_vecs (first)
if (GET_CODE (x) == LABEL_REF && XEXP (x, 0) == vec_lab)
break;
}
/* Emit the reference label of the braf where it belongs, right after
the casesi_jump_2 (i.e. braf). */
braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
emit_label_after (braf_label, prev);
/* Fix up the ADDR_DIF_VEC to be relative
to the reference address of the braf. */
XEXP (XEXP (pat, 0), 0)
= XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
XEXP (XEXP (pat, 0), 0) = braf_label;
}
}
@ -4303,29 +4308,6 @@ fp_one_operand (op)
return REAL_VALUES_EQUAL (r, dconst1);
}
int
braf_label_ref_operand(op, mode)
rtx op;
enum machine_mode mode;
{
rtx prev;
if (GET_CODE (op) != LABEL_REF)
return 0;
prev = prev_real_insn (XEXP (op, 0));
if (GET_CODE (prev) != JUMP_INSN)
return 0;
prev = PATTERN (prev);
if (GET_CODE (prev) != PARALLEL || XVECLEN (prev, 0) != 2)
return 0;
prev = XVECEXP (prev, 0, 0);
if (GET_CODE (prev) != SET)
return 0;
prev = SET_SRC (prev);
if (GET_CODE (prev) != PLUS || XEXP (prev, 1) != op)
return 0;
}
int
tertiary_reload_operand (op, mode)
rtx op;

View File

@ -2129,7 +2129,6 @@ extern struct rtx_def *get_fpscr_rtx ();
{"arith_reg_operand", {SUBREG, REG}}, \
{"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
{"binary_float_operator", {PLUS, MULT}}, \
{"braf_label_ref_operand", {LABEL_REF}}, \
{"commutative_float_operator", {PLUS, MULT}}, \
{"fp_arith_reg_operand", {SUBREG, REG}}, \
{"fp_extended_operand", {SUBREG, REG, FLOAT_EXTEND}}, \

View File

@ -3203,19 +3203,13 @@
;; For all later processors.
(define_insn "casesi_jump_2"
[(set (pc) (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand 1 "braf_label_ref_operand" "")))
(label_ref (match_operand 1 "" ""))))
(use (label_ref (match_operand 2 "" "")))]
""
"! INSN_UID (operands[1]) || prev_real_insn (operands[1]) == insn"
"braf %0%#"
[(set_attr "needs_delay_slot" "yes")
(set_attr "type" "jump_ind")])
(define_insn "dummy_jump"
[(set (pc) (const_int 0))]
""
""
[(set_attr "length" "0")])
;; Call subroutine returning any type.
;; ??? This probably doesn't work.
@ -3302,20 +3296,9 @@
reg));
emit_insn (gen_casesi_worker_0 (reg2, reg, operands[3]));
if (TARGET_SH2)
{
rtx lab = gen_label_rtx ();
emit_jump_insn (gen_casesi_jump_2 (reg2,
gen_rtx (LABEL_REF, VOIDmode, lab),
operands[3]));
emit_label (lab);
/* Put a fake jump after the label, lest some optimization might
delete the barrier and LAB. */
emit_jump_insn (gen_dummy_jump ());
}
emit_jump_insn (gen_casesi_jump_2 (reg2, gen_label_rtx (), operands[3]));
else
{
emit_jump_insn (gen_casesi_jump_1 (reg2, operands[3]));
}
emit_jump_insn (gen_casesi_jump_1 (reg2, operands[3]));
/* For SH2 and newer, the ADDR_DIFF_VEC is not actually relative to
operands[3], but to lab. We will fix this up in
machine_dependent_reorg. */