avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] gcc 3.0.4/binutuils 2.11.2 patches for ATmega128


From: Peter Jansen
Subject: [avr-gcc-list] gcc 3.0.4/binutuils 2.11.2 patches for ATmega128
Date: Thu, 07 Mar 2002 10:30:29 +1100

Hi All,

Attached are patches for binutils, gcc, avr-libc for ATmega128 support.
These are for gcc-3.0.4, binutils-2.11.2 and avr-libc
20020203.

to use these get the binutils 2.11.2 and gcc 3.0.4 source package,

untar the sources,apply the patches, configure the packages, make the
package and install them.

eg. (this puts the build files in a different directory)

tar xvzf binutils-2.11.2
cd binutils-2.11.2
patch -p1 < binutils-2.11.2-patch128
cd ..
mkdir build-binutils
cd build-binutils
../binutils-2.11.2/configure --target=avr 
(lots of output)
make
(lots of output)
make install (as root)
(lots more output)

tar xvzf gcc-3.0.4
cd gcc-3.0.4
patch -p1 < gcc-3.0.4-patch128
cd ..
mkdir build-gcc
cd build-gcc
../gcc/configure --target=avr --enable-languages=c
(lots of output)
make
(lots of output)
make install (as root)
(lots more output)

you may want avr-libc also configure and make this as per its
instructions.

Thanks to Theodore A. Roth <address@hidden> for helping check some of
these patches.


-- 
Peter Jansen
Smart Container
Level 1, NIC Building
Eveleigh
NSW       1430
AUSTRALIA
diff -urN binutils-2.11.2/bfd/po/BLD-POTFILES.in 
binutils-2.11.2-patch128/bfd/po/BLD-POTFILES.in
--- binutils-2.11.2/bfd/po/BLD-POTFILES.in      Thu Jan  1 10:00:00 1970
+++ binutils-2.11.2-patch128/bfd/po/BLD-POTFILES.in     Tue Feb 26 15:50:12 2002
@@ -0,0 +1,7 @@
+elf32-ia64.c
+elf32-target.h
+elf64-ia64.c
+elf64-target.h
+peigen.c
+pepigen.c
+targmatch.h
diff -urN binutils-2.11.2/bfd/po/SRC-POTFILES.in 
binutils-2.11.2-patch128/bfd/po/SRC-POTFILES.in
--- binutils-2.11.2/bfd/po/SRC-POTFILES.in      Thu Jan  1 10:00:00 1970
+++ binutils-2.11.2-patch128/bfd/po/SRC-POTFILES.in     Tue Feb 26 15:50:12 2002
@@ -0,0 +1,254 @@
+aix386-core.c
+aout0.c
+aout32.c
+aout64.c
+aout-adobe.c
+aout-arm.c
+aout-cris.c
+aoutf1.h
+aout-ns32k.c
+aout-sparcle.c
+aout-target.h
+aout-tic30.c
+aoutx.h
+archive.c
+archures.c
+armnetbsd.c
+bfd.c
+binary.c
+bout.c
+cache.c
+cf-i386lynx.c
+cf-m68klynx.c
+cf-sparclynx.c
+cisco-core.c
+coff64-rs6000.c
+coff-a29k.c
+coff-alpha.c
+coff-apollo.c
+coff-arm.c
+coff-aux.c
+coffcode.h
+coffgen.c
+coff-go32.c
+coff-h8300.c
+coff-h8500.c
+coff-i386.c
+coff-i860.c
+coff-i960.c
+cofflink.c
+coff-m68k.c
+coff-m88k.c
+coff-mips.c
+coff-pmac.c
+coff-rs6000.c
+coff-sh.c
+coff-sparc.c
+coff-stgo32.c
+coff-svm68k.c
+coffswap.h
+coff-tic30.c
+coff-tic54x.c
+coff-tic80.c
+coff-u68k.c
+coff-w65.c
+coff-we32k.c
+coff-z8k.c
+corefile.c
+cpu-a29k.c
+cpu-alpha.c
+cpu-arc.c
+cpu-arm.c
+cpu-avr.c
+cpu-cris.c
+cpu-d10v.c
+cpu-d30v.c
+cpu-fr30.c
+cpu-h8300.c
+cpu-h8500.c
+cpu-hppa.c
+cpu-i370.c
+cpu-i386.c
+cpu-i860.c
+cpu-i960.c
+cpu-ia64.c
+cpu-m10200.c
+cpu-m10300.c
+cpu-m32r.c
+cpu-m68hc11.c
+cpu-m68hc12.c
+cpu-m68k.c
+cpu-m88k.c
+cpu-mcore.c
+cpu-mips.c
+cpu-ns32k.c
+cpu-pj.c
+cpu-powerpc.c
+cpu-rs6000.c
+cpu-sh.c
+cpu-sparc.c
+cpu-tic30.c
+cpu-tic54x.c
+cpu-tic80.c
+cpu-v850.c
+cpu-vax.c
+cpu-w65.c
+cpu-we32k.c
+cpu-z8k.c
+demo64.c
+dwarf1.c
+dwarf2.c
+ecoff.c
+ecofflink.c
+ecoffswap.h
+efi-app-ia32.c
+efi-app-ia64.c
+elf32-arc.c
+elf32-arm.h
+elf32-avr.c
+elf32.c
+elf32-cris.c
+elf32-d10v.c
+elf32-d30v.c
+elf32-fr30.c
+elf32-gen.c
+elf32-hppa.c
+elf32-hppa.h
+elf32-i370.c
+elf32-i386.c
+elf32-i860.c
+elf32-i960.c
+elf32-m32r.c
+elf32-m68hc11.c
+elf32-m68hc12.c
+elf32-m68k.c
+elf32-m88k.c
+elf32-mcore.c
+elf32-mips.c
+elf32-pj.c
+elf32-ppc.c
+elf32-sh.c
+elf32-sh-lin.c
+elf32-sparc.c
+elf32-v850.c
+elf64-alpha.c
+elf64.c
+elf64-gen.c
+elf64-hppa.c
+elf64-hppa.h
+elf64-mips.c
+elf64-sparc.c
+elf64-x86-64.c
+elfarm-nabi.c
+elfarm-oabi.c
+elf-bfd.h
+elf.c
+elfcode.h
+elfcore.h
+elf-hppa.h
+elflink.c
+elflink.h
+elf-m10200.c
+elf-m10300.c
+epoc-pe-arm.c
+epoc-pei-arm.c
+format.c
+freebsd.h
+genlink.h
+go32stub.h
+hash.c
+hp300bsd.c
+hp300hpux.c
+hpux-core.c
+i386aout.c
+i386bsd.c
+i386dynix.c
+i386freebsd.c
+i386linux.c
+i386lynx.c
+i386mach3.c
+i386msdos.c
+i386netbsd.c
+i386os9k.c
+ieee.c
+ihex.c
+init.c
+irix-core.c
+libaout.h
+libbfd.c
+libbfd.h
+libcoff.h
+libecoff.h
+libhppa.h
+libieee.h
+libnlm.h
+liboasys.h
+libpei.h
+linker.c
+lynx-core.c
+m68k4knetbsd.c
+m68klinux.c
+m68klynx.c
+m68knetbsd.c
+m88kmach3.c
+mipsbsd.c
+netbsd.h
+newsos3.c
+nlm32-alpha.c
+nlm32.c
+nlm32-i386.c
+nlm32-ppc.c
+nlm32-sparc.c
+nlm64.c
+nlm.c
+nlmcode.h
+nlmswap.h
+nlm-target.h
+ns32k.h
+ns32knetbsd.c
+oasys.c
+opncls.c
+osf-core.c
+pc532-mach.c
+pe-arm.c
+pe-i386.c
+pei-arm.c
+peicode.h
+pei-i386.c
+pei-mcore.c
+pei-mips.c
+pei-ppc.c
+pei-sh.c
+pe-mcore.c
+pe-mips.c
+pe-ppc.c
+pe-sh.c
+ppcboot.c
+reloc16.c
+reloc.c
+riscix.c
+sco5-core.c
+section.c
+som.c
+som.h
+sparclinux.c
+sparclynx.c
+sparcnetbsd.c
+srec.c
+stabs.c
+stab-syms.c
+sunos.c
+syms.c
+targets.c
+tekhex.c
+trad-core.c
+vaxnetbsd.c
+versados.c
+vms.c
+vms-gsd.c
+vms.h
+vms-hdr.c
+vms-misc.c
+vms-tir.c
+xcofflink.c
+xcoff-target.h
diff -urN binutils-2.11.2/gas/config/tc-avr.c 
binutils-2.11.2-patch128/gas/config/tc-avr.c
--- binutils-2.11.2/gas/config/tc-avr.c Thu Jun  7 13:15:28 2001
+++ binutils-2.11.2-patch128/gas/config/tc-avr.c        Tue Feb 26 15:34:01 2002
@@ -87,6 +87,7 @@
   {"atmega163", AVR_ISA_M161,     bfd_mach_avr5},
   {"atmega32",  AVR_ISA_M161,     bfd_mach_avr5},
   {"at94k",     AVR_ISA_94K,      bfd_mach_avr5},
+  {"atmega128", AVR_ISA_M128,     bfd_mach_avr5},
   {NULL, 0, 0}
 };
 
@@ -258,7 +259,7 @@
        "                   avr2 - AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22\n"
        "                   avr3 - ATmega103, ATmega603\n"
        "                   avr4 - ATmega83, ATmega85\n"
-       "                   avr5 - ATmega161, ATmega163, ATmega32, AT94K\n"
+       "                   avr5 - ATmega161, ATmega163, ATmega32, AT94K, 
ATmega128\n"
        "                   or immediate microcontroller name.\n"));
   fprintf (stream,
       _("  -mall-opcodes    accept all AVR opcodes, even if not supported by 
MCU\n"
diff -urN binutils-2.11.2/include/opcode/avr.h 
binutils-2.11.2-patch128/include/opcode/avr.h
--- binutils-2.11.2/include/opcode/avr.h        Mon Aug  7 00:09:14 2000
+++ binutils-2.11.2-patch128/include/opcode/avr.h       Wed Feb 27 13:17:52 2002
@@ -35,6 +35,7 @@
 #define AVR_ISA_M603 (AVR_ISA_2xxx | AVR_ISA_MEGA)
 #define AVR_ISA_M103 (AVR_ISA_M603 | AVR_ISA_ELPM)
 #define AVR_ISA_M161 (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_LPMX | AVR_ISA_SPM)
+#define AVR_ISA_M128 (AVR_ISA_M161 | AVR_ISA_ELPMX )
 #define AVR_ISA_94K  (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_LPMX)
 
 #define AVR_ISA_ALL   0xFFFF
diff -urN binutils-2.11.2/ld/Makefile.am binutils-2.11.2-patch128/ld/Makefile.am
--- binutils-2.11.2/ld/Makefile.am      Mon Jun 11 20:05:07 2001
+++ binutils-2.11.2-patch128/ld/Makefile.am     Tue Feb 26 15:34:01 2002
@@ -119,6 +119,7 @@
        eavr44x4.o \
        eavr85xx.o \
        eavrmega103.o \
+       eavrmega128.o \
        eavrmega161.o \
        eavrmega603.o \
        ecoff_sparc.o \
@@ -380,6 +381,10 @@
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
+eavrmega128.c: $(srcdir)/emulparams/avrmega128.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} avrmega128 "$(tdir_avr85xx)"
 eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
   ${GEN_DEPENDS}
diff -urN binutils-2.11.2/ld/Makefile.in binutils-2.11.2-patch128/ld/Makefile.in
--- binutils-2.11.2/ld/Makefile.in      Mon Jun 11 20:05:07 2001
+++ binutils-2.11.2-patch128/ld/Makefile.in     Tue Feb 26 15:34:01 2002
@@ -227,6 +227,7 @@
        eavr44x4.o \
        eavr85xx.o \
        eavrmega103.o \
+       eavrmega128.o \
        eavrmega161.o \
        eavrmega603.o \
        ecoff_sparc.o \
@@ -1094,6 +1095,10 @@
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
+eavrmega128.c: $(srcdir)/emulparams/avrmega128.sh \
+  $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} avrmega128 "$(tdir_avr85xx)"
 eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
   ${GEN_DEPENDS}
diff -urN binutils-2.11.2/ld/configure.tgt 
binutils-2.11.2-patch128/ld/configure.tgt
--- binutils-2.11.2/ld/configure.tgt    Mon Jun 11 20:05:08 2001
+++ binutils-2.11.2-patch128/ld/configure.tgt   Tue Feb 26 15:34:01 2002
@@ -22,7 +22,7 @@
                        targ_extra_ofiles="deffilep.o pe-dll.o" ;;
 arc-*-elf*)            targ_emul=arcelf ;;
 avr-*-*)               targ_emul=avr85xx
-                       targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 
avrmega603 avrmega103 avrmega161" ;;
+                       targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 
avrmega603 avrmega103 avrmega128 avrmega161" ;;
 cris-*-*aout*)         targ_emul=crisaout
                        targ_extra_emuls="criself crislinux"
                        targ_extra_libpath=$targ_extra_emuls ;;
diff -urN binutils-2.11.2/ld/emulparams/avr1200.sh 
binutils-2.11.2-patch128/ld/emulparams/avr1200.sh
--- binutils-2.11.2/ld/emulparams/avr1200.sh    Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avr1200.sh   Tue Feb 26 15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=1K
+DATA_START=0x60
 DATA_LENGTH=0
 EEPROM_LENGTH=64
 STACK=0
diff -urN binutils-2.11.2/ld/emulparams/avr23xx.sh 
binutils-2.11.2-patch128/ld/emulparams/avr23xx.sh
--- binutils-2.11.2/ld/emulparams/avr23xx.sh    Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avr23xx.sh   Tue Feb 26 15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=2K
+DATA_START=0x60
 DATA_LENGTH=128
 EEPROM_LENGTH=128
 STACK=0x0DF
diff -urN binutils-2.11.2/ld/emulparams/avr4433.sh 
binutils-2.11.2-patch128/ld/emulparams/avr4433.sh
--- binutils-2.11.2/ld/emulparams/avr4433.sh    Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avr4433.sh   Tue Feb 26 15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=4K
+DATA_START=0x60
 DATA_LENGTH=128
 EEPROM_LENGTH=256
 STACK=0x0DF
diff -urN binutils-2.11.2/ld/emulparams/avr44x4.sh 
binutils-2.11.2-patch128/ld/emulparams/avr44x4.sh
--- binutils-2.11.2/ld/emulparams/avr44x4.sh    Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avr44x4.sh   Tue Feb 26 15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=4K
+DATA_START=0x60
 DATA_LENGTH=256
 EEPROM_LENGTH=256
 STACK=0x15F
diff -urN binutils-2.11.2/ld/emulparams/avr85xx.sh 
binutils-2.11.2-patch128/ld/emulparams/avr85xx.sh
--- binutils-2.11.2/ld/emulparams/avr85xx.sh    Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avr85xx.sh   Tue Feb 26 15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=8K
+DATA_START=0x60
 DATA_LENGTH=512
 EEPROM_LENGTH=512
 STACK=0x25F
diff -urN binutils-2.11.2/ld/emulparams/avrmega103.sh 
binutils-2.11.2-patch128/ld/emulparams/avrmega103.sh
--- binutils-2.11.2/ld/emulparams/avrmega103.sh Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avrmega103.sh        Tue Feb 26 
15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=128K
+DATA_START=0x60
 DATA_LENGTH=4000
 EEPROM_LENGTH=4K
 STACK=0x0FFF
diff -urN binutils-2.11.2/ld/emulparams/avrmega128.sh 
binutils-2.11.2-patch128/ld/emulparams/avrmega128.sh
--- binutils-2.11.2/ld/emulparams/avrmega128.sh Thu Jan  1 10:00:00 1970
+++ binutils-2.11.2-patch128/ld/emulparams/avrmega128.sh        Tue Feb 26 
15:34:01 2002
@@ -0,0 +1,13 @@
+ARCH=avr:5
+MACHINE=
+SCRIPT_NAME=elf32avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=128K
+DATA_START=0x100
+DATA_LENGTH=4096
+EEPROM_LENGTH=4K
+STACK=0x10FF
diff -urN binutils-2.11.2/ld/emulparams/avrmega161.sh 
binutils-2.11.2-patch128/ld/emulparams/avrmega161.sh
--- binutils-2.11.2/ld/emulparams/avrmega161.sh Tue Jun 27 11:45:30 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avrmega161.sh        Tue Feb 26 
15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=16K
+DATA_START=0x60
 DATA_LENGTH=1K
 EEPROM_LENGTH=512
 STACK=0x45F
diff -urN binutils-2.11.2/ld/emulparams/avrmega603.sh 
binutils-2.11.2-patch128/ld/emulparams/avrmega603.sh
--- binutils-2.11.2/ld/emulparams/avrmega603.sh Sun May 28 01:36:58 2000
+++ binutils-2.11.2-patch128/ld/emulparams/avrmega603.sh        Tue Feb 26 
15:34:01 2002
@@ -7,6 +7,7 @@
 TEMPLATE_NAME=generic
 
 TEXT_LENGTH=64K
+DATA_START=0x60
 DATA_LENGTH=4000
 EEPROM_LENGTH=2K
 STACK=0x0FFF
diff -urN binutils-2.11.2/ld/scripttempl/elf32avr.sc 
binutils-2.11.2-patch128/ld/scripttempl/elf32avr.sc
--- binutils-2.11.2/ld/scripttempl/elf32avr.sc  Tue Nov 14 09:26:38 2000
+++ binutils-2.11.2-patch128/ld/scripttempl/elf32avr.sc Wed Feb 27 13:19:58 2002
@@ -5,7 +5,7 @@
 MEMORY
 {
   text   (rx)   : ORIGIN = 0,    LENGTH = $TEXT_LENGTH
-  data   (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH
+  data   (rw!x) : ORIGIN = (0x800000 + $DATA_START), LENGTH = $DATA_LENGTH
   eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = $EEPROM_LENGTH
 }
 
diff -c3rp gcc-3.0.4/gcc/config/avr/avr.c 
gcc-3.0.4-patch128/gcc/config/avr/avr.c
*** gcc-3.0.4/gcc/config/avr/avr.c      Thu Jun 28 07:35:37 2001
--- gcc-3.0.4-patch128/gcc/config/avr/avr.c     Wed Feb 27 12:40:26 2002
*************** static const struct mcu_type_s avr_mcu_t
*** 153,158 ****
--- 153,159 ----
    { "atmega163", AVR5 },
    { "atmega32",  AVR5 },
    { "at94k",     AVR5 },
+   { "atmega128", AVR5 },
      /* Assembler only.  */
    { "avr1",      AVR1 },
    { "at90s1200", AVR1 },
*************** class_max_nregs (class, mode)
*** 1164,1170 ****
  /* Choose mode for jump insn:
     1 - relative jump in range -63 <= x <= 62 ;
     2 - relative jump in range -2046 <= x <= 2045 ;
!    3 - absolute jump (only for ATmega[16]03).  */
  
  int
  avr_jump_mode (x, insn)
--- 1165,1171 ----
  /* Choose mode for jump insn:
     1 - relative jump in range -63 <= x <= 62 ;
     2 - relative jump in range -2046 <= x <= 2045 ;
!    3 - absolute jump (only for ATmega1[6][03][28]).  */
  
  int
  avr_jump_mode (x, insn)
diff -c3rp gcc-3.0.4/gcc/config/avr/avr.h 
gcc-3.0.4-patch128/gcc/config/avr/avr.h
*** gcc-3.0.4/gcc/config/avr/avr.h      Tue Apr 17 04:25:42 2001
--- gcc-3.0.4-patch128/gcc/config/avr/avr.h     Wed Feb 27 12:40:26 2002
*************** valid_machine_decl_attribute (DECL, ATTR
*** 2973,2978 ****
--- 2973,2979 ----
  %{mmcu=avr3:%(cpp_avr3)} \
  %{mmcu=atmega603:%(cpp_avr3) -D__AVR_ATmega603__} \
  %{mmcu=atmega103:%(cpp_avr3) -D__AVR_ATmega103__} \
+ %{mmcu=atmega128:%(cpp_avr5) -D__AVR_ATmega128__} \
  %{mmcu=avr4:%(cpp_avr4)} \
  %{mmcu=atmega83: %(cpp_avr4) -D__AVR_ATmega83__} \
  %{mmcu=atmega85: %(cpp_avr4) -D__AVR_ATmega85__} \
*************** valid_machine_decl_attribute (DECL, ATTR
*** 3051,3056 ****
--- 3052,3058 ----
  %{!mmcu*:-m avr85xx} \
  %{mmcu=atmega603:-m avrmega603} \
  %{mmcu=atmega103:-m avrmega103} \
+ %{mmcu=atmega128:-m avrmega128} \
  %{mmcu=atmega161:-m avrmega161} \
  %{mmcu=atmega163:-m avrmega161} \
  %{mmcu=atmega32:-m avr5} \
*************** valid_machine_decl_attribute (DECL, ATTR
*** 3130,3135 ****
--- 3132,3138 ----
  %{mmcu=at90c8534:crtc8534.o%s} \
  %{mmcu=at90s8535:crts8535.o%s} \
  %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
+ %{mmcu=atmega128|mmcu=avr5:crtm128.o%s} \
  %{mmcu=atmega603:crtm603.o%s} \
  %{mmcu=atmega83|mmcu=avr4:crtm83.o%s} \
  %{mmcu=atmega85:crtm85.o%s} \
diff -c3rp gcc-3.0.4/gcc/config/avr/libgcc.S 
gcc-3.0.4-patch128/gcc/config/avr/libgcc.S
*** gcc-3.0.4/gcc/config/avr/libgcc.S   Sun Apr  1 02:36:08 2001
--- gcc-3.0.4-patch128/gcc/config/avr/libgcc.S  Wed Feb 27 12:40:26 2002
*************** __mulqi3_loop:
*** 75,90 ****
        add     r_res,r_arg2
        add     r_arg2,r_arg2   ; shift multiplicand
        breq    __mulqi3_exit   ; while multiplicand != 0
!       lsr     r_arg1          ; 
        brne    __mulqi3_loop   ; exit if multiplier = 0
! __mulqi3_exit:        
        mov     r_arg1,r_res    ; result to return register
        ret
  
! #undef r_arg2  
! #undef r_arg1  
! #undef r_res   
!       
  .endfunc
  #endif        /* defined (L_mulqi3) */
  
--- 76,91 ----
        add     r_res,r_arg2
        add     r_arg2,r_arg2   ; shift multiplicand
        breq    __mulqi3_exit   ; while multiplicand != 0
!       lsr     r_arg1          ;
        brne    __mulqi3_loop   ; exit if multiplier = 0
! __mulqi3_exit:
        mov     r_arg1,r_res    ; result to return register
        ret
  
! #undef r_arg2
! #undef r_arg1
! #undef r_res
! 
  .endfunc
  #endif        /* defined (L_mulqi3) */
  
*************** __mulhi3_loop:
*** 133,139 ****
        rjmp    __mulhi3_skip1
        add     r_resL,r_arg2L  ; result + multiplicand
        adc     r_resH,r_arg2H
! __mulhi3_skip1:       
        add     r_arg2L,r_arg2L ; shift multiplicand
        adc     r_arg2H,r_arg2H
  
--- 134,140 ----
        rjmp    __mulhi3_skip1
        add     r_resL,r_arg2L  ; result + multiplicand
        adc     r_resH,r_arg2H
! __mulhi3_skip1:
        add     r_arg2L,r_arg2L ; shift multiplicand
        adc     r_arg2H,r_arg2H
  
*************** __mulhi3_exit:
*** 154,161 ****
  #undef r_arg1H
  #undef r_arg2L
  #undef r_arg2H
! #undef r_resL         
! #undef r_resH 
  
  .endfunc
  #endif /* defined (L_mulhi3) */
--- 155,162 ----
  #undef r_arg1H
  #undef r_arg2L
  #undef r_arg2H
! #undef r_resL
! #undef r_resH
  
  .endfunc
  #endif /* defined (L_mulhi3) */
*************** __umulhisi3:
*** 204,219 ****
  
  
  #define       r_arg2L  r18            /* multiplicand Low */
! #define       r_arg2H  r19    
  #define       r_arg2HL r20
  #define       r_arg2HH r21            /* multiplicand High */
!       
  #define r_resL         r26            /* result Low */
  #define r_resH   r27
  #define r_resHL        r30
  #define r_resHH  r31          /* result High */
  
!       
        .global __mulsi3
        .func   __mulsi3
  __mulsi3:
--- 205,220 ----
  
  
  #define       r_arg2L  r18            /* multiplicand Low */
! #define       r_arg2H  r19
  #define       r_arg2HL r20
  #define       r_arg2HH r21            /* multiplicand High */
! 
  #define r_resL         r26            /* result Low */
  #define r_resH   r27
  #define r_resHL        r30
  #define r_resHH  r31          /* result High */
  
! 
        .global __mulsi3
        .func   __mulsi3
  __mulsi3:
*************** __mulsi3_skip1:
*** 266,272 ****
        adc     r_arg2H,r_arg2H
        adc     r_arg2HL,r_arg2HL
        adc     r_arg2HH,r_arg2HH
!       
        lsr     r_arg1HH        ; gets LSB of multiplier
        ror     r_arg1HL
        ror     r_arg1H
--- 267,273 ----
        adc     r_arg2H,r_arg2H
        adc     r_arg2HL,r_arg2HL
        adc     r_arg2HH,r_arg2HH
! 
        lsr     r_arg1HH        ; gets LSB of multiplier
        ror     r_arg1HL
        ror     r_arg1H
*************** __mulsi3_exit:
*** 282,306 ****
        mov     r_arg1L,r_resL
        ret
  #endif /* !defined (__AVR_ENHANCED__) */
! #undef r_arg1L 
! #undef r_arg1H 
  #undef r_arg1HL
  #undef r_arg1HH
!              
!              
! #undef r_arg2L 
! #undef r_arg2H 
  #undef r_arg2HL
  #undef r_arg2HH
!              
! #undef r_resL  
! #undef r_resH  
! #undef r_resHL 
! #undef r_resHH 
  
  .endfunc
  #endif /* defined (L_mulsi3) */
!       
  /*******************************************************
         Division 8 / 8 => (result + remainder)
  *******************************************************/
--- 283,307 ----
        mov     r_arg1L,r_resL
        ret
  #endif /* !defined (__AVR_ENHANCED__) */
! #undef r_arg1L
! #undef r_arg1H
  #undef r_arg1HL
  #undef r_arg1HH
! 
! 
! #undef r_arg2L
! #undef r_arg2H
  #undef r_arg2HL
  #undef r_arg2HH
! 
! #undef r_resL
! #undef r_resH
! #undef r_resHL
! #undef r_resHH
  
  .endfunc
  #endif /* defined (L_mulsi3) */
! 
  /*******************************************************
         Division 8 / 8 => (result + remainder)
  *******************************************************/
*************** __udivmodqi4_ep:
*** 325,331 ****
        rol     r_arg1          ; shift dividend (with CARRY)
        dec     r_cnt           ; decrement loop counter
        brne    __udivmodqi4_loop
!       com     r_arg1          ; complement result 
                                ; because C flag was complemented in loop
        ret
        .endfunc
--- 326,332 ----
        rol     r_arg1          ; shift dividend (with CARRY)
        dec     r_cnt           ; decrement loop counter
        brne    __udivmodqi4_loop
!       com     r_arg1          ; complement result
                                ; because C flag was complemented in loop
        ret
        .endfunc
*************** __divmodqi4_exit:
*** 357,364 ****
  #undef r_arg1
  #undef r_arg2
  #undef r_cnt
!       
!               
  /*******************************************************
         Division 16 / 16 => (result + remainder)
  *******************************************************/
--- 358,365 ----
  #undef r_arg1
  #undef r_arg2
  #undef r_cnt
! 
! 
  /*******************************************************
         Division 16 / 16 => (result + remainder)
  *******************************************************/
*************** __divmodqi4_exit:
*** 372,378 ****
  /* return: quotient */
  #define       r_arg2L r22     /* divisor Low */
  #define       r_arg2H r23     /* divisor High */
!       
  #define       r_cnt   r21     /* loop count */
  
  #if defined (L_udivmodhi4)
--- 373,379 ----
  /* return: quotient */
  #define       r_arg2L r22     /* divisor Low */
  #define       r_arg2H r23     /* divisor High */
! 
  #define       r_cnt   r21     /* loop count */
  
  #if defined (L_udivmodhi4)
*************** __divmodhi4_neg1:
*** 438,454 ****
        .endfunc
  #endif /* defined (L_divmodhi4) */
  
! #undef r_remH  
! #undef r_remL  
!              
! #undef r_arg1H 
! #undef r_arg1L 
!              
! #undef r_arg2H 
! #undef r_arg2L 
!               
! #undef r_cnt          
!       
  /*******************************************************
         Division 32 / 32 => (result + remainder)
  *******************************************************/
--- 439,455 ----
        .endfunc
  #endif /* defined (L_divmodhi4) */
  
! #undef r_remH
! #undef r_remL
! 
! #undef r_arg1H
! #undef r_arg1L
! 
! #undef r_arg2H
! #undef r_arg2L
! 
! #undef r_cnt
! 
  /*******************************************************
         Division 32 / 32 => (result + remainder)
  *******************************************************/
*************** __divmodhi4_neg1:
*** 468,474 ****
  #define       r_arg2HL r20
  #define       r_arg2H  r19
  #define       r_arg2L  r18    /* divisor Low */
!       
  #define       r_cnt __zero_reg__  /* loop count (0 after the loop!) */
  
  #if defined (L_udivmodsi4)
--- 469,475 ----
  #define       r_arg2HL r20
  #define       r_arg2H  r19
  #define       r_arg2L  r18    /* divisor Low */
! 
  #define       r_cnt __zero_reg__  /* loop count (0 after the loop!) */
  
  #if defined (L_udivmodsi4)
diff -c3rp gcc-3.0.4/gcc/config/avr/t-avr 
gcc-3.0.4-patch128/gcc/config/avr/t-avr
*** gcc-3.0.4/gcc/config/avr/t-avr      Sun Jan 21 03:49:01 2001
--- gcc-3.0.4-patch128/gcc/config/avr/t-avr     Wed Feb 27 12:40:26 2002
*************** MULTILIB_MATCHES = \
*** 49,55 ****
        mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
        mmcu?avr4=mmcu?atmega83  mmcu?avr4=mmcu?atmega85  \
        mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega163 \
!       mmcu?avr5=mmcu?atmega32  mmcu?avr5=mmcu?at94k
  
  MULTILIB_EXCEPTIONS =
  
--- 49,56 ----
        mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
        mmcu?avr4=mmcu?atmega83  mmcu?avr4=mmcu?atmega85  \
        mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega163 \
!       mmcu?avr5=mmcu?atmega32  mmcu?avr5=mmcu?at94k \
!       mmcu?avr5=mmcu?atmega128
  
  MULTILIB_EXCEPTIONS =
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]