Commit b58c068a by Denis Chertykov Committed by Denis Chertykov

avr-protos.c (jump_over_one_insn_p): New declaration.


	* config/avr/avr-protos.c (jump_over_one_insn_p): New declaration.
	* config/avr/avr.c (jump_over_one_insn_p): New function.
	* config/avr/avr.md: New peepholes added. Output test and
	conditional jump to "sbrc" or "sbrs" command.

From-SVN: r33855
parent 38b8de2f
Thu May 11 22:28:05 2000 Denis Chertykov <denisc@overta.ru>
* config/avr/avr-protos.c (jump_over_one_insn_p): New declaration.
* config/avr/avr.c (jump_over_one_insn_p): New function.
* config/avr/avr.md: New peepholes added. Output test and
conditional jump to "sbrc" or "sbrs" command.
2000-05-11 Mark Elbrecht <snowball3@bigfoot.com>
* cppmain.c (main): Use IS_DIR_SEPARATOR.
......
......@@ -136,6 +136,7 @@ extern int avr_jump_mode PARAMS ((rtx x, rtx insn));
extern int byte_immediate_operand PARAMS ((register rtx op,
enum machine_mode mode));
extern int test_hard_reg_class PARAMS ((enum reg_class class, rtx x));
extern int jump_over_one_insn_p PARAMS ((rtx insn, rtx dest));
#endif /* RTX_CODE */
......
......@@ -3870,3 +3870,15 @@ debug_hard_reg_set (HARD_REG_SET set)
fprintf (stderr, "\n");
}
int
jump_over_one_insn_p (insn, dest)
rtx insn;
rtx dest;
{
int uid = INSN_UID (GET_CODE (dest) == LABEL_REF
? XEXP (dest, 0)
: dest);
int jump_addr = insn_addresses[INSN_UID (insn)];
int dest_addr = insn_addresses[uid];
return dest_addr - jump_addr == 2;
}
......@@ -1832,3 +1832,56 @@
AS1 (jmp,%1));
}")
(define_peephole
[(set (cc0) (match_operand:QI 0 "register_operand" ""))
(set (pc)
(if_then_else (lt (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (insn, operands[1])"
"sbrs %0,7")
(define_peephole
[(set (cc0) (match_operand:QI 0 "register_operand" ""))
(set (pc)
(if_then_else (ge (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (insn, operands[1])"
"sbrc %0,7")
(define_peephole
[(set (cc0) (match_operand:HI 0 "register_operand" ""))
(set (pc)
(if_then_else (lt (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (NEXT_INSN (insn), operands[1])"
"sbrs %B0,7")
(define_peephole
[(set (cc0) (match_operand:HI 0 "register_operand" ""))
(set (pc)
(if_then_else (ge (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (insn, operands[1])"
"sbrc %B0,7")
(define_peephole
[(set (cc0) (match_operand:SI 0 "register_operand" ""))
(set (pc)
(if_then_else (lt (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (NEXT_INSN (insn), operands[1])"
"sbrs %D0,7")
(define_peephole
[(set (cc0) (match_operand:SI 0 "register_operand" ""))
(set (pc)
(if_then_else (ge (cc0) (const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))]
"jump_over_one_insn_p (insn, operands[1])"
"sbrc %D0,7")
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