diff options
Diffstat (limited to 'gcc/config/ia64/ia64.md')
-rw-r--r-- | gcc/config/ia64/ia64.md | 141 |
1 files changed, 62 insertions, 79 deletions
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 1d98ca2..7ccf89d 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -2134,53 +2134,29 @@ operands[3] = ia64_compare_op1; }") -;; ??? Need a way to choose between dpnt and dptk. Currently, I assume that -;; equality tests will likely fail, and inequality tests will likely succeed. - -(define_insn "*beq_true" +(define_insn "*br_true" [(set (pc) - (if_then_else (eq:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) - (label_ref (match_operand 1 "" "")) + (if_then_else (match_operator 0 "predicate_operator" + [(match_operand:CC 1 "register_operand" "c") + (const_int 0)]) + (label_ref (match_operand 2 "" "")) (pc)))] "" - "(%I0) br.cond.dpnt %l1" + "* return ia64_expand_prediction (insn, \"(%%J0) br.cond.%s %%l2\");" [(set_attr "type" "B") (set_attr "predicable" "no")]) -(define_insn "*beq_false" +(define_insn "*br_false" [(set (pc) - (if_then_else (eq:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) + (if_then_else (match_operator 0 "predicate_operator" + [(match_operand:CC 1 "register_operand" "c") + (const_int 0)]) (pc) - (label_ref (match_operand 1 "" ""))))] - "" - "(%0) br.cond.dptk %l1" - [(set_attr "type" "B") - (set_attr "predicable" "no")]) - -(define_insn "*bne_true" - [(set (pc) - (if_then_else (ne:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) - (label_ref (match_operand 1 "" "")) - (pc)))] + (label_ref (match_operand 2 "" ""))))] "" - "(%0) br.cond.dptk %l1" + "* return ia64_expand_prediction (insn, \"(%%j0) br.cond.%s %%l2\");" [(set_attr "type" "B") (set_attr "predicable" "no")]) - -(define_insn "*bne_false" - [(set (pc) - (if_then_else (ne:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) - (pc) - (label_ref (match_operand 1 "" ""))))] - "" - "(%I0) br.cond.dpnt %l1" - [(set_attr "type" "B") - (set_attr "predicable" "no")]) - ;; :::::::::::::::::::: ;; :: @@ -2716,16 +2692,19 @@ operands[2] = gen_reg_rtx (DImode); }") -;; ??? A call must end a group, otherwise, the assembler might pack it in -;; a group with a following branch, and then the function return goes to the -;; wrong place. We could perhaps handle this in emit_insn_group_barriers. - (define_insn "call_internal" [(call (mem:DI (match_operand:DI 0 "call_operand" "bi")) (match_operand 1 "" "")) (clobber (match_operand:DI 2 "register_operand" "=b"))] "" - "br.call.sptk.many %2 = %0 ;;" + "* +{ + operands[3] = current_insn_predicate; + if (operands[3] != NULL_RTX) + return ia64_expand_prediction (insn, \"(%%J3) br.call.%s.many %2 = %0\"); + else + return \"br.call.sptk.many %2 = %0\"; +}" [(set_attr "type" "B")]) (define_insn "*call_internal1" @@ -2734,7 +2713,14 @@ (use (reg:DI 1)) (clobber (match_operand:DI 2 "register_operand" "=b"))] "" - "br.call.sptk.many %2 = %0 ;;" + "* +{ + operands[3] = current_insn_predicate; + if (operands[3] != NULL_RTX) + return ia64_expand_prediction (insn, \"(%%J3) br.call.%s.many %2 = %0\"); + else + return \"br.call.sptk.many %2 = %0\"; +}" [(set_attr "type" "B")]) ;; Subroutine call instruction returning a value. Operand 0 is the hard @@ -2928,17 +2914,20 @@ = gen_rtx_SET (VOIDmode, XEXP (XVECEXP (operands[0], 0, i), 0), call); }") -;; ??? A call must end a group, otherwise, the assembler might pack it in -;; a group with a following branch, and then the function return goes to the -;; wrong place. We could perhaps handle this in emit_insn_group_barriers. - (define_insn "call_value_internal" [(set (match_operand 0 "register_operand" "=rf") (call (mem:DI (match_operand:DI 1 "call_operand" "bi")) (match_operand 2 "" ""))) (clobber (match_operand:DI 3 "register_operand" "=b"))] "" - "br.call.sptk.many %3 = %1 ;;" + "* +{ + operands[4] = current_insn_predicate; + if (operands[4] != NULL_RTX) + return ia64_expand_prediction (insn, \"(%%J4) br.call.%s.many %3 = %1\"); + else + return \"br.call.sptk.many %3 = %1\"; +}" [(set_attr "type" "B")]) (define_insn "*call_value_internal1" @@ -2948,7 +2937,14 @@ (use (reg:DI 1)) (clobber (match_operand:DI 3 "register_operand" "=b"))] "" - "br.call.sptk.many %3 = %1 ;;" + "* +{ + operands[4] = current_insn_predicate; + if (operands[4] != NULL_RTX) + return ia64_expand_prediction (insn, \"(%%J4) br.call.%s.many %3 = %1\"); + else + return \"br.call.sptk.many %3 = %1\"; +}" [(set_attr "type" "B")]) (define_insn "*call_multiple_values_internal1" @@ -2959,7 +2955,14 @@ (use (reg:DI 1)) (clobber (match_operand:DI 4 "register_operand" "=b"))])] "" - "br.call.sptk.many %4 = %2 ;;" + "* +{ + operands[5] = current_insn_predicate; + if (operands[5] != NULL_RTX) + return ia64_expand_prediction (insn, \"(%%J5) br.call.%s.many %4 = %2\"); + else + return \"br.call.sptk.many %4 = %2\"; +}" [(set_attr "type" "B")]) ;; Call subroutine returning any type. @@ -3004,47 +3007,27 @@ "br.ret.sptk.many rp" [(set_attr "type" "B")]) -(define_insn "*eq_return" - [(set (pc) - (if_then_else (eq:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) - (return) - (pc)))] - "ia64_direct_return ()" - "(%I0) br.ret.sptk.many rp" - [(set_attr "type" "B") - (set_attr "predicable" "no")]) - -(define_insn "*eq_not_return" - [(set (pc) - (if_then_else (eq:CC (match_operand:CC 0 "register_operand" "c") - (const_int 0)) - (pc) - (return)))] - "ia64_direct_return ()" - "(%0) br.ret.sptk.many rp" - [(set_attr "type" "B") - (set_attr "predicable" "no")]) - -(define_insn "*ne_return" +(define_insn "*return_true" [(set (pc) - (if_then_else (ne (match_operand:CC 0 "register_operand" "c") - (const_int 0)) + (if_then_else (match_operator 0 "predicate_operator" + [(match_operand:CC 1 "register_operand" "c") + (const_int 0)]) (return) (pc)))] "ia64_direct_return ()" - "(%0) br.ret.sptk.many rp" + "* return ia64_expand_prediction (insn, \"(%%J0) br.ret.%s.many rp\");" [(set_attr "type" "B") (set_attr "predicable" "no")]) -(define_insn "*ne_not_return" +(define_insn "*return_false" [(set (pc) - (if_then_else (ne (match_operand:CC 0 "register_operand" "c") - (const_int 0)) + (if_then_else (match_operator 0 "predicate_operator" + [(match_operand:CC 1 "register_operand" "c") + (const_int 0)]) (pc) (return)))] "ia64_direct_return ()" - "(%I0) br.ret.sptk.many rp" + "* return ia64_expand_prediction (insn, \"(%%j0) br.ret.%s.many rp\");" [(set_attr "type" "B") (set_attr "predicable" "no")]) |