',' print LOCAL_LABEL_PREFIX
'@' print trap, rte or rts depending upon pragma interruptness
'#' output a nop if there is nothing to put in the delay slot
+ ''' print likelyhood suffix (/u for unlikely).
'O' print a constant without the #
'R' print the LSW of a dp value - changes if in little endian
'S' print the MSW of a dp value - changes if in little endian
if (dbr_sequence_length () == 0)
fprintf (stream, "\n\tnop");
break;
+ case '\'':
+ {
+ rtx note = find_reg_note (current_output_insn, REG_BR_PROB, 0);
+
+ if (note && INTVAL (XEXP (note, 0)) * 2 < REG_BR_PROB_BASE)
+ fputs ("/u", stream);
+ break;
+ }
case 'O':
x = mark_constant_pool_use (x);
output_addr_const (stream, x);
case MINUS: fputs ("sub", stream); break;
case MULT: fputs ("mul", stream); break;
case DIV: fputs ("div", stream); break;
+ case EQ: fputs ("eq", stream); break;
+ case NE: fputs ("ne", stream); break;
+ case GT: case LT: fputs ("gt", stream); break;
+ case GE: case LE: fputs ("ge", stream); break;
+ case GTU: case LTU: fputs ("gtu", stream); break;
+ case GEU: case LEU: fputs ("geu", stream); break;
default:
break;
}
goto default_output;
case 'u':
if (GET_CODE (x) == CONST_INT)
- {
+ {
fprintf ((stream), "%u", (unsigned) INTVAL (x) & (0x10000 - 1));
break;
}
return 0;
}
+int
+equality_comparison_operator (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ return ((mode == VOIDmode || GET_MODE (op) == mode)
+ && (GET_CODE (op) == EQ || GET_CODE (op) == NE));
+}
+
+int greater_comparison_operator (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (mode != VOIDmode && GET_MODE (op) == mode)
+ return 0;
+ switch (GET_CODE (op))
+ {
+ case GT:
+ case GE:
+ case GTU:
+ case GEU:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+int less_comparison_operator (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (mode != VOIDmode && GET_MODE (op) == mode)
+ return 0;
+ switch (GET_CODE (op))
+ {
+ case LT:
+ case LE:
+ case LTU:
+ case LEU:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
/* Accept pseudos and branch target registers. */
int
target_reg_operand (op, mode)
for (i -= 2 ; i >= 0; i -= 2)
if (! rtx_equal_p (XVECEXP (v, 0, i + 1), x)
|| ! rtx_equal_p (XVECEXP (v, 0, i), y))
- return 0;
+ return 0;
}
else
for (; i >= 0; i--)
if (XVECEXP (v, 0, i) != x)
- return 0;
+ return 0;
return 1;
}
#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
((CHAR) == '.' || (CHAR) == '#' || (CHAR) == '@' || (CHAR) == ',' \
- || (CHAR) == '$')
+ || (CHAR) == '$'|| (CHAR) == '\'')
/* Recognize machine-specific patterns that may appear within
constants. Used for PIC-specific UNSPECs. */
{"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \
{"binary_float_operator", {PLUS, MULT}}, \
{"commutative_float_operator", {PLUS, MULT}}, \
+ {"equality_comparison_operator", {EQ,NE}}, \
{"extend_reg_operand", {SUBREG, REG, TRUNCATE}}, \
{"extend_reg_or_0_operand", {SUBREG, REG, TRUNCATE, CONST_INT}}, \
{"fp_arith_reg_operand", {SUBREG, REG}}, \
{"fpul_operand", {REG}}, \
{"general_movsrc_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM}}, \
{"general_movdst_operand", {SUBREG, REG, MEM}}, \
+ {"greater_comparison_operator", {GT,GE,GTU,GEU}}, \
+ {"less_comparison_operator", {LT,LE,LTU,LEU}}, \
{"logical_operand", {SUBREG, REG, CONST_INT}}, \
{"mextr_bit_offset", {CONST_INT}}, \
{"noncommutative_float_operator", {MINUS, DIV}}, \
"TARGET_SHMEDIA"
"")
-(define_insn "beq_media_i"
+(define_insn "*beq_media_i"
[(set (pc)
- (if_then_else (eq (match_operand:DI 1 "arith_reg_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "r,O"))
+ (if_then_else (match_operator 3 "equality_comparison_operator"
+ [(match_operand:DI 1 "arith_reg_operand" "r,r")
+ (match_operand:DI 2 "arith_operand" "r,O")])
(match_operand:DI 0 "target_operand" "b,b")
(pc)))]
"TARGET_SHMEDIA"
"@
- beq %1, %2, %0
- beqi %1, %2, %0")
+ b%o3%' %1, %2, %0
+ b%o3i%' %1, %2, %0"
+ [(set_attr "type" "cbranch_media")])
(define_expand "bne_media"
[(set (pc)
"TARGET_SHMEDIA"
"")
-(define_insn "bne_media_i"
- [(set (pc)
- (if_then_else (ne (match_operand:DI 1 "arith_reg_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "r,O"))
- (match_operand:DI 0 "target_operand" "b,b")
- (pc)))]
- "TARGET_SHMEDIA"
- "@
- bne %1, %2, %0
- bnei %1, %2, %0")
-
(define_expand "bgt_media"
[(set (pc)
(if_then_else (gt (match_operand:DI 1 "arith_reg_operand" "r")
"TARGET_SHMEDIA"
"")
-(define_insn "bgt_media_i"
- [(set (pc)
- (if_then_else (gt (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bgt %1, %2, %0")
-
(define_expand "bge_media"
[(set (pc)
(if_then_else (ge (match_operand:DI 1 "arith_reg_operand" "r")
"TARGET_SHMEDIA"
"")
-(define_insn "bge_media_i"
- [(set (pc)
- (if_then_else (ge (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bge %1, %2, %0")
-
(define_expand "bgtu_media"
[(set (pc)
(if_then_else (gtu (match_operand:DI 1 "arith_reg_operand" "r")
"TARGET_SHMEDIA"
"")
-(define_insn "bgtu_media_i"
- [(set (pc)
- (if_then_else (gtu (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bgtu %1, %2, %0")
-
(define_expand "bgeu_media"
[(set (pc)
(if_then_else (geu (match_operand:DI 1 "arith_reg_operand" "r")
"TARGET_SHMEDIA"
"")
-(define_insn "bgeu_media_i"
+(define_insn "*bgt_media_i"
[(set (pc)
- (if_then_else (geu (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
+ (if_then_else (match_operator 3 "greater_comparison_operator"
+ [(match_operand:DI 1 "arith_reg_or_0_operand" "rN")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rN")])
(match_operand:DI 0 "target_operand" "b")
(pc)))]
"TARGET_SHMEDIA"
- "bgeu %1, %2, %0")
+ "b%o3%' %N1, %N2, %0"
+ [(set_attr "type" "cbranch_media")])
;; These are only needed to make invert_jump() happy.
(define_insn "*ble_media_i"
[(set (pc)
- (if_then_else (le (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bge %2, %1, %0")
-
-(define_insn "*blt_media_i"
- [(set (pc)
- (if_then_else (lt (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bgt %2, %1, %0")
-
-(define_insn "*bleu_media_i"
- [(set (pc)
- (if_then_else (leu (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
- (match_operand:DI 0 "target_operand" "b")
- (pc)))]
- "TARGET_SHMEDIA"
- "bgeu %2, %1, %0")
-
-(define_insn "*bltu_media_i"
- [(set (pc)
- (if_then_else (ltu (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_operand" "r"))
+ (if_then_else (match_operator 3 "less_comparison_operator"
+ [(match_operand:DI 1 "arith_reg_operand" "rN")
+ (match_operand:DI 2 "arith_reg_operand" "rN")])
(match_operand:DI 0 "target_operand" "b")
(pc)))]
"TARGET_SHMEDIA"
- "bgtu %2, %1, %0")
+ "b%o3%' %N2, %N1, %0"
+ [(set_attr "type" "cbranch_media")])
(define_expand "beq"
[(set (pc)
DONE;
}
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgt_media (operands[0],
sh_compare_op0, sh_compare_op1));
DONE;
DONE;
}
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgt_media (operands[0],
sh_compare_op1, sh_compare_op0));
DONE;
DONE;
}
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bge_media (operands[0],
sh_compare_op1, sh_compare_op0));
DONE;
DONE;
}
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bge_media (operands[0],
sh_compare_op0, sh_compare_op1));
DONE;
{
if (TARGET_SHMEDIA)
{
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgtu_media (operands[0],
sh_compare_op0, sh_compare_op1));
DONE;
{
if (TARGET_SHMEDIA)
{
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgtu_media (operands[0],
sh_compare_op1, sh_compare_op0));
DONE;
{
if (TARGET_SHMEDIA)
{
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgeu_media (operands[0],
sh_compare_op0, sh_compare_op1));
DONE;
{
if (TARGET_SHMEDIA)
{
- sh_compare_op0 = force_reg (DImode, sh_compare_op0);
- sh_compare_op1 = force_reg (DImode, sh_compare_op1);
+ if (sh_compare_op0 != const0_rtx)
+ sh_compare_op0 = force_reg (DImode, sh_compare_op0);
+ if (sh_compare_op1 != const0_rtx)
+ sh_compare_op1 = force_reg (DImode, sh_compare_op1);
emit_jump_insn (gen_bgeu_media (operands[0],
sh_compare_op1, sh_compare_op0));
DONE;