]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
avr-protos.h (avr_output_addr_vec_elt): Prototype.
authorMarek Michalkiewicz <marekm@linux.org.pl>
Sun, 19 Nov 2000 07:10:54 +0000 (08:10 +0100)
committerDenis Chertykov <denisc@gcc.gnu.org>
Sun, 19 Nov 2000 07:10:54 +0000 (10:10 +0300)
* 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

gcc/ChangeLog
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.h
gcc/config/avr/avr.md

index fc844b829b0d02b57cc5a870fb4402e79ac598f7..59c5f77e761c8d06de78cf6182249c4a9a90fc90 100644 (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.
index 14d34d18d61c12f69130592b0a62d10bf0d18c3b..4fa887a5fd46f4c0699eba79b078c0b93cba0a9b 100644 (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));
index 38cd07819e153f77bdabd71bbd56dec0d8946680..9427de765197ff08a86d5cd97e9fd1a684111514 100644 (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++;
+}
+
index f5116a92a1750e67153d11ed12f90bd518a847c0..897dffee26757f818cca0da252f84b87b440a541 100644 (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.
 
index 325a545fcd87c43a1a554504a7fd1096bd20d25a..57972e6156613fb7963ae112e7e170ffd6f3fbfe 100644 (file)
    (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