* config/avr/avr.c (ret_cond_branch): New argument (reverse) added.
If REVERSE nonzero then condition code in X must be reversed.
(encode_section_info): Optimise if/else.
(avr_function_value): Fix formatting.
* config/avr/avr.md (branch): Call to ret_cond_branch changed.
(difficult_branch): Likewise.
(rvbranch): Likewise.
(difficult_rvbranch): Likewise.
* config/avr/avr-protos.h (ret_cond_branch): Prototype changed.
* config/avr/libgcc.S: Fix comment.
From-SVN: r39163
+Sun Jan 21 09:44:17 2001 Denis Chertykov <denisc@overta.ru>
+
+ * config/avr/avr.c (ret_cond_branch): New argument (reverse) added.
+ If REVERSE nonzero then condition code in X must be reversed.
+ (encode_section_info): Optimise if/else.
+ (avr_function_value): Fix formatting.
+
+ * config/avr/avr.md (branch): Call to ret_cond_branch changed.
+ (difficult_branch): Likewise.
+ (rvbranch): Likewise.
+ (difficult_rvbranch): Likewise.
+
+ * config/avr/avr-protos.h (ret_cond_branch): Prototype changed.
+
+ * config/avr/libgcc.S: Fix comment.
+
2001-01-20 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* sdbout.c (PUT_SDB_DEF): Fix after last bogus change.
extern const char * output_movsisf PARAMS ((rtx insn, rtx operands[], int *l));
extern const char * out_tstsi PARAMS ((rtx insn, int *l));
extern const char * out_tsthi PARAMS ((rtx insn, int *l));
-extern const char * ret_cond_branch PARAMS ((RTX_CODE cond, int len));
+extern const char * ret_cond_branch PARAMS ((rtx x, int len, int reverse));
extern const char * ashlqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashlhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
return 2;
}
-/* return a AVR condition jump commands.
- LEN is a number returned by avr_jump_mode function. */
+/* return an AVR condition jump commands.
+ X is a comparison RTX.
+ LEN is a number returned by avr_jump_mode function.
+ if REVERSE nonzero then condition code in X must be reversed. */
const char *
-ret_cond_branch (cond, len)
- RTX_CODE cond;
+ret_cond_branch (x, len, reverse)
+ rtx x;
int len;
+ int reverse;
{
+ RTX_CODE cond = reverse ? reverse_condition (GET_CODE (x)) : GET_CODE (x);
+
switch (cond)
{
case GT:
AS1 (brsh,_PC_+4) CR_TAB
AS1 (jmp,%0)));
default:
- switch (len)
- {
- case 1:
- return AS1 (br%j1,%0);
- case 2:
- return (AS1 (br%k1,_PC_+2) CR_TAB
- AS1 (rjmp,%0));
- default:
- return (AS1 (br%k1,_PC_+4) CR_TAB
- AS1 (jmp,%0));
- }
+ if (reverse)
+ {
+ switch (len)
+ {
+ case 1:
+ return AS1 (br%k1,%0);
+ case 2:
+ return (AS1 (br%j1,_PC_+2) CR_TAB
+ AS1 (rjmp,%0));
+ default:
+ return (AS1 (br%j1,_PC_+4) CR_TAB
+ AS1 (jmp,%0));
+ }
+ }
+ else
+ {
+ switch (len)
+ {
+ case 1:
+ return AS1 (br%j1,%0);
+ case 2:
+ return (AS1 (br%k1,_PC_+2) CR_TAB
+ AS1 (rjmp,%0));
+ default:
+ return (AS1 (br%k1,_PC_+4) CR_TAB
+ AS1 (jmp,%0));
+ }
+ }
}
return "";
}
{
if (TREE_CODE (decl) == FUNCTION_DECL)
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-
- if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl))
- && TREE_CODE (decl) == VAR_DECL
- && avr_progmem_p (decl))
+ else if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl))
+ && TREE_CODE (decl) == VAR_DECL
+ && avr_progmem_p (decl))
{
const char *dsec = ".progmem.data";
DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec);
tree func ATTRIBUTE_UNUSED;
{
unsigned int offs;
+
if (TYPE_MODE (type) != BLKmode)
return avr_libcall_value (TYPE_MODE (type));
"! (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU
|| GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)"
"*
- return ret_cond_branch (GET_CODE (operands[1]),
- avr_jump_mode (operands[0],insn));"
+ return ret_cond_branch (operands[1], avr_jump_mode (operands[0],insn), 0);"
[(set_attr "type" "branch")
(set_attr "cc" "clobber")])
"(GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU
|| GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)"
"*
- return ret_cond_branch (GET_CODE (operands[1]),
- avr_jump_mode (operands[0],insn));"
+ return ret_cond_branch (operands[1], avr_jump_mode (operands[0],insn), 0);"
[(set_attr "type" "branch1")
(set_attr "cc" "clobber")])
"! (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU
|| GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)"
"*
- return ret_cond_branch (reverse_condition (GET_CODE (operands[1])),
- avr_jump_mode (operands[0],insn));"
+ return ret_cond_branch (operands[1], avr_jump_mode (operands[0], insn), 1);"
[(set_attr "type" "branch1")
(set_attr "cc" "clobber")])
"(GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU
|| GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)"
"*
- return ret_cond_branch (reverse_condition (GET_CODE (operands[1])),
- avr_jump_mode (operands[0],insn));"
+ return ret_cond_branch (operands[1], avr_jump_mode (operands[0], insn), 1);"
[(set_attr "type" "branch")
(set_attr "cc" "clobber")])
#endif /* defined (L_prologue) */
/*
- * This is a epilogue subroutine
+ * This is an epilogue subroutine
*/
#if defined (L_epilogue)