* 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
+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.
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));
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";
&& !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);
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);
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++;
+}
+
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.
(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