aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-06-03 20:00:16 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-06-03 21:00:16 +0100
commiteb3881bf7d73c7c7d10ca01e9cda4182ad0d07b9 (patch)
treef7c07bdf5f360c560962565eb708fce8c60d76f6
parentb89c5a7b53874bf0fa55f53a8ebbf16cc23ed345 (diff)
downloadgcc-eb3881bf7d73c7c7d10ca01e9cda4182ad0d07b9.zip
gcc-eb3881bf7d73c7c7d10ca01e9cda4182ad0d07b9.tar.gz
gcc-eb3881bf7d73c7c7d10ca01e9cda4182ad0d07b9.tar.bz2
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
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/sh/sh.c34
-rw-r--r--gcc/config/sh/sh.h1
-rw-r--r--gcc/config/sh/sh.md25
4 files changed, 23 insertions, 48 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eed6ef1..310c918 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 41c5ac5..feca33e 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -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;
}
}
@@ -4304,29 +4309,6 @@ fp_one_operand (op)
}
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;
enum machine_mode mode;
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 83e2969..644668f 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -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}}, \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 04992a1..e4648bb 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -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. */