Commit 4fc2b4ff by Andy Hutchinson Committed by Anatoly Sokolov

avr-protos.h (expand_prologue, [...]): Add declaration.

	* config/avr/avr-protos.h (expand_prologue, expand_epilogue, 
	avr_epilogue_uses) : Add declaration.
	* config/avr/predicates.md (avr_sp_immediate_operand): New predicate.
	* config/avr/constraints.md (R): New constraint.
	config/avr/avr.md (SREG_ADDR,  UNSPEC_SEI, UNSPEC_CLI, 
	UNSPECV_PROLOGUE_SAVES, UNSPECV_EPILOGUE_RESTORES): New constants.
	(*pop1, *pop2, *pop3, *pop4, *pop5): Combine into ...
	(*addhi3_sp_R_pc2, *addhi3_sp_R_pc3): ... these patterns.
	(*movhi_sp, popqi, pophi, enable_interrupt, disable_interrupt, 
	call_prologue_saves, epilogue_restores, return_from_epilogue,
	return_from_main_epilogue, return_from_interrupt_epilogue, 
	return_from_naked_epilogue, prologue, epilogue): New patterns.
	(jump): Handle symbol reference.
	* config/avr/avr.c (out_adj_frame_ptr, out_set_stack_ptr, 
	avr_output_function_prologue, avr_output_function_epilogue): Remove 
	functions.
	(avr_init_machine_status, expand_prologue, expand_epilogue, 
	avr_asm_function_end_prologue, avr_epilogue_uses, 
	avr_asm_function_begin_epilogue): New functions.
	(prologue_size, epilogue_size, jump_tables_size): Remove global 
	variables.
	(TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE): Remove.
	(TARGET_ASM_FUNCTION_END_PROLOGUE): Define.
	(TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): Define.
	(avr_override_options): Initialise init_machine_status.
	(output_movhi): Handle all stack pointer loads.
	(out_movqi_r_mr, out_movqi_mr_r): Handle SREG_ADDR address.
	(avr_output_addr_vec_elt): Do not use variable jump_tables_size.
	* config/avr/avr.h (AVR_2_BYTE_PC, AVR_3_BYTE_PC): New.
	(EPILOGUE_USES) Redefine.
	(machine_function) Declare.

Co-Authored-By: Anatoly Sokolov <aesok@dol.ru>

From-SVN: r124854
parent 6de36441
2007-05-19 Andy Hutchinson <HutchinsonAndy@netscape.net>
Anatoly Sokolov <aesok@dol.ru>
* config/avr/avr-protos.h (expand_prologue, expand_epilogue,
avr_epilogue_uses) : Add declaration.
* config/avr/predicates.md (avr_sp_immediate_operand): New predicate.
* config/avr/constraints.md (R): New constraint.
config/avr/avr.md (SREG_ADDR, UNSPEC_SEI, UNSPEC_CLI,
UNSPECV_PROLOGUE_SAVES, UNSPECV_EPILOGUE_RESTORES): New constants.
(*pop1, *pop2, *pop3, *pop4, *pop5): Combine into ...
(*addhi3_sp_R_pc2, *addhi3_sp_R_pc3): ... these patterns.
(*movhi_sp, popqi, pophi, enable_interrupt, disable_interrupt,
call_prologue_saves, epilogue_restores, return_from_epilogue,
return_from_main_epilogue, return_from_interrupt_epilogue,
return_from_naked_epilogue, prologue, epilogue): New patterns.
(jump): Handle symbol reference.
* config/avr/avr.c (out_adj_frame_ptr, out_set_stack_ptr,
avr_output_function_prologue, avr_output_function_epilogue): Remove
functions.
(avr_init_machine_status, expand_prologue, expand_epilogue,
avr_asm_function_end_prologue, avr_epilogue_uses,
avr_asm_function_begin_epilogue): New functions.
(prologue_size, epilogue_size, jump_tables_size): Remove global
variables.
(TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE): Remove.
(TARGET_ASM_FUNCTION_END_PROLOGUE): Define.
(TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): Define.
(avr_override_options): Initialise init_machine_status.
(output_movhi): Handle all stack pointer loads.
(out_movqi_r_mr, out_movqi_mr_r): Handle SREG_ADDR address.
(avr_output_addr_vec_elt): Do not use variable jump_tables_size.
* config/avr/avr.h (AVR_2_BYTE_PC, AVR_3_BYTE_PC): New.
(EPILOGUE_USES) Redefine.
(machine_function) Declare.
2007-05-19 Richard Sandiford <richard@codesourcery.com>
* config/mips/mips.c (mips_offset_within_alignment_p): Tweak comment.
......
......@@ -87,6 +87,10 @@ extern const char *lshrqi3_out (rtx insn, rtx operands[], int *len);
extern const char *lshrhi3_out (rtx insn, rtx operands[], int *len);
extern const char *lshrsi3_out (rtx insn, rtx operands[], int *len);
extern void expand_prologue (void);
extern void expand_epilogue (void);
extern int avr_epilogue_uses (int regno);
extern void avr_output_bld (rtx operands[], int bit_nr);
extern void avr_output_addr_vec_elt (FILE *stream, int value);
extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
......
......@@ -63,6 +63,9 @@ extern GTY(()) section *progmem_section;
#define AVR_HAVE_MOVW (avr_have_movw_lpmx_p)
#define AVR_HAVE_LPMX (avr_have_movw_lpmx_p)
#define AVR_2_BYTE_PC 1
#define AVR_3_BYTE_PC 0
#define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
#define OVERRIDE_OPTIONS avr_override_options ()
......@@ -338,7 +341,7 @@ extern int avr_reg_order[];
#define DEFAULT_PCC_STRUCT_RETURN 0
#define EPILOGUE_USES(REGNO) 0
#define EPILOGUE_USES(REGNO) avr_epilogue_uses(REGNO)
#define HAVE_POST_INCREMENT 1
#define HAVE_PRE_DECREMENT 1
......@@ -933,3 +936,22 @@ mmcu=*:-mmcu=%*}"
#define DWARF2_ADDR_SIZE 4
#define OBJECT_FORMAT_ELF
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
struct machine_function GTY(())
{
/* 'true' - if current function is a 'main' function. */
int is_main;
/* 'true' - if current function is a naked function. */
int is_naked;
/* 'true' - if current function is an interrupt function
as specified by the "interrupt" attribute. */
int is_interrupt;
/* 'true' - if current function is a signal function
as specified by the "signal" attribute. */
int is_signal;
};
......@@ -99,6 +99,11 @@
(and (match_code "const_double")
(match_test "op == CONST0_RTX (SFmode)")))
(define_constraint "R"
"Integer constant in the range -6 @dots{} 5."
(and (match_code "const_int")
(match_test "ival >= -6 && ival <= 5")))
(define_memory_constraint "Q"
"A memory address based on X or Y pointer with displacement."
(and (match_code "mem")
......
......@@ -78,7 +78,12 @@
(define_predicate "single_zero_operand"
(and (match_code "const_int")
(match_test "exact_log2(~INTVAL (op) & GET_MODE_MASK (mode)) >= 0")))
;;
(define_predicate "avr_sp_immediate_operand"
(and (match_code "const_int")
(match_test "INTVAL (op) >= -6 && INTVAL (op) <= 5")))
;; True for EQ & NE
(define_predicate "eqne_operator"
(match_code "eq,ne"))
......
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