Commit 6590e19a by Ulrich Weigand Committed by Ulrich Weigand

s390-protos.h (s390_emit_compare): Add prototype.

	* config/s390/s390-protos.h (s390_emit_compare): Add prototype.
	(s390_emit_jump): Likewise.
	* config/s390/s390.c (s390_emit_compare): New function.
	(s390_emit_jump): Likewise.
	* config/s390/s390.md ("beq", "bne", "bgt", "bgtu", "blt", "bltu",
	"bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq",
	"bungt", "bunlt", "bunge", "bunle", "bltgt"): Use s390_emit_compare
	and s390_emit_jump.
	("cjump"): Remove, replace by ...
	("*cjump_64", "*cjump_31"): ... these insns.  Improve length default.
	("icjump", "*icjump_64", "*icjump_31"): Likewise.
	("trap"): Fix type attribute.
	("conditional_trap"): Use s390_emit_compare.
	("doloop_si"): Remove, replace by ...
	("doloop_si64", "doloop_si31"): ... these new insn_and_split.
	Merge existing splitter into insn_and_split.  Improve length default.
	("doloop_di"): Merge with existing splitter into insn_and_split.
	("doloop"): Adapt.
	("jump"): Convert to expander.  Use s390_emit_jump.
	("*jump_64", "*jump_31"): New insns.  Improve length default.

From-SVN: r83574
parent 44ee9aef
2004-06-23 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_emit_compare): Add prototype.
(s390_emit_jump): Likewise.
* config/s390/s390.c (s390_emit_compare): New function.
(s390_emit_jump): Likewise.
* config/s390/s390.md ("beq", "bne", "bgt", "bgtu", "blt", "bltu",
"bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq",
"bungt", "bunlt", "bunge", "bunle", "bltgt"): Use s390_emit_compare
and s390_emit_jump.
("cjump"): Remove, replace by ...
("*cjump_64", "*cjump_31"): ... these insns. Improve length default.
("icjump", "*icjump_64", "*icjump_31"): Likewise.
("trap"): Fix type attribute.
("conditional_trap"): Use s390_emit_compare.
("doloop_si"): Remove, replace by ...
("doloop_si64", "doloop_si31"): ... these new insn_and_split.
Merge existing splitter into insn_and_split. Improve length default.
("doloop_di"): Merge with existing splitter into insn_and_split.
("doloop"): Adapt.
("jump"): Convert to expander. Use s390_emit_jump.
("*jump_64", "*jump_31"): New insns. Improve length default.
2004-06-23 Wu Yongwei <adah@sh163.net> 2004-06-23 Wu Yongwei <adah@sh163.net>
* gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. * gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust.
......
...@@ -52,6 +52,8 @@ extern enum machine_mode s390_tm_ccmode (rtx, rtx, int); ...@@ -52,6 +52,8 @@ extern enum machine_mode s390_tm_ccmode (rtx, rtx, int);
extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx); extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx);
extern int s390_alc_comparison (rtx op, enum machine_mode mode); extern int s390_alc_comparison (rtx op, enum machine_mode mode);
extern int s390_slb_comparison (rtx op, enum machine_mode mode); extern int s390_slb_comparison (rtx op, enum machine_mode mode);
extern rtx s390_emit_compare (enum rtx_code, rtx, rtx);
extern void s390_emit_jump (rtx, rtx);
extern int symbolic_reference_mentioned_p (rtx); extern int symbolic_reference_mentioned_p (rtx);
extern int tls_symbolic_reference_mentioned_p (rtx); extern int tls_symbolic_reference_mentioned_p (rtx);
extern int legitimate_la_operand_p (rtx); extern int legitimate_la_operand_p (rtx);
......
...@@ -468,6 +468,36 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) ...@@ -468,6 +468,36 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
} }
} }
/* Emit a compare instruction suitable to implement the comparison
OP0 CODE OP1. Return the correct condition RTL to be placed in
the IF_THEN_ELSE of the conditional branch testing the result. */
rtx
s390_emit_compare (enum rtx_code code, rtx op0, rtx op1)
{
enum machine_mode mode = s390_select_ccmode (code, op0, op1);
rtx cc = gen_rtx_REG (mode, CC_REGNUM);
emit_insn (gen_rtx_SET (VOIDmode, cc, gen_rtx_COMPARE (mode, op0, op1)));
return gen_rtx_fmt_ee (code, VOIDmode, cc, const0_rtx);
}
/* Emit a jump instruction to TARGET. If COND is NULL_RTX, emit an
unconditional jump, else a conditional jump under condition COND. */
void
s390_emit_jump (rtx target, rtx cond)
{
rtx insn;
target = gen_rtx_LABEL_REF (VOIDmode, target);
if (cond)
target = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, target, pc_rtx);
insn = gen_rtx_SET (VOIDmode, pc_rtx, target);
emit_jump_insn (insn);
}
/* Return nonzero if OP is a valid comparison operator /* Return nonzero if OP is a valid comparison operator
for an ALC condition in mode MODE. */ for an ALC condition in mode MODE. */
......
...@@ -6439,196 +6439,158 @@ ...@@ -6439,196 +6439,158 @@
;; ;;
(define_expand "beq" (define_expand "beq"
[(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (eq (reg:CCZ 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bne" (define_expand "bne"
[(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (ne (reg:CCZ 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bgt" (define_expand "bgt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (gt (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bgtu" (define_expand "bgtu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (gtu (reg:CCU 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "blt" (define_expand "blt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (lt (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bltu" (define_expand "bltu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (ltu (reg:CCU 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bge" (define_expand "bge"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (ge (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bgeu" (define_expand "bgeu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (geu (reg:CCU 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "ble" (define_expand "ble"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (le (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bleu" (define_expand "bleu"
[(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (leu (reg:CCU 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bunordered" (define_expand "bunordered"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (unordered (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bordered" (define_expand "bordered"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (ordered (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "buneq" (define_expand "buneq"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (uneq (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
(define_expand "bungt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
(set (pc)
(if_then_else (ungt (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bunlt" (define_expand "bunlt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (unlt (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bunge" (define_expand "bungt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (unge (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bunle" (define_expand "bunle"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (unle (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bunge"
[(match_operand 0 "" "")]
""
"s390_emit_jump (operands[0],
s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
(define_expand "bltgt" (define_expand "bltgt"
[(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) [(match_operand 0 "" "")]
(set (pc)
(if_then_else (ltgt (reg:CCS 33) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
"" ""
"operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") "s390_emit_jump (operands[0],
s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
;; ;;
;;- Conditional jump instructions. ;;- Conditional jump instructions.
;; ;;
(define_insn "cjump" (define_insn "*cjump_64"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
(label_ref (match_operand 0 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" "TARGET_CPU_ZARCH"
{ {
if (get_attr_length (insn) == 4) if (get_attr_length (insn) == 4)
return "j%C1\t%l0"; return "j%C1\t%l0";
else if (TARGET_CPU_ZARCH) else
return "jg%C1\t%l0"; return "jg%C1\t%l0";
}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 6)))])
(define_insn "*cjump_31"
[(set (pc)
(if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
(label_ref (match_operand 0 "" ""))
(pc)))]
"!TARGET_CPU_ZARCH"
{
if (get_attr_length (insn) == 4)
return "j%C1\t%l0";
else else
abort (); abort ();
} }
[(set_attr "op_type" "RI") [(set_attr "op_type" "RI")
(set_attr "type" "branch") (set_attr "type" "branch")
(set (attr "length") (set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 4) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) (const_int 4) (const_int 6))
(const_int 6) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(eq (symbol_ref "flag_pic") (const_int 0)) (const_int 4) (const_int 8))))])
(const_int 6)] (const_int 8)))])
(define_insn "*cjump_long" (define_insn "*cjump_long"
[(set (pc) [(set (pc)
...@@ -6654,30 +6616,46 @@ ...@@ -6654,30 +6616,46 @@
;;- Negated conditional jump instructions. ;;- Negated conditional jump instructions.
;; ;;
(define_insn "icjump" (define_insn "*icjump_64"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" "TARGET_CPU_ZARCH"
{ {
if (get_attr_length (insn) == 4) if (get_attr_length (insn) == 4)
return "j%D1\t%l0"; return "j%D1\t%l0";
else if (TARGET_CPU_ZARCH) else
return "jg%D1\t%l0"; return "jg%D1\t%l0";
}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 6)))])
(define_insn "*icjump_31"
[(set (pc)
(if_then_else
(match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
(pc)
(label_ref (match_operand 0 "" ""))))]
"!TARGET_CPU_ZARCH"
{
if (get_attr_length (insn) == 4)
return "j%D1\t%l0";
else else
abort (); abort ();
} }
[(set_attr "op_type" "RI") [(set_attr "op_type" "RI")
(set_attr "type" "branch") (set_attr "type" "branch")
(set (attr "length") (set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 4) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) (const_int 4) (const_int 6))
(const_int 6) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(eq (symbol_ref "flag_pic") (const_int 0)) (const_int 4) (const_int 8))))])
(const_int 6)] (const_int 8)))])
(define_insn "*icjump_long" (define_insn "*icjump_long"
[(set (pc) [(set (pc)
...@@ -6706,24 +6684,17 @@ ...@@ -6706,24 +6684,17 @@
[(trap_if (const_int 1) (const_int 0))] [(trap_if (const_int 1) (const_int 0))]
"" ""
"j\t.+2" "j\t.+2"
[(set_attr "op_type" "RX") [(set_attr "op_type" "RI")
(set_attr "type" "branch")]) (set_attr "type" "branch")])
(define_expand "conditional_trap" (define_expand "conditional_trap"
[(set (match_dup 2) (match_dup 3)) [(trap_if (match_operand 0 "comparison_operator" "")
(trap_if (match_operator 0 "comparison_operator" (match_operand 1 "general_operand" ""))]
[(match_dup 2) (const_int 0)])
(match_operand:SI 1 "general_operand" ""))]
"" ""
{ {
enum machine_mode ccmode;
if (operands[1] != const0_rtx) FAIL; if (operands[1] != const0_rtx) FAIL;
operands[0] = s390_emit_compare (GET_CODE (operands[0]),
ccmode = s390_select_ccmode (GET_CODE (operands[0]),
s390_compare_op0, s390_compare_op1); s390_compare_op0, s390_compare_op1);
operands[2] = gen_rtx_REG (ccmode, 33);
operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
}) })
(define_insn "*trap" (define_insn "*trap"
...@@ -6748,8 +6719,10 @@ ...@@ -6748,8 +6719,10 @@
(use (match_operand 4 "" ""))] ; label (use (match_operand 4 "" ""))] ; label
"" ""
{ {
if (GET_MODE (operands[0]) == SImode) if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0])); emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT) else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0])); emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
else else
...@@ -6758,7 +6731,7 @@ ...@@ -6758,7 +6731,7 @@
DONE; DONE;
}) })
(define_insn "doloop_si" (define_insn_and_split "doloop_si64"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
(ne (match_operand:SI 1 "register_operand" "d,d") (ne (match_operand:SI 1 "register_operand" "d,d")
...@@ -6769,26 +6742,75 @@ ...@@ -6769,26 +6742,75 @@
(plus:SI (match_dup 1) (const_int -1))) (plus:SI (match_dup 1) (const_int -1)))
(clobber (match_scratch:SI 3 "=X,&d")) (clobber (match_scratch:SI 3 "=X,&d"))
(clobber (reg:CC 33))] (clobber (reg:CC 33))]
"" "TARGET_CPU_ZARCH"
{ {
if (which_alternative != 0) if (which_alternative != 0)
return "#"; return "#";
else if (get_attr_length (insn) == 4) else if (get_attr_length (insn) == 4)
return "brct\t%1,%l0"; return "brct\t%1,%l0";
else if (TARGET_CPU_ZARCH) else
return "ahi\t%1,-1\;jgne\t%l0"; return "ahi\t%1,-1\;jgne\t%l0";
}
"&& reload_completed
&& (! REG_P (operands[2])
|| ! rtx_equal_p (operands[1], operands[2]))"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (reg:CCAN 33)
(compare:CCAN (plus:SI (match_dup 3) (const_int -1))
(const_int 0)))
(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
(set (match_dup 2) (match_dup 3))
(set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
(label_ref (match_dup 0))
(pc)))]
""
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 10)))])
(define_insn_and_split "doloop_si31"
[(set (pc)
(if_then_else
(ne (match_operand:SI 1 "register_operand" "d,d")
(const_int 1))
(label_ref (match_operand 0 "" ""))
(pc)))
(set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
(plus:SI (match_dup 1) (const_int -1)))
(clobber (match_scratch:SI 3 "=X,&d"))
(clobber (reg:CC 33))]
"!TARGET_CPU_ZARCH"
{
if (which_alternative != 0)
return "#";
else if (get_attr_length (insn) == 4)
return "brct\t%1,%l0";
else else
abort (); abort ();
} }
"&& reload_completed
&& (! REG_P (operands[2])
|| ! rtx_equal_p (operands[1], operands[2]))"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (reg:CCAN 33)
(compare:CCAN (plus:SI (match_dup 3) (const_int -1))
(const_int 0)))
(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
(set (match_dup 2) (match_dup 3))
(set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
(label_ref (match_dup 0))
(pc)))]
""
[(set_attr "op_type" "RI") [(set_attr "op_type" "RI")
(set_attr "type" "branch") (set_attr "type" "branch")
(set (attr "length") (set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 4) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) (const_int 4) (const_int 6))
(const_int 10) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(eq (symbol_ref "flag_pic") (const_int 0)) (const_int 4) (const_int 8))))])
(const_int 6)] (const_int 8)))])
(define_insn "*doloop_si_long" (define_insn "*doloop_si_long"
[(set (pc) [(set (pc)
...@@ -6801,7 +6823,7 @@ ...@@ -6801,7 +6823,7 @@
(plus:SI (match_dup 1) (const_int -1))) (plus:SI (match_dup 1) (const_int -1)))
(clobber (match_scratch:SI 3 "=X,&d")) (clobber (match_scratch:SI 3 "=X,&d"))
(clobber (reg:CC 33))] (clobber (reg:CC 33))]
"" "!TARGET_CPU_ZARCH"
{ {
if (get_attr_op_type (insn) == OP_TYPE_RR) if (get_attr_op_type (insn) == OP_TYPE_RR)
return "bctr\t%1,%0"; return "bctr\t%1,%0";
...@@ -6814,31 +6836,7 @@ ...@@ -6814,31 +6836,7 @@
(set_attr "type" "branch") (set_attr "type" "branch")
(set_attr "atype" "agen")]) (set_attr "atype" "agen")])
(define_split (define_insn_and_split "doloop_di"
[(set (pc)
(if_then_else (ne (match_operand:SI 1 "register_operand" "")
(const_int 1))
(match_operand 0 "" "")
(pc)))
(set (match_operand:SI 2 "nonimmediate_operand" "")
(plus:SI (match_dup 1) (const_int -1)))
(clobber (match_scratch:SI 3 ""))
(clobber (reg:CC 33))]
"reload_completed
&& (! REG_P (operands[2])
|| ! rtx_equal_p (operands[1], operands[2]))"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (reg:CCAN 33)
(compare:CCAN (plus:SI (match_dup 3) (const_int -1))
(const_int 0)))
(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
(set (match_dup 2) (match_dup 3))
(set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
(match_dup 0)
(pc)))]
"")
(define_insn "doloop_di"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
(ne (match_operand:DI 1 "register_operand" "d,d") (ne (match_operand:DI 1 "register_operand" "d,d")
...@@ -6858,23 +6856,7 @@ ...@@ -6858,23 +6856,7 @@
else else
return "aghi\t%1,-1\;jgne\t%l0"; return "aghi\t%1,-1\;jgne\t%l0";
} }
[(set_attr "op_type" "RI") "&& reload_completed
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 10)))])
(define_split
[(set (pc)
(if_then_else (ne (match_operand:DI 1 "register_operand" "")
(const_int 1))
(match_operand 0 "" "")
(pc)))
(set (match_operand:DI 2 "nonimmediate_operand" "")
(plus:DI (match_dup 1) (const_int -1)))
(clobber (match_scratch:DI 3 ""))
(clobber (reg:CC 33))]
"reload_completed
&& (! REG_P (operands[2]) && (! REG_P (operands[2])
|| ! rtx_equal_p (operands[1], operands[2]))" || ! rtx_equal_p (operands[1], operands[2]))"
[(set (match_dup 3) (match_dup 1)) [(set (match_dup 3) (match_dup 1))
...@@ -6884,9 +6866,14 @@ ...@@ -6884,9 +6866,14 @@
(set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))]) (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
(set (match_dup 2) (match_dup 3)) (set (match_dup 2) (match_dup 3))
(set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
(match_dup 0) (label_ref (match_dup 0))
(pc)))] (pc)))]
"") ""
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 10)))])
;; ;;
;;- Unconditional jump instructions. ;;- Unconditional jump instructions.
...@@ -6896,26 +6883,43 @@ ...@@ -6896,26 +6883,43 @@
; jump instruction pattern(s). ; jump instruction pattern(s).
; ;
(define_insn "jump" (define_expand "jump"
[(set (pc) (label_ref (match_operand 0 "" "")))] [(match_operand 0 "" "")]
"" ""
"s390_emit_jump (operands[0], NULL_RTX); DONE;")
(define_insn "*jump64"
[(set (pc) (label_ref (match_operand 0 "" "")))]
"TARGET_CPU_ZARCH"
{ {
if (get_attr_length (insn) == 4) if (get_attr_length (insn) == 4)
return "j\t%l0"; return "j\t%l0";
else if (TARGET_CPU_ZARCH) else
return "jg\t%l0"; return "jg\t%l0";
}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(const_int 4) (const_int 6)))])
(define_insn "*jump31"
[(set (pc) (label_ref (match_operand 0 "" "")))]
"!TARGET_CPU_ZARCH"
{
if (get_attr_length (insn) == 4)
return "j\t%l0";
else else
abort (); abort ();
} }
[(set_attr "op_type" "RI") [(set_attr "op_type" "RI")
(set_attr "type" "branch") (set_attr "type" "branch")
(set (attr "length") (set (attr "length")
(cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
(const_int 4) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) (const_int 4) (const_int 6))
(const_int 6) (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
(eq (symbol_ref "flag_pic") (const_int 0)) (const_int 4) (const_int 8))))])
(const_int 6)] (const_int 8)))])
; ;
; indirect-jump instruction pattern(s). ; indirect-jump instruction pattern(s).
......
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