avr-protos.h (avr_output_addr_vec_elt): Prototype.

* config/avr/avr-protos.h (avr_output_addr_vec_elt): Prototype.
	* config/avr/avr.c (jump_tables_size): New variable.
	(function_prologue): Initialize it as 0.
	(function_epilogue): Add it to function_size.
	(avr_output_addr_vec_elt): New function.  Count words in jump
	tables in jump_tables_size.  Move code ...
	* config/avr/avr.h (ASM_OUTPUT_ADDR_VEC_ELT): ... from here.
	Call avr_output_addr_vec_elt instead.
	* config/avr/avr.md (tablejump): Remove disabled define_expand.

From-SVN: r37557
This commit is contained in:
Marek Michalkiewicz 2000-11-19 08:10:54 +01:00 committed by Denis Chertykov
parent 67c72a6308
commit e9284adfd0
5 changed files with 32 additions and 11 deletions

View File

@ -1,3 +1,15 @@
2000-11-18 Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/avr-protos.h (avr_output_addr_vec_elt): Prototype.
* config/avr/avr.c (jump_tables_size): New variable.
(function_prologue): Initialize it as 0.
(function_epilogue): Add it to function_size.
(avr_output_addr_vec_elt): New function. Count words in jump
tables in jump_tables_size. Move code ...
* config/avr/avr.h (ASM_OUTPUT_ADDR_VEC_ELT): ... from here.
Call avr_output_addr_vec_elt instead.
* config/avr/avr.md (tablejump): Remove disabled define_expand.
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* configure.in: Make --enable-new-gxx-abi the default.

View File

@ -110,6 +110,7 @@ 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 void avr_output_bld PARAMS ((rtx operands[], int bit_nr));
extern void avr_output_addr_vec_elt PARAMS ((FILE *stream, int value));
extern enum reg_class preferred_reload_class PARAMS ((rtx x,
enum reg_class class));

View File

@ -88,6 +88,9 @@ static int commands_in_epilogues;
static int prologue_size;
static int epilogue_size;
/* Size of all jump tables in the current function, in words. */
static int jump_tables_size;
/* Initial stack value specified by the `-minit-stack=' option */
const char *avr_init_stack = "__stack";
@ -549,6 +552,7 @@ function_prologue (file, size)
&& !interrupt_func_p && !signal_func_p && live_seq);
last_insn_address = 0;
jump_tables_size = 0;
prologue_size = 0;
fprintf (file, "/* prologue: frame size=%d */\n", size);
@ -683,6 +687,7 @@ function_epilogue (file, size)
main_p = MAIN_NAME_P (DECL_NAME (current_function_decl));
function_size = (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
- INSN_ADDRESSES (INSN_UID (get_insns ())));
function_size += jump_tables_size;
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
&& !interrupt_func_p && !signal_func_p && live_seq);
@ -5296,3 +5301,16 @@ avr_output_bld (operands, bit_nr)
output_asm_insn (s, operands);
}
void
avr_output_addr_vec_elt (stream, value)
FILE *stream;
int value;
{
if (AVR_MEGA)
fprintf (stream, "\t.word pm(.L%d)\n", value);
else
fprintf (stream, "\trjmp .L%d\n", value);
jump_tables_size++;
}

View File

@ -2713,12 +2713,7 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
not be optimal, since this macro is used only when profiling. */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
do { \
if (AVR_MEGA) \
fprintf (STREAM, "\t.word pm(.L%d)\n", VALUE); \
else \
fprintf (STREAM, "\trjmp .L%d\n", VALUE); \
} while (0)
avr_output_addr_vec_elt(STREAM, VALUE)
/* This macro should be provided on machines where the addresses in a
dispatch table are absolute.

View File

@ -1849,11 +1849,6 @@
(set_attr "cc" "none,none")])
;; table jump
(define_expand "tablejump"
[(parallel [(set (pc) (match_operand:HI 0 "register_operand" ""))
(use (label_ref (match_operand 1 "" "")))])]
"0 && optimize"
"")
;; Note: the (mem:HI (...)) memory references here are special - actually
;; the data is read from a word address in program memory (r31:r30 is the