avr-protos.h, avr.c (unique_section, [...]): Add "const" as needed to remove warnings.

* config/avr/avr-protos.h, config/avr/avr.c (unique_section,
	gas_output_limited_string, gas_output_ascii, output_movqi,
	output_movhi, out_movqi_r_mr, out_movqi_mr_r, out_movhi_r_mr,
	out_movhi_mr_r, out_movsi_r_mr, out_movsi_mr_r, output_movsisf,
	out_tstsi, out_tsthi, ret_cond_branch, ashlqi3_out, ashlhi3_out,
	ashlsi3_out, ashrqi3_out, ashrhi3_out, ashrsi3_out, lshrqi3_out,
	lshrhi3_out, lshrsi3_out, output_reload_inhi, output_reload_insisf,
	out_shift_with_cnt, ptrreg_to_str, cond_string, encode_section_info):
	Add "const" as needed to remove warnings.

	* config/avr/avr.c (avr_override_options, avr_init_once,
	function_prologue, function_epilogue, frame_pointer_required_p,
	class_likely_spilled_p, order_regs_for_local_alloc,
	avr_address_cost, avr_ret_register): Use K&R style arguments.
	(initial_elimination_offset, gas_output_limited_string):
	Remove ATTRIBUTE_UNUSED from the used arguments.
	(output_mov*, out_mov*_r_mr, out_mov*_mr_r, output_reload_insisf):
	Use local variables src, dest, base to access operands[].
	Rename reg_dest to reg_src if that's what it is.
	(output_movhi, output_movsisf): Optimize loading 8-bit immediate
	constants to LD_REGS if reg_was_0.
	(output_reload_insisf): Change arg 3 to insn length and set it.
	(out_movhi_r_mr, out_movhi_mr_r): Use in/out for more efficient
	access to 16-bit I/O register pairs.
	(avr_address_cost): Lower cost for the above case.
	(out_tsthi): Use "or" (faster) instead of "sbiw" if the operand
	may be clobbered, also for LD_REGS.
	(adjust_insn_length): Correct insn length for iorhi3 and iorsi3
	with a CONST_INT.

	* config/avr/avr.h (PTRDIFF_TYPE): Make signed.

	* config/avr/avr.md: Change all uses of the TEST_HARD_REG_CLASS
	macro to test_hard_reg_class function.
	(*movsi, *movsf): Change "cc" attribute from "clobber" to "none"
	for loading immediate constants to LD_REGS.
	(andsi3, cmphi, cmpsi): Add return statements to avoid warnings.

From-SVN: r36117
This commit is contained in:
Marek Michalkiewicz 2000-09-03 09:37:48 +02:00 committed by Denis Chertykov
parent bad3869abd
commit 5fecfd8d61
5 changed files with 351 additions and 254 deletions

View File

@ -1,3 +1,44 @@
2000-09-02 Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/avr-protos.h, config/avr/avr.c (unique_section,
gas_output_limited_string, gas_output_ascii, output_movqi,
output_movhi, out_movqi_r_mr, out_movqi_mr_r, out_movhi_r_mr,
out_movhi_mr_r, out_movsi_r_mr, out_movsi_mr_r, output_movsisf,
out_tstsi, out_tsthi, ret_cond_branch, ashlqi3_out, ashlhi3_out,
ashlsi3_out, ashrqi3_out, ashrhi3_out, ashrsi3_out, lshrqi3_out,
lshrhi3_out, lshrsi3_out, output_reload_inhi, output_reload_insisf,
out_shift_with_cnt, ptrreg_to_str, cond_string, encode_section_info):
Add "const" as needed to remove warnings.
* config/avr/avr.c (avr_override_options, avr_init_once,
function_prologue, function_epilogue, frame_pointer_required_p,
class_likely_spilled_p, order_regs_for_local_alloc,
avr_address_cost, avr_ret_register): Use K&R style arguments.
(initial_elimination_offset, gas_output_limited_string):
Remove ATTRIBUTE_UNUSED from the used arguments.
(output_mov*, out_mov*_r_mr, out_mov*_mr_r, output_reload_insisf):
Use local variables src, dest, base to access operands[].
Rename reg_dest to reg_src if that's what it is.
(output_movhi, output_movsisf): Optimize loading 8-bit immediate
constants to LD_REGS if reg_was_0.
(output_reload_insisf): Change arg 3 to insn length and set it.
(out_movhi_r_mr, out_movhi_mr_r): Use in/out for more efficient
access to 16-bit I/O register pairs.
(avr_address_cost): Lower cost for the above case.
(out_tsthi): Use "or" (faster) instead of "sbiw" if the operand
may be clobbered, also for LD_REGS.
(adjust_insn_length): Correct insn length for iorhi3 and iorsi3
with a CONST_INT.
* config/avr/avr.h (PTRDIFF_TYPE): Make signed.
* config/avr/avr.md: Change all uses of the TEST_HARD_REG_CLASS
macro to test_hard_reg_class function.
(*movsi, *movsf): Change "cc" attribute from "clobber" to "none"
for loading immediate constants to LD_REGS.
(andsi3, cmphi, cmpsi): Add return statements to avoid warnings.
Sat Sep 2 13:58:23 2000 Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__

View File

@ -27,7 +27,7 @@ extern void asm_file_end PARAMS ((FILE *file));
extern void avr_init_once PARAMS ((void));
extern void avr_override_options PARAMS ((void));
extern char * avr_change_section PARAMS ((char *sect_name));
extern int avr_ret_register PARAMS((void));
extern int avr_ret_register PARAMS ((void));
extern enum reg_class class_likely_spilled_p PARAMS ((int c));
extern enum reg_class avr_regno_reg_class PARAMS ((int r));
extern enum reg_class avr_reg_class_from_letter PARAMS ((int c));
@ -39,8 +39,8 @@ extern void function_prologue PARAMS ((FILE *file, int size));
extern void function_epilogue PARAMS ((FILE *file, int size));
extern void progmem_section PARAMS ((void));
extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask));
extern void gas_output_limited_string PARAMS ((FILE *file, char *str));
extern void gas_output_ascii PARAMS ((FILE *file, char * str,
extern void gas_output_limited_string PARAMS ((FILE *file, const char *str));
extern void gas_output_ascii PARAMS ((FILE *file, const char *str,
size_t length));
@ -86,30 +86,30 @@ extern int legitimate_address_p PARAMS ((enum machine_mode mode, rtx x,
int strict));
extern void machine_dependent_reorg PARAMS ((rtx first_insn));
extern int compare_diff_p PARAMS ((rtx insn));
extern char * output_movqi PARAMS ((rtx insn, rtx operands[], int *l));
extern char * output_movhi PARAMS ((rtx insn, rtx operands[], int *l));
extern char * out_movqi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movqi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movhi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movhi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movsi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movsi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * output_movsisf PARAMS ((rtx insn, rtx operands[], int *l));
extern char * out_tstsi PARAMS ((rtx insn, int *l));
extern char * out_tsthi PARAMS ((rtx insn, int *l));
extern char * ret_cond_branch PARAMS ((RTX_CODE cond, int len));
extern const char * output_movqi PARAMS ((rtx insn, rtx operands[], int *l));
extern const char * output_movhi PARAMS ((rtx insn, rtx operands[], int *l));
extern const char * out_movqi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern const char * out_movqi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern const char * out_movhi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern const char * out_movhi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern const char * out_movsi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern const char * out_movsi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
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 char * ashlqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * ashlhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * ashlsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashlqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashlhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashlsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * ashrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * ashrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * ashrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * ashrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * lshrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * lshrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern char * lshrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * lshrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * lshrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * lshrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern enum reg_class preferred_reload_class PARAMS ((rtx x,
enum reg_class class));
@ -119,10 +119,10 @@ extern rtx legitimize_address PARAMS ((rtx x, rtx oldx,
enum machine_mode mode));
extern int adjust_insn_length PARAMS ((rtx insn, int len));
extern rtx avr_libcall_value PARAMS ((enum machine_mode mode));
extern char * output_reload_inhi PARAMS ((rtx insn, rtx *operands,
int *len));
extern char * output_reload_insisf PARAMS ((rtx insn, rtx *operands,
int which_alternative));
extern const char * output_reload_inhi PARAMS ((rtx insn, rtx *operands,
int *len));
extern const char * output_reload_insisf PARAMS ((rtx insn, rtx *operands,
int *len));
extern int default_rtx_costs PARAMS ((rtx X, RTX_CODE code,
RTX_CODE outer_code));
extern void asm_output_char PARAMS ((FILE *file, rtx value));
@ -151,7 +151,7 @@ extern int avr_simplify_comparision_p PARAMS ((enum machine_mode mode,
RTX_CODE operator, rtx x));
extern RTX_CODE avr_normalize_condition PARAMS ((RTX_CODE condition));
extern int compare_eq_p PARAMS ((rtx insn));
extern void out_shift_with_cnt PARAMS ((char * template, rtx insn,
extern void out_shift_with_cnt PARAMS ((const char *template, rtx insn,
rtx operands[], int *len));
extern int const_int_pow2_p PARAMS ((rtx x));
#endif /* RTX_CODE */

File diff suppressed because it is too large Load Diff

View File

@ -323,7 +323,7 @@ extern int avr_enhanced_p;
If you don't define this macro, the default is `"long unsigned
int"'. */
#define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" :"unsigned int")
#define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long int" :"int")
/* A C expression for a string describing the name of the data type
to use for the result of subtracting two pointers. The typedef
name `ptrdiff_t' is defined using the contents of the string. See

View File

@ -271,7 +271,7 @@
|| register_operand (operands[1],SImode) || const0_rtx == operands[1])"
"* return output_movsisf (insn, operands, NULL);"
[(set_attr "length" "4,4,8,8,4,10")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")])
(set_attr "cc" "none,set_zn,clobber,clobber,none,clobber")])
;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
;; move floating point numbers (32 bit)
@ -297,7 +297,7 @@
|| register_operand (operands[1], SFmode)"
"* return output_movsisf (insn, operands, NULL);"
[(set_attr "length" "4,4,8,8,4,10")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")])
(set_attr "cc" "none,set_zn,clobber,clobber,none,clobber")])
;;=========================================================================
;; move string (like memcpy)
@ -555,6 +555,7 @@
[(set_attr "length" "2,1,1,2,3,3")
(set_attr "cc" "set_n,set_czn,set_czn,set_czn,set_n,set_n")])
;; TODO: use "movw" if available
(define_insn "addsi3"
[(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r,&*!w,&*!w")
(plus:SI
@ -734,7 +735,8 @@
AS2 (andi, %B0,hi8(%2)) CR_TAB
AS2 (andi, %C0,hlo8(%2)) CR_TAB
AS2 (andi, %D0,hhi8(%2)));
}
}
return \"bug\";
}"
[(set_attr "length" "4,4")
(set_attr "cc" "set_n,set_n")])
@ -1076,6 +1078,7 @@
[(set_attr "length" "5,6")
(set_attr "cc" "clobber,clobber")])
;; TODO: use "movw" if available
(define_insn "extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=r,&r")
(sign_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))]
@ -1109,6 +1112,7 @@
[(set_attr "length" "3,4")
(set_attr "cc" "set_n,set_n")])
;; TODO: use "movw" if available
(define_insn "zero_extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=r,&r")
(zero_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))]
@ -1211,7 +1215,7 @@
case 1:
if (reg_unused_after (insn, operands[0])
&& INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63
&& TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0])))
&& test_hard_reg_class (ADDW_REGS, operands[0]))
return AS2 (sbiw,%0,%1);
else
return (AS2 (cpi,%0,%1) CR_TAB
@ -1235,6 +1239,7 @@
AS2 (ldi, %2,hi8(%1)) CR_TAB
AS2 (cpc, %B0,%2));
}
return \"bug\";
}"
[(set_attr "cc" "compare,compare,compare,compare,compare")
(set_attr "length" "2,2,3,3,4")])
@ -1257,7 +1262,7 @@
case 1:
if (reg_unused_after (insn, operands[0])
&& INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63
&& TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0])))
&& test_hard_reg_class (ADDW_REGS, operands[0]))
return (AS2 (sbiw,%0,%1) CR_TAB
AS2 (cpc,%C0,__zero_reg__) CR_TAB
AS2 (cpc,%D0,__zero_reg__));
@ -1295,7 +1300,8 @@
AS2 (cpc, %C0,%2) CR_TAB
AS2 (ldi, %2,hhi8(%1)) CR_TAB
AS2 (cpc, %D0,%2));
}
}
return \"bug\";
}"
[(set_attr "cc" "compare,compare,compare,compare,compare")
(set_attr "length" "4,4,7,5,8")])
@ -1610,6 +1616,7 @@
""
"")
;; TODO: insn length for AVR_ENHANCED
(define_insn "call_insn"
[(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "!z,*r,i"))
(match_operand:HI 1 "general_operand" "X,X,X"))]
@ -1645,6 +1652,7 @@
(const_int 2)]
(const_int 1)))])
;; TODO: insn length for AVR_ENHANCED
(define_insn "call_value_insn"
[(set (match_operand 0 "register_operand" "=r,r,r")
(call (mem:HI (match_operand:HI 1 "nonmemory_operand" "!z,*r,i"))
@ -1705,6 +1713,8 @@
"optimize"
"")
;; TODO: jump to __tabjejump__ in libgcc
(define_insn "*tablejump_enh"
[(set (pc) (mem:HI
(plus:HI (match_operand:HI 0 "register_operand" "=&z")
@ -1798,7 +1808,7 @@
&& test_hard_reg_class (LD_REGS, operands[1]))"
"*
{
if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0])))
if (test_hard_reg_class (ADDW_REGS, operands[0]))
output_asm_insn (AS2 (sbiw,%0,1) CR_TAB
AS2 (sbc,%C0,__zero_reg__) CR_TAB
AS2 (sbc,%D0,__zero_reg__) \"\\n\", operands);
@ -1836,7 +1846,7 @@
&& test_hard_reg_class (LD_REGS, operands[1]))"
"*
{
if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0])))
if (test_hard_reg_class (ADDW_REGS, operands[0]))
output_asm_insn (AS2 (sbiw,%0,1), operands);
else
output_asm_insn (AS2 (subi,%A0,1) CR_TAB