]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
avr.h (ASSEMBLER_DIALECT): New macro declared.
authorDenis Chertykov <denisc@overta.ru>
Wed, 13 Sep 2000 18:13:49 +0000 (18:13 +0000)
committerDenis Chertykov <denisc@gcc.gnu.org>
Wed, 13 Sep 2000 18:13:49 +0000 (22:13 +0400)
* config/avr/avr.h (ASSEMBLER_DIALECT): New macro declared.
* config/avr/avr.md (*movstrqi_insn): Cleanup output template.
(*clrstrqi): Likewise.
(xorhi3,xorsi3,absqi2): Likewise.
(one_cmplhi2,one_cmplsi2): Likewise.
(addsi3): Two stupid constraint alternatives removed.
(extendhisi2): Use `movw' for enhanced avr cores.
(zero_extendhisi2): Likewise.

From-SVN: r36390

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

index 15f235d404aa41a976e75d5d3767671cd7988405..ef68665074b4682968342ba77acf63ad5da63c3c 100644 (file)
@@ -1,3 +1,14 @@
+Tue Sep 12 13:51:13 2000  Denis Chertykov  <denisc@overta.ru>
+
+       * config/avr/avr.h (ASSEMBLER_DIALECT): New macro declared.
+       * config/avr/avr.md (*movstrqi_insn): Cleanup output template.
+       (*clrstrqi): Likewise.
+       (xorhi3,xorsi3,absqi2): Likewise.
+       (one_cmplhi2,one_cmplsi2): Likewise.
+       (addsi3): Two stupid constraint alternatives removed.
+       (extendhisi2): Use `movw' for enhanced avr cores.
+       (zero_extendhisi2): Likewise.
+
 Wed Sep 13 02:31:23 EDT 2000  John Wehle  (john@feith.com)
 
        * alias.c (find_base_term): Use frame_pointer_rtx
index 8193d237145687d3672df87676ea35c9acad4f15..6c34cf323b7692240d72f936b0d4d3c36355c07b 100644 (file)
@@ -42,8 +42,6 @@ extern int    mask_one_bit_p              PARAMS ((HOST_WIDE_INT mask));
 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));
-
-
 #ifdef TREE_CODE
 extern void   asm_output_external          PARAMS ((FILE *file, tree decl,
                                                   char *name));
index 6f2ba181a4812faf2f831238c350ec874e028ae2..fca29f9ed53cf9a5febc36d2ff5750551c09fe81 100644 (file)
@@ -4666,5 +4666,3 @@ output_reload_insisf (insn, operands, len)
     }
   return "";
 }
-
-
index 18f84f3c1d37550c1789a381056f96056f19917e..48fea8bd678c5d4225f8be572b68812419218bb4 100644 (file)
@@ -2656,6 +2656,31 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
    formats.  In that case, the various `tm.h' files can define these
    macros differently.  */
 
+#define ASSEMBLER_DIALECT AVR_ENHANCED
+/* If your target supports multiple dialects of assembler language
+  (such as different opcodes), define this macro as a C expression
+  that gives the numeric index of the assembler language dialect to
+  use, with zero as the first variant.
+
+  If this macro is defined, you may use constructs of the form
+  `{option0|option1|option2...}' in the output templates of patterns
+  (*note Output Template::.) or in the first argument of
+  `asm_fprintf'.  This construct outputs `option0', `option1' or
+  `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
+  or two, etc.  Any special characters within these strings retain
+  their usual meaning.
+
+  If you do not define this macro, the characters `{', `|' and `}'
+  do not have any special meaning when used in templates or operands
+  to `asm_fprintf'.
+
+  Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
+  `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
+  variations in assembler language syntax with that mechanism.
+  Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax
+  if the syntax variant are larger and involve such things as
+  different opcodes or operand order.  */
+
 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO)     \
 {                                              \
   if (REGNO > 31)                              \
index ba456ff0706d61addc16d0aef15009f7ae43c72f..fbd00a56ef8d1474f8e5056863d1f6589dfab023 100644 (file)
    (clobber (match_dup 0))
    (clobber (match_dup 1))]
   ""
-  "
-       ld __tmp_reg__,%a1+
+  "ld __tmp_reg__,%a1+
        st %a0+,__tmp_reg__
        dec %2
        brne _PC_-8"
    (clobber (match_dup 1))
    (clobber (match_dup 0))]
   ""
-  "
-       st %a0+,__zero_reg__
+  "st %a0+,__zero_reg__
         dec %1
        brne _PC_-6"
   [(set_attr "length" "3")
   [(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")
+  [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r")
          (plus:SI
-          (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r")
-          (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N,#I,#J")))]
+          (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
+          (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N")))]
   ""
   "@
        add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2
        sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__
        subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2))
        sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__
-       sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__
-       mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__
-       mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
-  [(set_attr "length" "4,3,3,4,5,5,7,7")
-   (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n,set_n,set_czn")])
+       sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
+  [(set_attr "length" "4,3,3,4,5,5")
+   (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n")])
 
 ;-----------------------------------------------------------------------------
 ; sub bytes
         (xor:HI (match_operand:HI 1 "register_operand" "%0")
                 (match_operand:HI 2 "register_operand" "r")))]
   ""
-  "eor %0,%2\;eor %B0,%B2"
+  "eor %0,%2
+       eor %B0,%B2"
   [(set_attr "length" "2")
    (set_attr "cc" "set_n")])
 
   [(set (match_operand:QI 0 "register_operand" "=r")
         (abs:QI (match_operand:QI 1 "register_operand" "0")))]
   ""
-  "sbrc %0,7\;neg %0"
+  "sbrc %0,7
+       neg %0"
   [(set_attr "length" "2")
    (set_attr "cc" "clobber")])
 
   [(set (match_operand:HI 0 "register_operand" "=r")
         (not:HI (match_operand:HI 1 "register_operand" "0")))]
   ""
-  "com %0\;com %B0"
+  "com %0
+       com %B0"
   [(set_attr "length" "2")
    (set_attr "cc" "set_n")])
 
   [(set (match_operand:SI 0 "register_operand" "=r")
         (not:SI (match_operand:SI 1 "register_operand" "0")))]
   ""
-  "com %0\;com %B0\;com %C0\;com %D0"
+  "com %0
+       com %B0
+       com %C0
+       com %D0"
   [(set_attr "length" "4")
    (set_attr "cc" "set_n")])
 
   [(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")))]
   ""
   "@
        clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0
-       mov %A0,%A1\;mov %B0,%B1\;clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0"
-  [(set_attr "length" "4,6")
+       {mov %A0,%A1\;mov %B0,%B1|movw %A0,%A1}\;clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0"
+  [(set (attr "length")
+       (if_then_else
+        (eq (symbol_ref "AVR_ENHANCED") (const_int 0))
+        (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
+                      (const_int 4)
+                      (const_int 6))
+        (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
+                      (const_int 4)
+                      (const_int 5))))
    (set_attr "cc" "clobber,clobber")])
 
 ;; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x
   [(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")))]
   ""
   "@
        clr %C0\;clr %D0
-       mov %A0,%A1\;mov %B0,%B1\;clr %C0\;clr %D0"
-  [(set_attr "length" "2,4")
+       {mov %A0,%A1\;mov %B0,%B1|movw %A0,%B0}\;clr %C0\;clr %D0"
+  [(set (attr "length")
+       (if_then_else
+        (eq (symbol_ref "AVR_ENHANCED") (const_int 0))
+        (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
+                      (const_int 2)
+                      (const_int 4))
+        (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
+                      (const_int 2)
+                      (const_int 3))))
    (set_attr "cc" "set_n,set_n")])
 
 ;;<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=>