View | Details | Raw Unified | Return to bug 192399 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/home/pi/myp/devel/avr-gcc/Makefile (-27 / +23 lines)
Lines 1-24 Link Here
1
# Created by: Joerg Wunsch <joerg@FreeBSD.org>
1
# $FreeBSD: head/devel/avr-gcc/Makefile 331644 2013-10-26 00:52:33Z gerald $
2
# $FreeBSD: head/devel/avr-gcc/Makefile 363371 2014-07-29 18:41:15Z adamw $
3
2
4
PORTNAME=	gcc
3
PORTNAME=	gcc
5
PORTVERSION=	4.5.1
4
PORTVERSION=	4.10.0.s20140803
6
PORTREVISION=	2
7
CATEGORIES=	devel
5
CATEGORIES=	devel
8
MASTER_SITES=	${MASTER_SITE_GCC}
6
MASTER_SITES=	${MASTER_SITE_GCC}
9
MASTER_SITES+=	http://people.freebsd.org/~joerg/:local
7
MASTER_SITE_SUBDIR=	snapshots/${DISTVERSION}
10
MASTER_SITE_SUBDIR=	releases/${DISTNAME}
11
PKGNAMEPREFIX=	avr-
8
PKGNAMEPREFIX=	avr-
12
DISTFILES=	gcc-core-${PORTVERSION}${EXTRACT_SUFX} \
9
# DISTNAME=	gcc-${DISTVERSION}
13
		gcc-g++-${PORTVERSION}${EXTRACT_SUFX}
14
EXTRACT_ONLY=	gcc-core-${PORTVERSION}${EXTRACT_SUFX} \
15
		gcc-g++-${PORTVERSION}${EXTRACT_SUFX}
16
17
MAINTAINER=	ports@FreeBSD.org
18
10
11
MAINTAINER=	joerg@FreeBSD.org
19
COMMENT=	FSF GCC 4.x for Atmel AVR 8-bit RISC cross-development
12
COMMENT=	FSF GCC 4.x for Atmel AVR 8-bit RISC cross-development
20
13
21
BROKEN=		Fails to build with avr-binutils 2.24
14
LICENSE=	GPLv3 GPLv3RLE
15
LICENSE_COMB=	multi
22
16
23
BUILD_DEPENDS=	avr-as:${PORTSDIR}/devel/avr-binutils \
17
BUILD_DEPENDS=	avr-as:${PORTSDIR}/devel/avr-binutils \
24
		avr-ld:${PORTSDIR}/devel/avr-binutils
18
		avr-ld:${PORTSDIR}/devel/avr-binutils
Lines 28-65 Link Here
28
RUN_DEPENDS=	avr-as:${PORTSDIR}/devel/avr-binutils \
22
RUN_DEPENDS=	avr-as:${PORTSDIR}/devel/avr-binutils \
29
		avr-ld:${PORTSDIR}/devel/avr-binutils
23
		avr-ld:${PORTSDIR}/devel/avr-binutils
30
24
31
# GCC 4.x doesn't want to be built in its own source directory.
25
# DISTVERSION relates to downloads, GCC_VERSION and SUFFIX to names
32
WRKSRC=			${WRKDIR}/gcc-${PORTVERSION}
26
# of executables and directories once installed.  A PORTVERSION of
33
BUILD_WRKSRC=		${WRKDIR}/build
27
# 4.Y.2.s20130808 results in values of 4.Y-20130808, 4.Y.2, and 4Y
34
CONFIGURE_WRKSRC=	${BUILD_WRKSRC}
28
# for these three.
35
INSTALL_WRKSRC=		${BUILD_WRKSRC}
29
DISTVERSION=	${PORTVERSION:C/([0-9]+\.[0-9]+).*\.s([0-9]+)/\1-\2/}
36
CONFIGURE_SCRIPT=	../gcc-${PORTVERSION}/configure
30
GCC_VERSION=	${PORTVERSION:C/(.+)\.s[0-9]{8}/\1/}
31
SUFFIX=		${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/}
37
32
33
USES=		bison gettext gmake perl5 tar:bzip2 libtool
38
USE_PERL5=	build
34
USE_PERL5=	build
39
CPPFLAGS+=	-I${LOCALBASE}/include
35
CPPFLAGS+=	-I${LOCALBASE}/include
40
USES=		bison gettext gmake perl5 tar:bzip2
41
GNU_CONFIGURE=	yes
36
GNU_CONFIGURE=	yes
42
37
43
NO_STAGE=	yes
44
.include <bsd.port.pre.mk>
38
.include <bsd.port.pre.mk>
45
39
46
.if (${ARCH} == "amd64")
40
.if (${ARCH} == "amd64")
47
ARCH=		x86_64
41
ARCH=		x86_64
48
.endif
42
.endif
49
43
50
CONFLICTS=	avr-gcc-3* avr-gcc-42*
51
52
CONFIGURE_ARGS=	--target=avr --disable-libssp --with-gmp=${LOCALBASE}
44
CONFIGURE_ARGS=	--target=avr --disable-libssp --with-gmp=${LOCALBASE}
53
45
54
MAKE_FLAGS=	LANGUAGES="c c++"
46
MAKE_FLAGS=	LANGUAGES="c c++"
55
47
56
WITHOUT_CPU_CFLAGS=This is a cross-compiler.
48
WITHOUT_CPU_CFLAGS=This is a cross-compiler.
57
49
58
MAN1=		avr-cpp.1 avr-gcc.1 avr-g++.1 avr-gcov.1
59
MAN7=		fsf-funding.7 gfdl.7 gpl.7
60
INFO=		cpp gcc gccint cppinternals gccinstall
50
INFO=		cpp gcc gccint cppinternals gccinstall
61
51
62
post-extract:
52
post-configure:
63
	cd ${WRKDIR} && ${MKDIR} build
53
	${MKDIR} ${WRKSRC}/gcc/include
54
55
post-install:
56
	${RM} ${STAGEDIR}${PREFIX}/info/gfortran.info
57
58
post-stage:
59
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/gcc/avr/4.10.0/liblto_plugin.so.0
64
60
65
.include <bsd.port.post.mk>
61
.include <bsd.port.post.mk>
(-)/usr/home/pi/myp/devel/avr-gcc/distinfo (-4 / +2 lines)
Lines 1-4 Link Here
1
SHA256 (gcc-core-4.5.1.tar.bz2) = b57b37a83840b134572b042f170d7a9429863ba0308b56b403b35de6f0e0526a
1
SHA256 (gcc-4.10-20140803.tar.bz2) = f3fc98d0d711edacf5ac8ef219d17a629ee25b308efc205bc246c740455c8435
2
SIZE (gcc-core-4.5.1.tar.bz2) = 27974462
2
SIZE (gcc-4.10-20140803.tar.bz2) = 86594143
3
SHA256 (gcc-g++-4.5.1.tar.bz2) = a5349ea8d531aa0a248484f426513e5d05b12915e5412d332c278f65d272ce48
4
SIZE (gcc-g++-4.5.1.tar.bz2) = 6473733
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-200-gcc-4.5.1-libiberty-Makefile.in (-13 lines)
Lines 1-13 Link Here
1
diff -Naurp libiberty/Makefile.in libiberty/Makefile.in
2
--- libiberty/Makefile.in	2010-03-02 00:09:56.000000000 -0600
3
+++ libiberty/Makefile.in	2011-01-18 17:27:57.000000000 -0600
4
@@ -321,7 +321,8 @@ libiberty.html : $(srcdir)/libiberty.tex
5
 @MAINT@	echo stamp > stamp-functions
6
 
7
 INSTALL_DEST = @INSTALL_DEST@
8
-install: install_to_$(INSTALL_DEST) install-subdir
9
+#install: install_to_$(INSTALL_DEST) install-subdir
10
+install:
11
 
12
 # This is tricky.  Even though CC in the Makefile contains
13
 # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-300-gcc-4.5.1-fixedpoint-3-4-2010 (-2755 lines)
Lines 1-2755 Link Here
1
diff -rupN gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2010-04-02 14:54:46.000000000 -0500
3
+++ gcc/config/avr/avr.c	2010-09-21 14:31:30.000000000 -0500
4
@@ -192,6 +192,19 @@ static const struct attribute_spec avr_a
5
 #undef TARGET_CAN_ELIMINATE
6
 #define TARGET_CAN_ELIMINATE avr_can_eliminate
7
 
8
+#undef TARGET_SCALAR_MODE_SUPPORTED_P
9
+#define TARGET_SCALAR_MODE_SUPPORTED_P avr_scalar_mode_supported_p
10
+
11
+ /* Implement TARGET_SCALAR_MODE_SUPPORTED_P.  */
12
+ static bool
13
+ avr_scalar_mode_supported_p (enum machine_mode mode)
14
+ {
15
+    if (ALL_FIXED_POINT_MODE_P (mode))
16
+       return true;
17
+ 
18
+   return default_scalar_mode_supported_p (mode);
19
+ }
20
+ 
21
 struct gcc_target targetm = TARGET_INITIALIZER;
22
 
23
 void
24
@@ -1609,9 +1622,9 @@ output_movqi (rtx insn, rtx operands[], 
25
 
26
   *l = 1;
27
   
28
-  if (register_operand (dest, QImode))
29
+  if (register_operand (dest, VOIDmode))
30
     {
31
-      if (register_operand (src, QImode)) /* mov r,r */
32
+      if (register_operand (src, VOIDmode)) /* mov r,r */
33
 	{
34
 	  if (test_hard_reg_class (STACK_REG, dest))
35
 	    return AS2 (out,%0,%1);
36
@@ -1699,9 +1712,9 @@ output_movhi (rtx insn, rtx operands[], 
37
   if (!l)
38
     l = &dummy;
39
   
40
-  if (register_operand (dest, HImode))
41
+  if (register_operand (dest, VOIDmode))
42
     {
43
-      if (register_operand (src, HImode)) /* mov r,r */
44
+      if (register_operand (src, VOIDmode)) /* mov r,r */
45
 	{
46
 	  if (test_hard_reg_class (STACK_REG, dest))
47
 	    {
48
@@ -2424,6 +2437,14 @@ output_movsisf(rtx insn, rtx operands[],
49
 	{
50
 	  if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
51
 	    {
52
+	      if (AVR_HAVE_MOVW 
53
+	          && (UINTVAL (src) >> 16) == (UINTVAL (src) & 0xffff))
54
+		{
55
+		  *l = 3;
56
+		  return  (AS2 (ldi,%A0,lo8(%1))  CR_TAB
57
+		           AS2 (ldi,%B0,hi8(%1))  CR_TAB
58
+		    	   AS2 (movw,%C0,%A0));
59
+		}
60
 	      *l = 4;
61
 	      return (AS2 (ldi,%A0,lo8(%1))  CR_TAB
62
 		      AS2 (ldi,%B0,hi8(%1))  CR_TAB
63
@@ -4354,6 +4375,196 @@ avr_rotate_bytes (rtx operands[])
64
     return true;
65
 }
66
 
67
+/* Outputs instructions needed for fixed point conversion.  */
68
+
69
+const char *
70
+fract_out (rtx insn ATTRIBUTE_UNUSED, rtx operands[], int intsigned, int *len)
71
+{
72
+  int i, k = 0;
73
+  int sbit[2], ilen[2], flen[2], tlen[2];
74
+  int rdest, rsource, offset;
75
+  int start, end, dir;
76
+  int hadbst = 0, hadlsl = 0;
77
+  int clrword = -1, lastclr = 0, clr = 0;
78
+  char buf[20];
79
+
80
+  if (!len)
81
+    len = &k;
82
+
83
+  for (i = 0; i < 2; i++)
84
+    {
85
+      enum machine_mode mode = GET_MODE (operands[i]);
86
+      tlen[i] = GET_MODE_SIZE (mode);
87
+      if (SCALAR_INT_MODE_P (mode))
88
+        {
89
+          sbit[i] = intsigned;
90
+          ilen[i] = GET_MODE_BITSIZE(mode) / 8;
91
+          flen[i] = 0;
92
+        }
93
+      else if (ALL_SCALAR_FIXED_POINT_MODE_P (mode))
94
+        {
95
+          sbit[i] = SIGNED_SCALAR_FIXED_POINT_MODE_P (mode);
96
+          ilen[i] = (GET_MODE_IBIT (mode) + 1) / 8;
97
+          flen[i] = (GET_MODE_FBIT (mode) + 1) / 8;
98
+        }
99
+      else
100
+        fatal_insn ("unsupported fixed-point conversion", insn);
101
+    }
102
+
103
+  rdest = true_regnum (operands[0]);
104
+  rsource = true_regnum (operands[1]);
105
+  offset = flen[1] - flen[0];
106
+
107
+  /* Store the sign bit if the destination is a signed
108
+     fract and the source has a sign in the integer part.  */
109
+  if (sbit[0] && !ilen[0] && sbit[1] && ilen[1])
110
+    {
111
+      /* To avoid using bst and bld if the source and
112
+         destination registers overlap we can use a single lsl
113
+         since we don't care about preserving the source register.  */
114
+      if (rdest < rsource + tlen[1] && rdest + tlen[0] > rsource)
115
+        {
116
+          sprintf (buf, "lsl r%d", rsource + tlen[1] - 1);
117
+          hadlsl = 1;
118
+        }
119
+      else
120
+        {
121
+          sprintf (buf, "bst r%d, 7", rsource + tlen[1] - 1);
122
+          hadbst = 1;
123
+        }
124
+      output_asm_insn (buf, operands);
125
+      ++*len;
126
+    }
127
+
128
+  /* Pick the correct direction.  */
129
+  if (rdest < rsource + offset)
130
+    {
131
+      dir = 1;
132
+      start = 0;
133
+      end = tlen[0];
134
+    }
135
+  else
136
+    {
137
+      dir = -1;
138
+      start = tlen[0] - 1;
139
+      end = -1;
140
+    }
141
+
142
+  /* Move registers into place, clearing registers that do not overlap.  */
143
+  for (i = start; i != end; i += dir)
144
+    {
145
+      int destloc = rdest + i, sourceloc = rsource + i + offset;
146
+      if (sourceloc < rsource || sourceloc >= rsource + tlen[1])
147
+        {
148
+          if (AVR_HAVE_MOVW && i+dir != end
149
+              && (sourceloc+dir < rsource || sourceloc+dir >= rsource + tlen[1])
150
+              && ((dir == 1 && !(destloc%2) && !(sourceloc%2))
151
+                  || (dir == -1 && (destloc%2) && (sourceloc%2)))
152
+              && clrword != -1)
153
+            {
154
+              sprintf (buf, "movw r%d, r%d", destloc&0xfe, clrword&0xfe);
155
+              i += dir;
156
+            }
157
+          else
158
+            {
159
+              /* Do not clear the register if it is going to get
160
+                 sign extended with a mov later.  */
161
+              if (sbit[0] && sbit[1] && i != tlen[0] - 1 && i >= flen[0])
162
+                continue;
163
+
164
+              sprintf (buf, "clr r%d", destloc);
165
+              if (lastclr)
166
+                clrword = destloc;
167
+              clr=1;
168
+            }
169
+        }
170
+      else if (destloc == sourceloc)
171
+        continue;
172
+      else
173
+        if (AVR_HAVE_MOVW && i+dir != end
174
+            && sourceloc+dir >= rsource && sourceloc+dir < rsource + tlen[1]
175
+            && ((dir == 1 && !(destloc%2) && !(sourceloc%2))
176
+                || (dir == -1 && (destloc%2) && (sourceloc%2))))
177
+          {
178
+            sprintf (buf, "movw r%d, r%d", destloc&0xfe, sourceloc&0xfe);
179
+            i += dir;
180
+          }
181
+        else
182
+          sprintf (buf, "mov r%d, r%d", destloc, sourceloc);
183
+        
184
+      output_asm_insn (buf, operands);
185
+      ++*len;
186
+
187
+      lastclr = clr;
188
+      clr = 0;
189
+    }
190
+
191
+  /* Perform sign extension if needed.  */
192
+  if (sbit[0] && sbit[1] && ilen[0] > ilen[1])
193
+    {
194
+      sprintf (buf, "sbrc r%d, 7", rdest+tlen[1]-1-offset);
195
+      output_asm_insn (buf, operands);
196
+      sprintf (buf, "com r%d", rdest+tlen[0]-1);
197
+      output_asm_insn (buf, operands);
198
+      *len += 2;
199
+      /* Sign extend additional bytes.  */
200
+      start = rdest + tlen[0] - 2;
201
+      end = rdest + flen[0] + ilen[1] - 1;
202
+      for (i = start; i != end; i--)
203
+        {
204
+          if (AVR_HAVE_MOVW && i != start && i-1 != end)
205
+            sprintf (buf, "movw r%d, r%d", --i, rdest+tlen[0]-2);
206
+          else
207
+            sprintf (buf, "mov r%d, r%d", i, rdest+tlen[0]-1);
208
+          output_asm_insn (buf, operands);
209
+          ++*len;
210
+        }
211
+    }
212
+
213
+  /* Perform shifts, only needed if one operand
214
+     is a signed fract, and the other is not.  */
215
+  if (sbit[0] && !ilen[0] && (!sbit[1] || ilen[1]))
216
+    {
217
+      start = rdest+flen[0]-1;
218
+      end = rdest + flen[0] - flen[1];
219
+      if (end < rdest)
220
+        end = rdest;
221
+      for (i = start; i >= end; i--)
222
+      {
223
+        if (i == start && !hadlsl)
224
+          sprintf (buf, "lsr r%d", i);
225
+        else
226
+          sprintf (buf, "ror r%d", i);
227
+        output_asm_insn (buf, operands);
228
+        ++*len;
229
+      }
230
+
231
+      if (hadbst)
232
+        {
233
+          sprintf (buf, "bld r%d, 7", rdest + tlen[0] - 1);
234
+          output_asm_insn (buf, operands);
235
+          ++*len;
236
+        }
237
+    }
238
+  else if (sbit[1] && !ilen[1] && (!sbit[0] || ilen[0]))
239
+    {
240
+      start = rdest + flen[0] - flen[1];
241
+      if (start < rdest)
242
+        start = rdest;
243
+      for (i = start; i<rdest+flen[0]; i++)
244
+        {
245
+          if (i == start)
246
+            sprintf (buf, "lsl r%d", i);
247
+          else
248
+            sprintf (buf, "rol r%d", i);
249
+          output_asm_insn (buf, operands);
250
+          ++*len;
251
+        }
252
+    }
253
+
254
+  return "";
255
+}
256
+
257
 /* Modifies the length assigned to instruction INSN
258
  LEN is the initially computed length of the insn.  */
259
 
260
diff -rupN gcc/config/avr/avr-fixed.md gcc/config/avr/avr-fixed.md
261
--- gcc/config/avr/avr-fixed.md	1969-12-31 18:00:00.000000000 -0600
262
+++ gcc/config/avr/avr-fixed.md	2010-09-21 14:31:30.000000000 -0500
263
@@ -0,0 +1,338 @@
264
+;; -*- Mode: Scheme -*-
265
+;;   This file contains instructions that support fixed-point operations
266
+;;   for ATMEL AVR micro controllers.
267
+;;   Copyright (C) 2009
268
+;;   Free Software Foundation, Inc.
269
+;;   Contributed by Sean D'Epagnier (sean@depagnier.com)
270
+
271
+;; This file is part of GCC.
272
+
273
+;; GCC is free software; you can redistribute it and/or modify
274
+;; it under the terms of the GNU General Public License as published by
275
+;; the Free Software Foundation; either version 3, or (at your option)
276
+;; any later version.
277
+
278
+;; GCC is distributed in the hope that it will be useful,
279
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
280
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
281
+;; GNU General Public License for more details.
282
+
283
+;; You should have received a copy of the GNU General Public License
284
+;; along with GCC; see the file COPYING3.  If not see
285
+;; <http://www.gnu.org/licenses/>.
286
+
287
+(define_mode_iterator ALLQQ [(QQ "") (UQQ "")])
288
+(define_mode_iterator ALLHQ [(HQ "") (UHQ "")])
289
+(define_mode_iterator ALLHA [(HA "") (UHA "")])
290
+(define_mode_iterator ALLHQHA [(HQ "") (UHQ "") (HA "") (UHA "")])
291
+(define_mode_iterator ALLSA [(SA "") (USA "")])
292
+
293
+;;; Conversions
294
+
295
+(define_mode_iterator FIXED1 [(QQ "") (UQQ "") (HQ "") (UHQ "")
296
+                              (SQ "") (USQ "") (DQ "") (UDQ "")
297
+                              (HA "") (UHA "") (SA "") (USA "")
298
+                              (DA "") (UDA "") (TA "") (UTA "")
299
+                              (QI "") (HI "") (SI "") (DI "")])
300
+(define_mode_iterator FIXED2 [(QQ "") (UQQ "") (HQ "") (UHQ "")
301
+                              (SQ "") (USQ "") (DQ "") (UDQ "")
302
+                              (HA "") (UHA "") (SA "") (USA "")
303
+                              (DA "") (UDA "") (TA "") (UTA "")
304
+                              (QI "") (HI "") (SI "") (DI "")])
305
+
306
+(define_insn "fract<FIXED2:mode><FIXED1:mode>2"
307
+  [(set (match_operand:FIXED1 0 "register_operand" "=r")
308
+        (fract_convert:FIXED1 (match_operand:FIXED2 1 "register_operand" "r")))]
309
+  ""
310
+  "* return fract_out (insn, operands, 1, NULL);"
311
+  [(set_attr "cc" "clobber")])
312
+
313
+(define_insn "fractuns<FIXED2:mode><FIXED1:mode>2"
314
+  [(set (match_operand:FIXED1 0 "register_operand" "=r")
315
+        (unsigned_fract_convert:FIXED1 (match_operand:FIXED2 1 "register_operand" "r")))]
316
+  ""
317
+  "* return fract_out (insn, operands, 0, NULL);"
318
+  [(set_attr "cc" "clobber")])
319
+
320
+;;; Addition/Subtraction, mostly identical to integer versions
321
+
322
+(define_insn "add<ALLQQ:mode>3"
323
+  [(set (match_operand:ALLQQ 0 "register_operand" "=r,d")
324
+        (plus:ALLQQ (match_operand:ALLQQ 1 "register_operand" "%0,0")
325
+                    (match_operand:ALLQQ 2 "nonmemory_operand" "r,i")))]
326
+  ""
327
+  "@
328
+        add %0,%2
329
+        subi %0,lo8(-(%2))"
330
+  [(set_attr "length" "1,1")
331
+   (set_attr "cc" "set_czn,set_czn")])
332
+
333
+(define_insn "sub<ALLQQ:mode>3"
334
+  [(set (match_operand:ALLQQ 0 "register_operand" "=r,d")
335
+        (minus:ALLQQ (match_operand:ALLQQ 1 "register_operand" "0,0")
336
+                     (match_operand:ALLQQ 2 "nonmemory_operand" "r,i")))]
337
+  ""
338
+  "@
339
+ 	sub %0,%2
340
+ 	subi %0,lo8(%2)"
341
+  [(set_attr "length" "1,1")
342
+   (set_attr "cc" "set_czn,set_czn")])
343
+
344
+
345
+(define_insn "add<ALLHQHA:mode>3"
346
+  [(set (match_operand:ALLHQHA 0 "register_operand" "=r,d")
347
+ 	(plus:ALLHQHA (match_operand:ALLHQHA 1 "register_operand" "%0,0")
348
+                    (match_operand:ALLHQHA 2 "nonmemory_operand" "r,i")))]
349
+  ""
350
+  "@
351
+ 	add %A0,%A2\;adc %B0,%B2
352
+        subi %A0,lo8(-(%2))\;sbci %B0,hi8(-(%2))"
353
+  [(set_attr "length" "2,2")
354
+   (set_attr "cc" "set_n,set_czn")])
355
+
356
+(define_insn "sub<ALLHQHA:mode>3"
357
+  [(set (match_operand:ALLHQHA 0 "register_operand" "=r,d")
358
+        (minus:ALLHQHA (match_operand:ALLHQHA 1 "register_operand" "0,0")
359
+		  (match_operand:ALLHQHA 2 "nonmemory_operand" "r,i")))]
360
+  ""
361
+  "@
362
+	sub %A0,%A2\;sbc %B0,%B2
363
+	subi %A0,lo8(%2)\;sbci %B0,hi8(%2)"
364
+  [(set_attr "length" "2,2")
365
+   (set_attr "cc" "set_czn,set_czn")])
366
+
367
+(define_insn "add<ALLSA:mode>3"
368
+  [(set (match_operand:ALLSA 0 "register_operand" "=r,d")
369
+ 	(plus:ALLSA (match_operand:ALLSA 1 "register_operand" "%0,0")
370
+                    (match_operand:ALLSA 2 "nonmemory_operand" "r,i")))]
371
+  ""
372
+  "@
373
+	add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2
374
+	subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2))"
375
+  [(set_attr "length" "4,4")
376
+   (set_attr "cc" "set_n,set_czn")])
377
+
378
+(define_insn "sub<ALLSA:mode>3"
379
+  [(set (match_operand:ALLSA 0 "register_operand" "=r,d")
380
+        (minus:ALLSA (match_operand:ALLSA 1 "register_operand" "0,0")
381
+		  (match_operand:ALLSA 2 "nonmemory_operand" "r,i")))]
382
+  ""
383
+  "@
384
+	sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2
385
+	subi %A0,lo8(%2)\;sbci %B0,hi8(%2)\;sbci %C0,hlo8(%2)\;sbci %D0,hhi8(%2)"
386
+  [(set_attr "length" "4,4")
387
+   (set_attr "cc" "set_czn,set_czn")])
388
+
389
+;******************************************************************************
390
+; mul
391
+
392
+(define_insn "mulqq3"
393
+  [(set (match_operand:QQ 0 "register_operand" "=r")
394
+	(mult:QQ (match_operand:QQ 1 "register_operand" "a")
395
+		 (match_operand:QQ 2 "register_operand" "a")))]
396
+  "AVR_HAVE_MUL"
397
+  "fmuls %1,%2\;mov %0,r1\;clr r1"
398
+  [(set_attr "length" "3")
399
+   (set_attr "cc" "clobber")])
400
+
401
+(define_insn "muluqq3"
402
+  [(set (match_operand:UQQ 0 "register_operand" "=r")
403
+	(mult:UQQ (match_operand:UQQ 1 "register_operand" "r")
404
+                  (match_operand:UQQ 2 "register_operand" "r")))]
405
+  "AVR_HAVE_MUL"
406
+  "mul %1,%2\;mov %0,r1\;clr r1"
407
+  [(set_attr "length" "3")
408
+   (set_attr "cc" "clobber")])
409
+
410
+;; (reg:ALLHQ 20) not clobbered on the enhanced core.
411
+;; use registers from 16-23 so we can use fmuls
412
+;; All call-used registers clobbered otherwise - normal library call.
413
+(define_expand "mul<ALLHQ:mode>3"
414
+  [(set (reg:ALLHQ 22) (match_operand:ALLHQ 1 "register_operand" ""))
415
+   (set (reg:ALLHQ 20) (match_operand:ALLHQ 2 "register_operand" ""))
416
+   (parallel [(set (reg:ALLHQ 18) (mult:ALLHQ (reg:ALLHQ 22) (reg:ALLHQ 20)))
417
+	      (clobber (reg:ALLHQ 22))])
418
+   (set (match_operand:ALLHQ 0 "register_operand" "") (reg:ALLHQ 18))]
419
+  "AVR_HAVE_MUL"
420
+  "")
421
+
422
+(define_insn "*mul<ALLHQ:mode>3_enh_call"
423
+  [(set (reg:ALLHQ 18) (mult:ALLHQ (reg:ALLHQ 22) (reg:ALLHQ 20)))
424
+   (clobber (reg:ALLHQ 22))]
425
+  "AVR_HAVE_MUL"
426
+  "%~call __mul<ALLHQ:mode>3"
427
+  [(set_attr "type" "xcall")
428
+   (set_attr "cc" "clobber")])
429
+
430
+; Special calls for with and without mul.
431
+(define_expand "mul<ALLHA:mode>3"
432
+  [(set (reg:ALLHA 22) (match_operand:ALLHA 1 "register_operand" ""))
433
+   (set (reg:ALLHA 20) (match_operand:ALLHA 2 "register_operand" ""))
434
+   (parallel [(set (reg:ALLHA 18) (mult:ALLHA (reg:ALLHA 22) (reg:ALLHA 20)))
435
+	      (clobber (reg:ALLHA 22))])
436
+   (set (match_operand:ALLHA 0 "register_operand" "") (reg:ALLHA 18))]
437
+  ""
438
+  "
439
+{
440
+  if (!AVR_HAVE_MUL)
441
+    {
442
+      emit_insn (gen_mul<ALLHA:mode>3_call (operands[0], operands[1], operands[2]));
443
+      DONE;
444
+    }
445
+}")
446
+
447
+(define_insn "*mul<ALLHA:mode>3_enh"
448
+  [(set (reg:ALLHA 18) (mult:ALLHA (reg:ALLHA 22) (reg:ALLHA 20)))
449
+   (clobber (reg:ALLHA 22))]
450
+  "AVR_HAVE_MUL"
451
+  "%~call __mul<ALLHA:mode>3"
452
+  [(set_attr "type" "xcall")
453
+   (set_attr "cc" "clobber")])
454
+
455
+; Without multiplier, clobbers both inputs, and needs a separate output register
456
+(define_expand "mul<ALLHA:mode>3_call"
457
+  [(set (reg:ALLHA 24) (match_operand:ALLHA 1 "register_operand" ""))
458
+   (set (reg:ALLHA 22) (match_operand:ALLHA 2 "register_operand" ""))
459
+   (parallel [(set (reg:ALLHA 18) (mult:ALLHA (reg:ALLHA 22) (reg:ALLHA 24)))
460
+              (clobber (reg:ALLHA 22))
461
+              (clobber (reg:ALLHA 24))])
462
+   (set (match_operand:ALLHA 0 "register_operand" "") (reg:ALLHA 18))]
463
+  "!AVR_HAVE_MUL"
464
+  "")
465
+
466
+(define_insn "*mul<ALLHA:mode>3_call"
467
+  [(set (reg:ALLHA 18) (mult:ALLHA (reg:ALLHA 22) (reg:ALLHA 24)))
468
+   (clobber (reg:ALLHA 22))
469
+   (clobber (reg:ALLHA 24))]
470
+  "!AVR_HAVE_MUL"
471
+  "%~call __mul<ALLHA:mode>3"
472
+  [(set_attr "type" "xcall")
473
+   (set_attr "cc" "clobber")])
474
+
475
+;; On the enhanced core, don't clobber either input, and use a separate output,
476
+;; r2 is needed as a zero register since r1 is used for mul
477
+(define_expand "mul<ALLSA:mode>3"
478
+  [(set (reg:ALLSA 16) (match_operand:ALLSA 1 "register_operand" ""))
479
+   (set (reg:ALLSA 20) (match_operand:ALLSA 2 "register_operand" ""))
480
+   (parallel [(set (reg:ALLSA 24) (mult:ALLSA (reg:ALLSA 16) (reg:ALLSA 20)))
481
+	      (clobber (reg:QI 15))])
482
+   (set (match_operand:ALLSA 0 "register_operand" "") (reg:ALLSA 24))]
483
+  ""
484
+  "
485
+{
486
+  if (!AVR_HAVE_MUL)
487
+    {
488
+      emit_insn (gen_mul<ALLSA:mode>3_call (operands[0], operands[1], operands[2]));
489
+      DONE;
490
+    }
491
+}")
492
+
493
+(define_insn "*mul<ALLSA:mode>3_enh"
494
+  [(set (reg:ALLSA 24) (mult:ALLSA (reg:ALLSA 16) (reg:ALLSA 20)))
495
+   (clobber (reg:QI 15))]
496
+  "AVR_HAVE_MUL"
497
+  "%~call __mul<ALLSA:mode>3"
498
+  [(set_attr "type" "xcall")
499
+   (set_attr "cc" "clobber")])
500
+
501
+; Without multiplier, clobbers both inputs, needs a separate output, and also
502
+; needs two more scratch registers
503
+(define_expand "mul<ALLSA:mode>3_call"
504
+  [(set (reg:ALLSA 18) (match_operand:ALLSA 1 "register_operand" ""))
505
+   (set (reg:ALLSA 24) (match_operand:ALLSA 2 "register_operand" ""))
506
+   (parallel [(set (reg:ALLSA 14) (mult:ALLSA (reg:ALLSA 18) (reg:ALLSA 24)))
507
+              (clobber (reg:ALLSA 18))
508
+              (clobber (reg:ALLSA 24))
509
+	      (clobber (reg:HI 22))])
510
+   (set (match_operand:ALLSA 0 "register_operand" "") (reg:ALLSA 14))]
511
+  "!AVR_HAVE_MUL"
512
+  "")
513
+
514
+(define_insn "*mul<ALLSA:mode>3_call"
515
+  [(set (reg:ALLSA 14) (mult:ALLSA (reg:ALLSA 18) (reg:ALLSA 24)))
516
+   (clobber (reg:ALLSA 18))
517
+   (clobber (reg:ALLSA 24))
518
+   (clobber (reg:HI 22))]
519
+  "!AVR_HAVE_MUL"
520
+  "%~call __mul<ALLSA:mode>3"
521
+  [(set_attr "type" "xcall")
522
+   (set_attr "cc" "clobber")])
523
+
524
+; / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
525
+; div
526
+
527
+(define_code_iterator usdiv [udiv div]) ; do signed and unsigned in one shot
528
+
529
+(define_expand "<usdiv:code><ALLQQ:mode>3"
530
+  [(set (reg:ALLQQ 25) (match_operand:ALLQQ 1 "register_operand" ""))
531
+   (set (reg:ALLQQ 22) (match_operand:ALLQQ 2 "register_operand" ""))
532
+   (parallel [(set (reg:ALLQQ 24) (usdiv:ALLQQ (reg:ALLQQ 25) (reg:ALLQQ 22)))
533
+	      (clobber (reg:ALLQQ 25))
534
+	      (clobber (reg:QI 23))])
535
+   (set (match_operand:ALLQQ 0 "register_operand" "") (reg:ALLQQ 24))]
536
+  ""
537
+  "")
538
+
539
+(define_insn "*<usdiv:code><ALLQQ:mode>3_call"
540
+  [(set (reg:ALLQQ 24) (usdiv:ALLQQ (reg:ALLQQ 25) (reg:ALLQQ 22)))
541
+   (clobber (reg:ALLQQ 25))
542
+   (clobber (reg:QI 23))]
543
+  ""
544
+  "%~call __<usdiv:code><ALLQQ:mode>3"
545
+  [(set_attr "type" "xcall")
546
+   (set_attr "cc" "clobber")])
547
+
548
+(define_expand "<usdiv:code><ALLHQHA:mode>3"
549
+  [(set (reg:ALLHQHA 26) (match_operand:ALLHQHA 1 "register_operand" ""))
550
+   (set (reg:ALLHQHA 22) (match_operand:ALLHQHA 2 "register_operand" ""))
551
+   (parallel [(set (reg:ALLHQHA 24) (usdiv:ALLHQHA (reg:ALLHQHA 26) (reg:ALLHQHA 22)))
552
+	      (clobber (reg:ALLHQHA 26))
553
+	      (clobber (reg:QI 21))])
554
+   (set (match_operand:ALLHQHA 0 "register_operand" "") (reg:ALLHQHA 24))]
555
+  ""
556
+  "")
557
+
558
+(define_insn "*<usdiv:code><ALLHQHA:mode>3_call"
559
+  [(set (reg:ALLHQHA 24) (usdiv:ALLHQHA (reg:ALLHQHA 26) (reg:ALLHQHA 22)))
560
+   (clobber (reg:ALLHQHA 26))
561
+   (clobber (reg:QI 21))]
562
+  ""
563
+  "%~call __<usdiv:code><ALLHQHA:mode>3"
564
+  [(set_attr "type" "xcall")
565
+   (set_attr "cc" "clobber")])
566
+
567
+; note the first parameter gets passed in already offset by 2 bytes
568
+(define_expand "<usdiv:code><ALLSA:mode>3"
569
+  [(set (reg:ALLSA 24) (match_operand:ALLSA 1 "register_operand" ""))
570
+   (set (reg:ALLSA 18) (match_operand:ALLSA 2 "register_operand" ""))
571
+   (parallel [(set (reg:ALLSA 22) (usdiv:ALLSA (reg:ALLSA 24) (reg:ALLSA 18)))
572
+	      (clobber (reg:HI 26))
573
+              (clobber (reg:HI 30))])
574
+   (set (match_operand:ALLSA 0 "register_operand" "") (reg:ALLSA 22))]
575
+  ""
576
+  "")
577
+
578
+(define_insn "*<usdiv:code><ALLSA:mode>3_call"
579
+  [(set (reg:ALLSA 22) (usdiv:ALLSA (reg:ALLSA 24) (reg:ALLSA 18)))
580
+   (clobber (reg:HI 26))
581
+   (clobber (reg:HI 30))]
582
+  ""
583
+  "%~call __<usdiv:code><ALLSA:mode>3"
584
+  [(set_attr "type" "xcall")
585
+   (set_attr "cc" "clobber")])
586
+
587
+
588
+;; abs must be defined for fixed types for correct operation
589
+
590
+;; abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x)
591
+
592
+;; abs
593
+
594
+(define_insn "abs<ALLQQ:mode>2"
595
+  [(set (match_operand:ALLQQ 0 "register_operand" "=r")
596
+        (abs:ALLQQ (match_operand:ALLQQ 1 "register_operand" "0")))]
597
+  ""
598
+  "sbrc %0,7
599
+	neg %0"
600
+  [(set_attr "length" "2")
601
+   (set_attr "cc" "clobber")])
602
diff -rupN gcc/config/avr/avr.md gcc/config/avr/avr.md
603
--- gcc/config/avr/avr.md	2010-04-02 14:54:46.000000000 -0500
604
+++ gcc/config/avr/avr.md	2010-09-21 14:33:24.000000000 -0500
605
@@ -66,6 +66,15 @@
606
 (include "predicates.md")
607
 (include "constraints.md")
608
   
609
+; fixed-point instructions.
610
+(include "avr-fixed.md")
611
+(define_mode_iterator ALLQ [(QI "") (QQ "") (UQQ "")])
612
+(define_mode_iterator ALLH [(HI "") (HQ "") (UHQ "") (HA "") (UHA "")])
613
+(define_mode_iterator ALLS [(SI "") (SA "") (USA "")])
614
+(define_mode_iterator ALLQS [(QI "") (QQ "") (UQQ "")
615
+			     (HI "") (HQ "") (UHQ "") (HA "") (UHA "")
616
+			     (SI "") (SA "") (USA "")])
617
+
618
 ;; Condition code settings.
619
 (define_attr "cc" "none,set_czn,set_zn,set_n,compare,clobber"
620
   (const_string "none"))
621
@@ -181,9 +190,9 @@
622
 })
623
 
624
 
625
-(define_insn "*pushqi"
626
-  [(set (mem:QI (post_dec (reg:HI REG_SP)))
627
-        (match_operand:QI 0 "reg_or_0_operand" "r,L"))]
628
+(define_insn "*push<ALLQ:mode>"
629
+  [(set (mem:ALLQ (post_dec (reg:HI REG_SP)))
630
+        (match_operand:ALLQ 0 "reg_or_0_operand" "r,L"))]
631
   ""
632
   "@
633
 	push %0
634
@@ -191,18 +200,18 @@
635
   [(set_attr "length" "1,1")])
636
 
637
 
638
-(define_insn "*pushhi"
639
-  [(set (mem:HI (post_dec (reg:HI REG_SP)))
640
-        (match_operand:HI 0 "reg_or_0_operand" "r,L"))]
641
+(define_insn "*push<ALLH:mode>"
642
+  [(set (mem:ALLH (post_dec (reg:HI REG_SP)))
643
+        (match_operand:ALLH 0 "reg_or_0_operand" "r,L"))]
644
   ""
645
   "@
646
 	push %B0\;push %A0
647
 	push __zero_reg__\;push __zero_reg__"
648
   [(set_attr "length" "2,2")])
649
 
650
-(define_insn "*pushsi"
651
-  [(set (mem:SI (post_dec (reg:HI REG_SP)))
652
-        (match_operand:SI 0 "reg_or_0_operand" "r,L"))]
653
+(define_insn "*push<ALLS:mode>"
654
+  [(set (mem:ALLS (post_dec (reg:HI REG_SP)))
655
+        (match_operand:ALLS 0 "reg_or_0_operand" "r,L"))]
656
   ""
657
   "@
658
 	push %D0\;push %C0\;push %B0\;push %A0
659
@@ -228,21 +237,21 @@
660
 ;; are call-saved registers, and most of LD_REGS are call-used registers,
661
 ;; so this may still be a win for registers live across function calls.
662
 
663
-(define_expand "movqi"
664
-  [(set (match_operand:QI 0 "nonimmediate_operand" "")
665
-	(match_operand:QI 1 "general_operand" ""))]
666
+(define_expand "mov<ALLQ:mode>"
667
+   [(set (match_operand:ALLQ 0 "nonimmediate_operand" "")
668
+ 	(match_operand:ALLQ 1 "general_operand" ""))]
669
   ""
670
   "/* One of the ops has to be in a register.  */
671
-   if (!register_operand(operand0, QImode)
672
-       && ! (register_operand(operand1, QImode) || const0_rtx == operand1))
673
-       operands[1] = copy_to_mode_reg(QImode, operand1);
674
+    if (!register_operand(operand0, <ALLQ:MODE>mode)
675
+        && ! (register_operand(operand1, <ALLQ:MODE>mode) || const0_rtx == operand1))
676
+        operands[1] = copy_to_mode_reg(<ALLQ:MODE>mode, operand1);
677
   ")
678
 
679
-(define_insn "*movqi"
680
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=r,d,Qm,r,q,r,*r")
681
-	(match_operand:QI 1 "general_operand"       "rL,i,rL,Qm,r,q,i"))]
682
-  "(register_operand (operands[0],QImode)
683
-    || register_operand (operands[1], QImode) || const0_rtx == operands[1])"
684
+(define_insn "*mov<ALLQ:mode>"
685
+   [(set (match_operand:ALLQ 0 "nonimmediate_operand" "=r,d,Qm,r,q,r,*r")
686
+ 	(match_operand:ALLQ 1 "general_operand"       "r,i,rL,Qm,r,q,i"))]
687
+   "(register_operand (operands[0],<ALLQ:MODE>mode)
688
+     || register_operand (operands[1], <ALLQ:MODE>mode) || const0_rtx == operands[1])"
689
   "* return output_movqi (insn, operands, NULL);"
690
   [(set_attr "length" "1,1,5,5,1,1,4")
691
    (set_attr "cc" "none,none,clobber,clobber,none,none,clobber")])
692
@@ -274,17 +283,17 @@
693
 ;;============================================================================
694
 ;; move word (16 bit)
695
 
696
-(define_expand "movhi"
697
-  [(set (match_operand:HI 0 "nonimmediate_operand" "")
698
-        (match_operand:HI 1 "general_operand"       ""))]
699
+(define_expand "mov<ALLH:mode>"
700
+  [(set (match_operand:ALLH 0 "nonimmediate_operand" "")
701
+        (match_operand:ALLH 1 "general_operand"       ""))]
702
   ""
703
   "
704
 {
705
    /* One of the ops has to be in a register.  */
706
-  if (!register_operand(operand0, HImode)
707
-      && !(register_operand(operand1, HImode) || const0_rtx == operands[1]))
708
+  if (!register_operand(operand0, <ALLH:MODE>mode)
709
+      && !(register_operand(operand1, <ALLH:MODE>mode) || const0_rtx == operands[1]))
710
     {
711
-      operands[1] = copy_to_mode_reg(HImode, operand1);
712
+      operands[1] = copy_to_mode_reg(<ALLH:MODE>mode, operand1);
713
     }
714
 }")
715
 
716
@@ -339,20 +348,20 @@
717
   [(set_attr "length" "4")
718
    (set_attr "cc" "none")])
719
 
720
-(define_insn "*movhi"
721
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,d,*r,q,r")
722
-        (match_operand:HI 1 "general_operand"       "rL,m,rL,i,i,r,q"))]
723
-  "(register_operand (operands[0],HImode)
724
-    || register_operand (operands[1],HImode) || const0_rtx == operands[1])"
725
+(define_insn "*mov<ALLH:mode>"
726
+  [(set (match_operand:ALLH 0 "nonimmediate_operand" "=r,r,m,d,*r,q,r")
727
+        (match_operand:ALLH 1 "general_operand"       "r,m,rL,i,i,r,q"))]
728
+  "(register_operand (operands[0],<ALLH:MODE>mode)
729
+    || register_operand (operands[1],<ALLH:MODE>mode) || const0_rtx == operands[1])"
730
   "* return output_movhi (insn, operands, NULL);"
731
   [(set_attr "length" "2,6,7,2,6,5,2")
732
    (set_attr "cc" "none,clobber,clobber,none,clobber,none,none")])
733
 
734
 (define_peephole2 ; movw
735
-  [(set (match_operand:QI 0 "even_register_operand" "")
736
-        (match_operand:QI 1 "even_register_operand" ""))
737
-   (set (match_operand:QI 2 "odd_register_operand" "")
738
-        (match_operand:QI 3 "odd_register_operand" ""))]
739
+  [(set (match_operand:ALLQ 0 "even_register_operand" "")
740
+        (match_operand:ALLQ 1 "even_register_operand" ""))
741
+   (set (match_operand:ALLQ 2 "odd_register_operand" "")
742
+        (match_operand:ALLQ 3 "odd_register_operand" ""))]
743
   "(AVR_HAVE_MOVW
744
     && REGNO (operands[0]) == REGNO (operands[2]) - 1
745
     && REGNO (operands[1]) == REGNO (operands[3]) - 1)"
746
@@ -363,10 +372,10 @@
747
   })
748
 
749
 (define_peephole2 ; movw_r
750
-  [(set (match_operand:QI 0 "odd_register_operand" "")
751
-        (match_operand:QI 1 "odd_register_operand" ""))
752
-   (set (match_operand:QI 2 "even_register_operand" "")
753
-        (match_operand:QI 3 "even_register_operand" ""))]
754
+  [(set (match_operand:ALLQ 0 "odd_register_operand" "")
755
+        (match_operand:ALLQ 1 "odd_register_operand" ""))
756
+   (set (match_operand:ALLQ 2 "even_register_operand" "")
757
+        (match_operand:ALLQ 3 "even_register_operand" ""))]
758
   "(AVR_HAVE_MOVW
759
     && REGNO (operands[2]) == REGNO (operands[0]) - 1
760
     && REGNO (operands[3]) == REGNO (operands[1]) - 1)"
761
@@ -379,26 +388,24 @@
762
 ;;==========================================================================
763
 ;; move double word (32 bit)
764
 
765
-(define_expand "movsi"
766
-  [(set (match_operand:SI 0 "nonimmediate_operand" "")
767
-        (match_operand:SI 1 "general_operand"  ""))]
768
+(define_expand "mov<ALLS:mode>"
769
+  [(set (match_operand:ALLS 0 "nonimmediate_operand" "")
770
+        (match_operand:ALLS 1 "general_operand"  ""))]
771
   ""
772
   "
773
 {
774
   /* One of the ops has to be in a register.  */
775
-  if (!register_operand (operand0, SImode)
776
-      && !(register_operand (operand1, SImode) || const0_rtx == operand1))
777
+  if (!register_operand (operand0, <ALLS:MODE>mode)
778
+      && !(register_operand (operand1, <ALLS:MODE>mode) || const0_rtx == operand1))
779
     {
780
-      operands[1] = copy_to_mode_reg (SImode, operand1);
781
+      operands[1] = copy_to_mode_reg (<ALLS:MODE>mode, operand1);
782
     }
783
 }")
784
 
785
-
786
-
787
 (define_peephole2 ; movsi_lreg_const
788
   [(match_scratch:QI 2 "d")
789
-   (set (match_operand:SI 0 "l_register_operand" "")
790
-        (match_operand:SI 1 "immediate_operand" ""))
791
+   (set (match_operand:ALLS 0 "l_register_operand" "")
792
+        (match_operand:ALLS 1 "immediate_operand" ""))
793
    (match_dup 2)]
794
   "(operands[1] != const0_rtx
795
     && operands[1] != constm1_rtx)"
796
@@ -408,8 +415,8 @@
797
 
798
 ;; '*' because it is not used in rtl generation.
799
 (define_insn "*reload_insi"
800
-  [(set (match_operand:SI 0 "register_operand" "=r")
801
-        (match_operand:SI 1 "immediate_operand" "i"))
802
+  [(set (match_operand:ALLS 0 "register_operand" "=r")
803
+        (match_operand:ALLS 1 "immediate_operand" "i"))
804
    (clobber (match_operand:QI 2 "register_operand" "=&d"))]
805
   "reload_completed"
806
   "* return output_reload_insisf (insn, operands, NULL);"
807
@@ -417,11 +424,11 @@
808
    (set_attr "cc" "none")])
809
 
810
 
811
-(define_insn "*movsi"
812
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,Qm,!d,r")
813
-        (match_operand:SI 1 "general_operand"       "r,L,Qm,rL,i,i"))]
814
-  "(register_operand (operands[0],SImode)
815
-    || register_operand (operands[1],SImode) || const0_rtx == operands[1])"
816
+(define_insn "*mov<ALLS:mode>"
817
+  [(set (match_operand:ALLS 0 "nonimmediate_operand" "=r,r,r,Qm,!d,r")
818
+        (match_operand:ALLS 1 "general_operand"       "r,L,Qm,rL,i,i"))]
819
+  "(register_operand (operands[0],<ALLS:MODE>mode)
820
+    || register_operand (operands[1],<ALLS:MODE>mode) || const0_rtx == operands[1])"
821
   "* return output_movsisf (insn, operands, NULL);"
822
   [(set_attr "length" "4,4,8,9,4,10")
823
    (set_attr "cc" "none,set_zn,clobber,clobber,none,clobber")])
824
@@ -958,23 +965,54 @@
825
   [(set_attr "type" "xcall")
826
    (set_attr "cc" "clobber")])
827
 
828
-(define_insn "mulqihi3"
829
+;; Define code iterators
830
+(define_code_iterator any_extend [sign_extend zero_extend])
831
+(define_code_attr s [(sign_extend "s") (zero_extend "")])
832
+(define_code_attr u [(sign_extend "") (zero_extend "u")])
833
+(define_code_attr su [(sign_extend "s") (zero_extend "u")])
834
+
835
+(define_insn "<any_extend:su>mulqi3_highpart"
836
+  [(set (match_operand:QI 0 "register_operand" "=r")
837
+	(truncate:QI
838
+	 (lshiftrt:HI
839
+	  (mult:HI (any_extend:HI (match_operand:QI 1 "register_operand" "d"))
840
+		   (any_extend:HI (match_operand:QI 2 "register_operand" "d")))
841
+	  (const_int 8))))]
842
+  "AVR_HAVE_MUL && !optimize_size"
843
+  "mul<any_extend:s> %1,%2
844
+	mov %0,r1
845
+	clr r1"
846
+  [(set_attr "length" "3")
847
+   (set_attr "cc" "clobber")])
848
+
849
+(define_insn "<any_extend:u>mulqihi3"
850
   [(set (match_operand:HI 0 "register_operand" "=r")
851
-	(mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "d"))
852
-		 (sign_extend:HI (match_operand:QI 2 "register_operand" "d"))))]
853
+	(mult:HI (any_extend:HI (match_operand:QI 1 "register_operand" "d"))
854
+		 (any_extend:HI (match_operand:QI 2 "register_operand" "d"))))]
855
   "AVR_HAVE_MUL"
856
-  "muls %1,%2
857
+  "mul<any_extend:s> %1,%2
858
 	movw %0,r0
859
 	clr r1"
860
   [(set_attr "length" "3")
861
    (set_attr "cc" "clobber")])
862
 
863
-(define_insn "umulqihi3"
864
+(define_insn "*sumulqihi3"
865
   [(set (match_operand:HI 0 "register_operand" "=r")
866
-	(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
867
-		 (zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
868
+	(mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "a"))
869
+		 (zero_extend:HI (match_operand:QI 2 "register_operand" "a"))))]
870
   "AVR_HAVE_MUL"
871
-  "mul %1,%2
872
+  "mulsu %1,%2
873
+	movw %0,r0
874
+	clr r1"
875
+  [(set_attr "length" "3")
876
+   (set_attr "cc" "clobber")])
877
+
878
+(define_insn "*usmulqihi3"
879
+  [(set (match_operand:HI 0 "register_operand" "=r")
880
+	(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "a"))
881
+		 (sign_extend:HI (match_operand:QI 2 "register_operand" "a"))))]
882
+  "AVR_HAVE_MUL"
883
+  "mulsu %2,%1
884
 	movw %0,r0
885
 	clr r1"
886
   [(set_attr "length" "3")
887
@@ -1028,6 +1066,50 @@
888
   [(set_attr "type" "xcall")
889
    (set_attr "cc" "clobber")])
890
 
891
+(define_expand "<any_extend:u>mulhisi3"
892
+  [(set (reg:HI 18) (match_operand:SI 1 "register_operand" ""))
893
+   (set (reg:HI 20) (match_operand:SI 2 "register_operand" ""))
894
+   (set (reg:SI 22)
895
+	(mult:SI (any_extend:SI (reg:HI 18))
896
+		 (any_extend:SI (reg:HI 20))))
897
+   (set (match_operand:SI 0 "register_operand" "") (reg:SI 22))]
898
+  "!optimize_size"
899
+  "")
900
+
901
+(define_insn "*<any_extend:u>mulhisi3_call"
902
+  [(set (reg:SI 22)
903
+	(mult:SI (any_extend:SI (reg:HI 18))
904
+		 (any_extend:SI (reg:HI 20))))]
905
+  "!optimize_size"
906
+  "%~call __<any_extend:u>mulhisi3"
907
+  [(set_attr "type" "xcall")
908
+   (set_attr "cc" "clobber")])
909
+
910
+(define_expand "<any_extend:su>mulhi3_highpart"
911
+  [(set (reg:HI 18) (match_operand:HI 1 "register_operand" ""))
912
+   (set (reg:HI 20) (match_operand:HI 2 "register_operand" ""))
913
+   (set (reg:HI 24) (truncate:HI (lshiftrt:SI
914
+				  (mult:SI (any_extend:SI (reg:HI 18))
915
+					   (any_extend:SI (reg:HI 20)))
916
+				  (const_int 16))))
917
+   (set (match_operand:SI 0 "register_operand" "") (reg:HI 24))]
918
+  "AVR_HAVE_MUL"
919
+  "")
920
+
921
+(define_insn_and_split "*<any_extend:su>mulhi3_highpart_call"
922
+  [(set (reg:HI 24) (truncate:HI (lshiftrt:SI
923
+				  (mult:SI (any_extend:SI (reg:HI 18))
924
+					   (any_extend:SI (reg:HI 20)))
925
+				  (const_int 16))))]
926
+  "AVR_HAVE_MUL"
927
+  ""
928
+  ""
929
+  [(set (reg:SI 22)
930
+	(mult:SI (any_extend:SI (reg:HI 18))
931
+		 (any_extend:SI (reg:HI 20))))
932
+   (clobber (reg:HI 22))]
933
+  "")
934
+
935
 ;; Operand 2 (reg:SI 18) not clobbered on the enhanced core.
936
 ;; All call-used registers clobbered otherwise - normal library call.
937
 (define_expand "mulsi3"
938
@@ -1572,9 +1654,9 @@
939
 ;;<< << << << << << << << << << << << << << << << << << << << << << << << << <<
940
 ;; arithmetic shift left
941
 
942
-(define_expand "ashlqi3"
943
-  [(set (match_operand:QI 0 "register_operand"            "")
944
-	(ashift:QI (match_operand:QI 1 "register_operand" "")
945
+(define_expand "ashl<ALLQ:mode>3"
946
+  [(set (match_operand:ALLQ 0 "register_operand"            "")
947
+	(ashift:ALLQ (match_operand:ALLQ 1 "register_operand" "")
948
 		   (match_operand:QI 2 "general_operand"  "")))]
949
   ""
950
   "")
951
@@ -1608,27 +1690,27 @@
952
    (set (match_dup 0) (and:QI (match_dup 0) (const_int -64)))]
953
   "")
954
 
955
-(define_insn "*ashlqi3"
956
-  [(set (match_operand:QI 0 "register_operand"           "=r,r,r,r,!d,r,r")
957
-	(ashift:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
958
+(define_insn "*ashl<ALLQ:mode>3"
959
+  [(set (match_operand:ALLQ 0 "register_operand"           "=r,r,r,r,!d,r,r")
960
+	(ashift:ALLQ (match_operand:ALLQ 1 "register_operand" "0,0,0,0,0,0,0")
961
 		   (match_operand:QI 2 "general_operand"  "r,L,P,K,n,n,Qm")))]
962
   ""
963
   "* return ashlqi3_out (insn, operands, NULL);"
964
   [(set_attr "length" "5,0,1,2,4,6,9")
965
    (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
966
 
967
-(define_insn "ashlhi3"
968
-  [(set (match_operand:HI 0 "register_operand"           "=r,r,r,r,r,r,r")
969
-	(ashift:HI (match_operand:HI 1 "register_operand" "0,0,0,r,0,0,0")
970
+(define_insn "ashl<ALLH:mode>3"
971
+  [(set (match_operand:ALLH 0 "register_operand"           "=r,r,r,r,r,r,r")
972
+	(ashift:ALLH (match_operand:ALLH 1 "register_operand" "0,0,0,r,0,0,0")
973
 		   (match_operand:QI 2 "general_operand"  "r,L,P,O,K,n,Qm")))]
974
   ""
975
   "* return ashlhi3_out (insn, operands, NULL);"
976
   [(set_attr "length" "6,0,2,2,4,10,10")
977
    (set_attr "cc" "clobber,none,set_n,clobber,set_n,clobber,clobber")])
978
 
979
-(define_insn "ashlsi3"
980
-  [(set (match_operand:SI 0 "register_operand"           "=r,r,r,r,r,r,r")
981
-	(ashift:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
982
+(define_insn "ashl<ALLS:mode>3"
983
+  [(set (match_operand:ALLS 0 "register_operand"           "=r,r,r,r,r,r,r")
984
+	(ashift:ALLS (match_operand:ALLS 1 "register_operand" "0,0,0,r,0,0,0")
985
 		   (match_operand:QI 2 "general_operand"  "r,L,P,O,K,n,Qm")))]
986
   ""
987
   "* return ashlsi3_out (insn, operands, NULL);"
988
@@ -1674,17 +1756,17 @@
989
 
990
 (define_peephole2
991
   [(match_scratch:QI 3 "d")
992
-   (set (match_operand:HI 0 "register_operand" "")
993
-	(ashift:HI (match_operand:HI 1 "register_operand" "")
994
+   (set (match_operand:ALLH 0 "register_operand" "")
995
+	(ashift:ALLH (match_operand:ALLH 1 "register_operand" "")
996
 		   (match_operand:QI 2 "const_int_operand" "")))]
997
   ""
998
-  [(parallel [(set (match_dup 0) (ashift:HI (match_dup 1) (match_dup 2)))
999
+  [(parallel [(set (match_dup 0) (ashift:ALLH (match_dup 1) (match_dup 2)))
1000
 	      (clobber (match_dup 3))])]
1001
   "")
1002
 
1003
-(define_insn "*ashlhi3_const"
1004
-  [(set (match_operand:HI 0 "register_operand"            "=r,r,r,r,r")
1005
-	(ashift:HI (match_operand:HI 1 "register_operand"  "0,0,r,0,0")
1006
+(define_insn "*ashl<ALLH:mode>3_const"
1007
+  [(set (match_operand:ALLH 0 "register_operand"            "=r,r,r,r,r")
1008
+	(ashift:ALLH (match_operand:ALLH 1 "register_operand"  "0,0,r,0,0")
1009
 		   (match_operand:QI 2 "const_int_operand" "L,P,O,K,n")))
1010
    (clobber (match_scratch:QI 3 "=X,X,X,X,&d"))]
1011
   "reload_completed"
1012
@@ -1694,17 +1776,17 @@
1013
 
1014
 (define_peephole2
1015
   [(match_scratch:QI 3 "d")
1016
-   (set (match_operand:SI 0 "register_operand" "")
1017
-	(ashift:SI (match_operand:SI 1 "register_operand" "")
1018
+   (set (match_operand:ALLS 0 "register_operand" "")
1019
+	(ashift:ALLS (match_operand:ALLS 1 "register_operand" "")
1020
 		   (match_operand:QI 2 "const_int_operand" "")))]
1021
   ""
1022
-  [(parallel [(set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))
1023
+  [(parallel [(set (match_dup 0) (ashift:ALLS (match_dup 1) (match_dup 2)))
1024
 	      (clobber (match_dup 3))])]
1025
   "")
1026
 
1027
-(define_insn "*ashlsi3_const"
1028
-  [(set (match_operand:SI 0 "register_operand"            "=r,r,r,r")
1029
-	(ashift:SI (match_operand:SI 1 "register_operand"  "0,0,r,0")
1030
+(define_insn "*ashl<ALLS:mode>3_const"
1031
+  [(set (match_operand:ALLS 0 "register_operand"            "=r,r,r,r")
1032
+	(ashift:ALLS (match_operand:ALLS 1 "register_operand"  "0,0,r,0")
1033
 		   (match_operand:QI 2 "const_int_operand" "L,P,O,n")))
1034
    (clobber (match_scratch:QI 3 "=X,X,X,&d"))]
1035
   "reload_completed"
1036
@@ -1715,27 +1797,27 @@
1037
 ;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
1038
 ;; arithmetic shift right
1039
 
1040
-(define_insn "ashrqi3"
1041
-  [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r,r")
1042
-	(ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0")
1043
+(define_insn "ashr<ALLQ:mode>3"
1044
+  [(set (match_operand:ALLQ 0 "register_operand" "=r,r,r,r,r,r")
1045
+	(ashiftrt:ALLQ (match_operand:ALLQ 1 "register_operand" "0,0,0,0,0,0")
1046
 		     (match_operand:QI 2 "general_operand"  "r,L,P,K,n,Qm")))]
1047
   ""
1048
   "* return ashrqi3_out (insn, operands, NULL);"
1049
   [(set_attr "length" "5,0,1,2,5,9")
1050
    (set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber")])
1051
 
1052
-(define_insn "ashrhi3"
1053
-  [(set (match_operand:HI 0 "register_operand"             "=r,r,r,r,r,r,r")
1054
-	(ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0,0,r,0,0,0")
1055
+(define_insn "ashr<ALLH:mode>3"
1056
+  [(set (match_operand:ALLH 0 "register_operand"             "=r,r,r,r,r,r,r")
1057
+	(ashiftrt:ALLH (match_operand:ALLH 1 "register_operand" "0,0,0,r,0,0,0")
1058
 		     (match_operand:QI 2 "general_operand"  "r,L,P,O,K,n,Qm")))]
1059
   ""
1060
   "* return ashrhi3_out (insn, operands, NULL);"
1061
   [(set_attr "length" "6,0,2,4,4,10,10")
1062
    (set_attr "cc" "clobber,none,clobber,set_n,clobber,clobber,clobber")])
1063
 
1064
-(define_insn "ashrsi3"
1065
-  [(set (match_operand:SI 0 "register_operand"             "=r,r,r,r,r,r,r")
1066
-	(ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
1067
+(define_insn "ashr<ALLS:mode>3"
1068
+  [(set (match_operand:ALLS 0 "register_operand"             "=r,r,r,r,r,r,r")
1069
+	(ashiftrt:ALLS (match_operand:ALLS 1 "register_operand" "0,0,0,r,0,0,0")
1070
 		     (match_operand:QI 2 "general_operand"  "r,L,P,O,K,n,Qm")))]
1071
   ""
1072
   "* return ashrsi3_out (insn, operands, NULL);"
1073
@@ -1746,17 +1828,17 @@
1074
 
1075
 (define_peephole2
1076
   [(match_scratch:QI 3 "d")
1077
-   (set (match_operand:HI 0 "register_operand" "")
1078
-	(ashiftrt:HI (match_operand:HI 1 "register_operand" "")
1079
+   (set (match_operand:ALLH 0 "register_operand" "")
1080
+	(ashiftrt:ALLH (match_operand:ALLH 1 "register_operand" "")
1081
 		     (match_operand:QI 2 "const_int_operand" "")))]
1082
   ""
1083
-  [(parallel [(set (match_dup 0) (ashiftrt:HI (match_dup 1) (match_dup 2)))
1084
+  [(parallel [(set (match_dup 0) (ashiftrt:ALLH (match_dup 1) (match_dup 2)))
1085
 	      (clobber (match_dup 3))])]
1086
   "")
1087
 
1088
 (define_insn "*ashrhi3_const"
1089
-  [(set (match_operand:HI 0 "register_operand"              "=r,r,r,r,r")
1090
-	(ashiftrt:HI (match_operand:HI 1 "register_operand"  "0,0,r,0,0")
1091
+  [(set (match_operand:ALLH 0 "register_operand"              "=r,r,r,r,r")
1092
+	(ashiftrt:ALLH (match_operand:ALLH 1 "register_operand"  "0,0,r,0,0")
1093
 		     (match_operand:QI 2 "const_int_operand" "L,P,O,K,n")))
1094
    (clobber (match_scratch:QI 3 "=X,X,X,X,&d"))]
1095
   "reload_completed"
1096
@@ -1766,17 +1848,17 @@
1097
 
1098
 (define_peephole2
1099
   [(match_scratch:QI 3 "d")
1100
-   (set (match_operand:SI 0 "register_operand" "")
1101
-	(ashiftrt:SI (match_operand:SI 1 "register_operand" "")
1102
+   (set (match_operand:ALLS 0 "register_operand" "")
1103
+	(ashiftrt:ALLS (match_operand:ALLS 1 "register_operand" "")
1104
 		     (match_operand:QI 2 "const_int_operand" "")))]
1105
   ""
1106
-  [(parallel [(set (match_dup 0) (ashiftrt:SI (match_dup 1) (match_dup 2)))
1107
+  [(parallel [(set (match_dup 0) (ashiftrt:ALLS (match_dup 1) (match_dup 2)))
1108
 	      (clobber (match_dup 3))])]
1109
   "")
1110
 
1111
 (define_insn "*ashrsi3_const"
1112
-  [(set (match_operand:SI 0 "register_operand"              "=r,r,r,r")
1113
-	(ashiftrt:SI (match_operand:SI 1 "register_operand"  "0,0,r,0")
1114
+  [(set (match_operand:ALLS 0 "register_operand"              "=r,r,r,r")
1115
+	(ashiftrt:ALLS (match_operand:ALLS 1 "register_operand"  "0,0,r,0")
1116
 		     (match_operand:QI 2 "const_int_operand" "L,P,O,n")))
1117
    (clobber (match_scratch:QI 3 "=X,X,X,&d"))]
1118
   "reload_completed"
1119
@@ -1787,54 +1869,54 @@
1120
 ;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
1121
 ;; logical shift right
1122
 
1123
-(define_expand "lshrqi3"
1124
-  [(set (match_operand:QI 0 "register_operand"              "")
1125
-	(lshiftrt:QI (match_operand:QI 1 "register_operand" "")
1126
-		     (match_operand:QI 2 "general_operand"  "")))]
1127
+(define_expand "lshr<ALLQ:mode>3"
1128
+  [(set (match_operand:ALLQ 0 "register_operand"              "")
1129
+	(lshiftrt:ALLQ (match_operand:ALLQ 1 "register_operand" "")
1130
+		     (match_operand:ALLQ 2 "general_operand"  "")))]
1131
   ""
1132
   "")
1133
 
1134
 (define_split	; lshrqi3_const4
1135
-  [(set (match_operand:QI 0 "d_register_operand" "")
1136
-	(lshiftrt:QI (match_dup 0)
1137
+  [(set (match_operand:ALLQ 0 "d_register_operand" "")
1138
+	(lshiftrt:ALLQ (match_dup 0)
1139
 		     (const_int 4)))]
1140
   ""
1141
-  [(set (match_dup 0) (rotate:QI (match_dup 0) (const_int 4)))
1142
-   (set (match_dup 0) (and:QI (match_dup 0) (const_int 15)))]
1143
+  [(set (match_dup 0) (rotate:ALLQ (match_dup 0) (const_int 4)))
1144
+   (set (match_dup 0) (and:ALLQ (match_dup 0) (const_int 15)))]
1145
   "")
1146
 
1147
 (define_split	; lshrqi3_const5
1148
-  [(set (match_operand:QI 0 "d_register_operand" "")
1149
-	(lshiftrt:QI (match_dup 0)
1150
+  [(set (match_operand:ALLQ 0 "d_register_operand" "")
1151
+	(lshiftrt:ALLQ (match_dup 0)
1152
 		     (const_int 5)))]
1153
   ""
1154
-  [(set (match_dup 0) (rotate:QI (match_dup 0) (const_int 4)))
1155
-   (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 1)))
1156
-   (set (match_dup 0) (and:QI (match_dup 0) (const_int 7)))]
1157
+  [(set (match_dup 0) (rotate:ALLQ (match_dup 0) (const_int 4)))
1158
+   (set (match_dup 0) (lshiftrt:ALLQ (match_dup 0) (const_int 1)))
1159
+   (set (match_dup 0) (and:ALLQ (match_dup 0) (const_int 7)))]
1160
   "")
1161
 
1162
 (define_split	; lshrqi3_const6
1163
-  [(set (match_operand:QI 0 "d_register_operand" "")
1164
-	(lshiftrt:QI (match_dup 0)
1165
+  [(set (match_operand:ALLQ 0 "d_register_operand" "")
1166
+	(lshiftrt:ALLQ (match_dup 0)
1167
 		     (const_int 6)))]
1168
   ""
1169
-  [(set (match_dup 0) (rotate:QI (match_dup 0) (const_int 4)))
1170
-   (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 2)))
1171
-   (set (match_dup 0) (and:QI (match_dup 0) (const_int 3)))]
1172
+  [(set (match_dup 0) (rotate:ALLQ (match_dup 0) (const_int 4)))
1173
+   (set (match_dup 0) (lshiftrt:ALLQ (match_dup 0) (const_int 2)))
1174
+   (set (match_dup 0) (and:ALLQ (match_dup 0) (const_int 3)))]
1175
   "")
1176
 
1177
 (define_insn "*lshrqi3"
1178
-  [(set (match_operand:QI 0 "register_operand"             "=r,r,r,r,!d,r,r")
1179
-	(lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
1180
-		     (match_operand:QI 2 "general_operand"  "r,L,P,K,n,n,Qm")))]
1181
+  [(set (match_operand:ALLQ 0 "register_operand"             "=r,r,r,r,!d,r,r")
1182
+	(lshiftrt:ALLQ (match_operand:ALLQ 1 "register_operand" "0,0,0,0,0,0,0")
1183
+		     (match_operand:ALLQ 2 "general_operand"  "r,L,P,K,n,n,Qm")))]
1184
   ""
1185
   "* return lshrqi3_out (insn, operands, NULL);"
1186
   [(set_attr "length" "5,0,1,2,4,6,9")
1187
    (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
1188
 
1189
-(define_insn "lshrhi3"
1190
-  [(set (match_operand:HI 0 "register_operand"             "=r,r,r,r,r,r,r")
1191
-	(lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0,0,r,0,0,0")
1192
+(define_insn "lshr<ALLH:mode>3"
1193
+  [(set (match_operand:ALLH 0 "register_operand"             "=r,r,r,r,r,r,r")
1194
+	(lshiftrt:ALLH (match_operand:ALLH 1 "register_operand" "0,0,0,r,0,0,0")
1195
 		     (match_operand:QI 2 "general_operand"  "r,L,P,O,K,n,Qm")))]
1196
   ""
1197
   "* return lshrhi3_out (insn, operands, NULL);"
1198
@@ -1889,17 +1971,17 @@
1199
 
1200
 (define_peephole2
1201
   [(match_scratch:QI 3 "d")
1202
-   (set (match_operand:HI 0 "register_operand" "")
1203
-	(lshiftrt:HI (match_operand:HI 1 "register_operand" "")
1204
+   (set (match_operand:ALLH 0 "register_operand" "")
1205
+	(lshiftrt:ALLH (match_operand:ALLH 1 "register_operand" "")
1206
 		     (match_operand:QI 2 "const_int_operand" "")))]
1207
   ""
1208
-  [(parallel [(set (match_dup 0) (lshiftrt:HI (match_dup 1) (match_dup 2)))
1209
+  [(parallel [(set (match_dup 0) (lshiftrt:ALLH (match_dup 1) (match_dup 2)))
1210
 	      (clobber (match_dup 3))])]
1211
   "")
1212
 
1213
-(define_insn "*lshrhi3_const"
1214
-  [(set (match_operand:HI 0 "register_operand"              "=r,r,r,r,r")
1215
-	(lshiftrt:HI (match_operand:HI 1 "register_operand"  "0,0,r,0,0")
1216
+(define_insn "*lshr<ALLH:mode>3_const"
1217
+  [(set (match_operand:ALLH 0 "register_operand"              "=r,r,r,r,r")
1218
+	(lshiftrt:ALLH (match_operand:ALLH 1 "register_operand"  "0,0,r,0,0")
1219
 		     (match_operand:QI 2 "const_int_operand" "L,P,O,K,n")))
1220
    (clobber (match_scratch:QI 3 "=X,X,X,X,&d"))]
1221
   "reload_completed"
1222
@@ -1917,9 +1999,9 @@
1223
 	      (clobber (match_dup 3))])]
1224
   "")
1225
 
1226
-(define_insn "*lshrsi3_const"
1227
-  [(set (match_operand:SI 0 "register_operand"              "=r,r,r,r")
1228
-	(lshiftrt:SI (match_operand:SI 1 "register_operand"  "0,0,r,0")
1229
+(define_insn "*lshr<ALLS:mode>3_const"
1230
+  [(set (match_operand:ALLS 0 "register_operand"              "=r,r,r,r")
1231
+	(lshiftrt:ALLS (match_operand:ALLS 1 "register_operand"  "0,0,r,0")
1232
 		     (match_operand:QI 2 "const_int_operand" "L,P,O,n")))
1233
    (clobber (match_scratch:QI 3 "=X,X,X,&d"))]
1234
   "reload_completed"
1235
@@ -2163,27 +2245,27 @@
1236
 ;; compare
1237
 
1238
 ; Optimize negated tests into reverse compare if overflow is undefined.
1239
-(define_insn "*negated_tstqi"
1240
+(define_insn "*negated_tst<ALLQ:mode>"
1241
   [(set (cc0)
1242
-        (compare (neg:QI (match_operand:QI 0 "register_operand" "r"))
1243
+        (compare (neg:ALLQ (match_operand:ALLQ 0 "register_operand" "r"))
1244
 		 (const_int 0)))]
1245
   "(!flag_wrapv && !flag_trapv && flag_strict_overflow)"
1246
   "cp __zero_reg__,%0"
1247
   [(set_attr "cc" "compare")
1248
    (set_attr "length" "1")])
1249
 
1250
-(define_insn "*reversed_tstqi"
1251
+(define_insn "*reversed_tst<ALLQ:mode>"
1252
   [(set (cc0)
1253
         (compare (const_int 0)
1254
-		 (match_operand:QI 0 "register_operand" "r")))]
1255
+		 (match_operand:ALLQ 0 "register_operand" "r")))]
1256
   ""
1257
   "cp __zero_reg__,%0"
1258
 [(set_attr "cc" "compare")
1259
  (set_attr "length" "2")])
1260
 
1261
-(define_insn "*negated_tsthi"
1262
+(define_insn "*negated_tst<ALLH:mode>"
1263
   [(set (cc0)
1264
-        (compare (neg:HI (match_operand:HI 0 "register_operand" "r"))
1265
+        (compare (neg:ALLH (match_operand:ALLH 0 "register_operand" "r"))
1266
 		 (const_int 0)))]
1267
   "(!flag_wrapv && !flag_trapv && flag_strict_overflow)"
1268
   "cp __zero_reg__,%A0
1269
@@ -2193,10 +2275,10 @@
1270
 
1271
 ;; Leave here the clobber used by the cmphi pattern for simplicity, even
1272
 ;; though it is unused, because this pattern is synthesized by avr_reorg.
1273
-(define_insn "*reversed_tsthi"
1274
+(define_insn "*reversed_tst<ALLH:mode>"
1275
   [(set (cc0)
1276
         (compare (const_int 0)
1277
-		 (match_operand:HI 0 "register_operand" "r")))
1278
+		 (match_operand:ALLH 0 "register_operand" "r")))
1279
    (clobber (match_scratch:QI 1 "=X"))]
1280
   ""
1281
   "cp __zero_reg__,%A0
1282
@@ -2204,9 +2286,9 @@
1283
 [(set_attr "cc" "compare")
1284
  (set_attr "length" "2")])
1285
 
1286
-(define_insn "*negated_tstsi"
1287
+(define_insn "*negated_tst<ALLS:mode>"
1288
   [(set (cc0)
1289
-        (compare (neg:SI (match_operand:SI 0 "register_operand" "r"))
1290
+        (compare (neg:ALLS (match_operand:ALLS 0 "register_operand" "r"))
1291
 		 (const_int 0)))]
1292
   "(!flag_wrapv && !flag_trapv && flag_strict_overflow)"
1293
   "cp __zero_reg__,%A0
1294
@@ -2216,10 +2298,10 @@
1295
   [(set_attr "cc" "compare")
1296
    (set_attr "length" "4")])
1297
 
1298
-(define_insn "*reversed_tstsi"
1299
+(define_insn "*reversed_tst<ALLS:mode>"
1300
   [(set (cc0)
1301
         (compare (const_int 0)
1302
-		 (match_operand:SI 0 "register_operand" "r")))
1303
+		 (match_operand:ALLS 0 "register_operand" "r")))
1304
    (clobber (match_scratch:QI 1 "=X"))]
1305
   ""
1306
   "cp __zero_reg__,%A0
1307
@@ -2230,10 +2312,10 @@
1308
    (set_attr "length" "4")])
1309
 
1310
 
1311
-(define_insn "*cmpqi"
1312
+(define_insn "*cmp<ALLQ:mode>"
1313
   [(set (cc0)
1314
-        (compare (match_operand:QI 0 "register_operand"  "r,r,d")
1315
-		 (match_operand:QI 1 "nonmemory_operand" "L,r,i")))]
1316
+        (compare (match_operand:ALLQ 0 "register_operand"  "r,r,d")
1317
+		 (match_operand:ALLQ 1 "nonmemory_operand" "L,r,i")))]
1318
   ""
1319
   "@
1320
 	tst %0
1321
@@ -2252,10 +2334,10 @@
1322
   [(set_attr "cc" "compare")
1323
    (set_attr "length" "1")])
1324
 
1325
-(define_insn "*cmphi"
1326
+(define_insn "*cmp<ALLH:mode>"
1327
   [(set (cc0)
1328
-	(compare (match_operand:HI 0 "register_operand"  "!w,r,r,d,d,r,r")
1329
-		 (match_operand:HI 1 "nonmemory_operand" "L,L,r,M,i,M,i")))
1330
+	(compare (match_operand:ALLH 0 "register_operand"  "!w,r,r,d,d,r,r")
1331
+		 (match_operand:ALLH 1 "nonmemory_operand" "L,L,r,M,i,M,i")))
1332
    (clobber (match_scratch:QI 2 "=X,X,X,X,&d,&d,&d"))]
1333
   ""
1334
   "*{
1335
@@ -2300,10 +2382,10 @@
1336
    (set_attr "length" "1,2,2,2,3,3,4")])
1337
 
1338
 
1339
-(define_insn "*cmpsi"
1340
+(define_insn "*cmp<ALLS:mode>"
1341
   [(set (cc0)
1342
-	(compare (match_operand:SI 0 "register_operand"  "r,r,d,d,r,r")
1343
-		 (match_operand:SI 1 "nonmemory_operand" "L,r,M,i,M,i")))
1344
+	(compare (match_operand:ALLS 0 "register_operand"  "r,r,d,d,r,r")
1345
+		 (match_operand:ALLS 1 "nonmemory_operand" "L,r,M,i,M,i")))
1346
    (clobber (match_scratch:QI 2 "=X,X,X,&d,&d,&d"))]
1347
   ""
1348
   "*{
1349
diff -rupN gcc/config/avr/avr-modes.def gcc/config/avr/avr-modes.def
1350
--- gcc/config/avr/avr-modes.def	1969-12-31 18:00:00.000000000 -0600
1351
+++ gcc/config/avr/avr-modes.def	2010-09-21 14:31:30.000000000 -0500
1352
@@ -0,0 +1,34 @@
1353
+/* Definitions of target machine for GCC for AVR.
1354
+   Copyright (C) 2009 Free Software Foundation, Inc.
1355
+
1356
+This file is part of GCC.
1357
+
1358
+GCC is free software; you can redistribute it and/or modify
1359
+it under the terms of the GNU General Public License as published by
1360
+the Free Software Foundation; either version 3, or (at your option)
1361
+any later version.
1362
+
1363
+GCC is distributed in the hope that it will be useful,
1364
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1365
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1366
+GNU General Public License for more details.
1367
+
1368
+You should have received a copy of the GNU General Public License
1369
+along with GCC; see the file COPYING3.  If not see
1370
+<http://www.gnu.org/licenses/>.  */
1371
+
1372
+/* On 8 bit machines it requires fewer instructions for fixed point
1373
+   routines if the decimal place is on a byte boundary which is not
1374
+   the default for signed accum types.  */
1375
+
1376
+ADJUST_IBIT (HA, 7);
1377
+ADJUST_FBIT (HA, 8);
1378
+
1379
+ADJUST_IBIT (SA, 15);
1380
+ADJUST_FBIT (SA, 16);
1381
+
1382
+ADJUST_IBIT (DA, 31);
1383
+ADJUST_FBIT (DA, 32);
1384
+
1385
+ADJUST_IBIT (TA, 63);
1386
+ADJUST_FBIT (TA, 64);
1387
diff -rupN gcc/config/avr/avr-protos.h gcc/config/avr/avr-protos.h
1388
--- gcc/config/avr/avr-protos.h	2010-01-08 17:01:45.000000000 -0600
1389
+++ gcc/config/avr/avr-protos.h	2010-09-21 14:31:30.000000000 -0500
1390
@@ -84,6 +84,8 @@ extern const char *lshrhi3_out (rtx insn
1391
 extern const char *lshrsi3_out (rtx insn, rtx operands[], int *len);
1392
 extern bool avr_rotate_bytes (rtx operands[]);
1393
 
1394
+extern const char *fract_out (rtx insn, rtx operands[], int intsigned, int *l);
1395
+
1396
 extern void expand_prologue (void);
1397
 extern void expand_epilogue (void);
1398
 extern int avr_epilogue_uses (int regno);
1399
diff -rupN gcc/config/avr/libgcc-fixed.S gcc/config/avr/libgcc-fixed.S
1400
--- gcc/config/avr/libgcc-fixed.S	1969-12-31 18:00:00.000000000 -0600
1401
+++ gcc/config/avr/libgcc-fixed.S	2010-09-21 14:31:30.000000000 -0500
1402
@@ -0,0 +1,1123 @@
1403
+/*  -*- Mode: Asm -*-  */
1404
+/* Copyright (C) 2009
1405
+   Free Software Foundation, Inc.
1406
+   Contributed by Sean D'Epagnier
1407
+
1408
+This file is free software; you can redistribute it and/or modify it
1409
+under the terms of the GNU General Public License as published by the
1410
+Free Software Foundation; either version 3, or (at your option) any
1411
+later version.
1412
+
1413
+In addition to the permissions in the GNU General Public License, the
1414
+Free Software Foundation gives you unlimited permission to link the
1415
+compiled version of this file into combinations with other programs,
1416
+and to distribute those combinations without any restriction coming
1417
+from the use of this file.  (The General Public License restrictions
1418
+do apply in other respects; for example, they cover modification of
1419
+the file, and distribution when not linked into a combine
1420
+executable.)
1421
+
1422
+This file is distributed in the hope that it will be useful, but
1423
+WITHOUT ANY WARRANTY; without even the implied warranty of
1424
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1425
+General Public License for more details.
1426
+
1427
+You should have received a copy of the GNU General Public License
1428
+along with this program; see the file COPYING.  If not, write to
1429
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
1430
+Boston, MA 02110-1301, USA.  */
1431
+
1432
+/* Fixed point library routines for avr.  */
1433
+
1434
+#define __zero_reg__ r1
1435
+#define __tmp_reg__ r0
1436
+#define __SREG__ 0x3f
1437
+#define __SP_H__ 0x3e
1438
+#define __SP_L__ 0x3d
1439
+#define __RAMPZ__ 0x3B
1440
+
1441
+/* Conversions to float.  */
1442
+#if defined (L_fractqqsf)
1443
+        .global __fractqqsf
1444
+        .func __fractqqsf
1445
+__fractqqsf:
1446
+        clr     r25
1447
+        sbrc    r24, 7          ; if negative
1448
+        ser     r25             ; sign extend
1449
+        mov     r23, r24        ; move in place
1450
+        mov     r24, r25        ; sign extend lower byte
1451
+        lsl     r23
1452
+        clr     r22
1453
+        rjmp __fractsasf        ; call larger conversion
1454
+.endfunc
1455
+#endif  /* defined (L_fractqqsf) */
1456
+
1457
+#if defined (L_fractuqqsf)        
1458
+        .global __fractuqqsf
1459
+        .func __fractuqqsf
1460
+__fractuqqsf:
1461
+        clr     r22
1462
+        mov     r23, r24
1463
+        clr     r24
1464
+        clr     r25
1465
+        rjmp __fractsasf        ; call larger conversion
1466
+.endfunc
1467
+#endif  /* defined (L_fractuqqsf) */
1468
+        
1469
+#if defined (L_fracthqsf)        
1470
+        .global __fracthqsf
1471
+        .func __fracthqsf
1472
+__fracthqsf:
1473
+        mov_l	r22, r24        ; put fractional part in place
1474
+	mov_h	r23, r25
1475
+        clr     r25
1476
+        sbrc    r23, 7          ; if negative
1477
+        ser     r25             ; sign extend
1478
+        mov     r24, r25        ; sign extend lower byte
1479
+        lsl     r22
1480
+        rol     r23
1481
+        rjmp    __fractsasf        ; call larger conversion
1482
+.endfunc
1483
+#endif  /* defined (L_fracthqsf) */
1484
+
1485
+#if defined (L_fractuhqsf)        
1486
+        .global __fractuhqsf
1487
+        .func __fractuhqsf
1488
+__fractuhqsf:
1489
+        mov_l	r22, r24        ; put fractional part in place
1490
+	mov_h	r23, r25
1491
+        clr     r24
1492
+        clr     r25
1493
+        rjmp __fractsasf        ; call larger conversion
1494
+.endfunc
1495
+#endif  /* defined (L_fractuhqsf) */
1496
+
1497
+#if defined (L_fracthasf)        
1498
+        .global __fracthasf
1499
+        .func __fracthasf
1500
+__fracthasf:
1501
+        clr     r22
1502
+        mov     r23, r24        ; move into place
1503
+        mov     r24, r25
1504
+        clr     r25
1505
+        sbrc    r24, 7          ; if negative
1506
+        ser     r25             ; sign extend
1507
+        rjmp __fractsasf        ; call larger conversion
1508
+#endif  /* defined (L_fracthasf) */
1509
+
1510
+#if defined (L_fractuhasf)        
1511
+        .global __fractuhasf
1512
+        .func __fractuhasf
1513
+__fractuhasf:
1514
+        clr     r22
1515
+        mov     r23, r24        ; move into place
1516
+        rjmp __fractsasf        ; call larger conversion
1517
+.endfunc
1518
+#endif  /* defined (L_fractuhasf) */
1519
+
1520
+#if defined (L_fractsasf)        
1521
+        .global __fractsasf
1522
+        .func __fractsasf
1523
+__fractsasf:
1524
+        rcall __floatsisf
1525
+        tst     r25
1526
+        breq __fractsasf_exit   ; skip if zero
1527
+        subi r25, 0x08          ; adjust exponent
1528
+__fractsasf_exit:
1529
+        ret
1530
+.endfunc
1531
+#endif  /* defined (L_fractsasf) */
1532
+
1533
+#if defined (L_fractusasf)        
1534
+        .global __fractusasf
1535
+        .func __fractusasf
1536
+__fractusasf:
1537
+        rcall   __floatunsisf
1538
+        tst     r25
1539
+        breq    __fractusasf_exit  ; skip if zero
1540
+        subi    r25, 0x08         ; adjust exponent
1541
+__fractusasf_exit:
1542
+        ret
1543
+.endfunc
1544
+#endif  /* defined (L_fractusasf) */
1545
+
1546
+#if defined (L_fractsfqq)        /* Conversions from float.  */
1547
+        .global __fractsfqq
1548
+        .func __fractsfqq
1549
+__fractsfqq:
1550
+        subi    r25, -11        ; adjust exponent
1551
+        subi    r24, 128
1552
+        rjmp    __fixsfsi
1553
+.endfunc
1554
+#endif  /* defined (L_fractqq) */
1555
+
1556
+#if defined (L_fractsfuqq)        
1557
+        .global __fractsfuqq
1558
+        .func __fractsfuqq
1559
+__fractsfuqq:
1560
+        subi    r25, -12        ; adjust exponent
1561
+        rjmp    __fixsfsi
1562
+.endfunc
1563
+#endif  /* defined (L_fractuqq) */
1564
+
1565
+#if defined (L_fractsfhq)        
1566
+        .global __fractsfhq
1567
+        .func __fractsfhq
1568
+__fractsfhq:
1569
+        subi    r25, -15        ; adjust exponent
1570
+        subi    r24, 128
1571
+        rjmp    __fixsfsi
1572
+.endfunc
1573
+#endif  /* defined (L_fractsfhq) */
1574
+
1575
+#if defined (L_fractsfuhq)        
1576
+        .global __fractsfuhq
1577
+        .func __fractsfuhq
1578
+__fractsfuhq:
1579
+        subi    r25, -16        ; adjust exponent
1580
+        rjmp    __fixsfsi
1581
+.endfunc
1582
+#endif  /* defined (L_fractsfuhq) */
1583
+
1584
+#if defined (L_fractsfha)
1585
+        .global __fractsfha
1586
+        .func __fractsfha
1587
+__fractsfha:
1588
+.endfunc
1589
+        .global __fractsfuha
1590
+        .func __fractsfuha
1591
+__fractsfuha:
1592
+        subi    r25, -12        ; adjust exponent
1593
+        rjmp    __fixsfsi
1594
+.endfunc
1595
+#endif  /* defined (L_fractsfha) */
1596
+
1597
+#if defined (L_fractsfsa)
1598
+        .global __fractsfsa
1599
+        .func __fractsfsa
1600
+__fractsfsa:
1601
+.endfunc
1602
+        .global __fractsfusa
1603
+        .func __fractsfusa
1604
+__fractsfusa:
1605
+        subi    r25, -8        ; adjust exponent
1606
+        rjmp    __fixsfsi
1607
+.endfunc
1608
+#endif  /* defined (L_fractsfsa) */
1609
+
1610
+/* For multiplication the functions here are called directly from
1611
+   avr-fixed.md patterns, instead of using the standard libcall mechanisms.
1612
+   This can make better code because GCC knows exactly which
1613
+   of the call-used registers (not all of them) are clobbered.  */
1614
+        
1615
+/* mulqq and muluqq open coded on the enhanced core */
1616
+#if !defined (__AVR_HAVE_MUL__)
1617
+/*******************************************************
1618
+        Fractional Multiplication  8 x 8
1619
+*******************************************************/
1620
+#define	r_arg2	r22		/* multiplicand */
1621
+#define	r_arg1 	r24		/* multiplier */
1622
+#define r_res	__tmp_reg__	/* result */
1623
+
1624
+#if defined (L_mulqq3)        
1625
+	.global	__mulqq3
1626
+       	.func	__mulqq3
1627
+__mulqq3:
1628
+        mov     r_res, r_arg1
1629
+        eor     r_res, r_arg2
1630
+        bst     r_res, 7
1631
+        lsl     r_arg1             
1632
+        lsl     r_arg2
1633
+        brcc    __mulqq3_skipneg
1634
+        neg     r_arg2
1635
+__mulqq3_skipneg: 
1636
+        rcall   __muluqq3
1637
+        lsr     r_arg1
1638
+        brtc    __mulqq3_exit
1639
+        neg     r_arg1
1640
+__mulqq3_exit:
1641
+        ret
1642
+
1643
+.endfunc
1644
+#endif  /* defined (L_mulqq3) */
1645
+
1646
+#if defined (L_muluqq3)        
1647
+	.global	__muluqq3
1648
+	.func	__muluqq3
1649
+__muluqq3:
1650
+	clr	r_res		; clear result
1651
+__muluqq3_loop:
1652
+	lsr	r_arg2          ; shift multiplicand
1653
+	sbrc	r_arg1,7
1654
+	add	r_res,r_arg2
1655
+	breq	__muluqq3_exit	; while multiplicand != 0
1656
+	lsl	r_arg1
1657
+	brne	__muluqq3_loop	; exit if multiplier = 0
1658
+__muluqq3_exit:
1659
+	mov	r_arg1,r_res	; result to return register
1660
+	ret
1661
+#undef r_arg2  
1662
+#undef r_arg1  
1663
+#undef r_res   
1664
+	
1665
+.endfunc
1666
+#endif  /* defined (L_muluqq3) */
1667
+#endif /* !defined (__AVR_HAVE_MUL__) */
1668
+
1669
+/*******************************************************
1670
+        Fractional  Multiplication  16 x 16
1671
+*******************************************************/
1672
+
1673
+#if defined (__AVR_HAVE_MUL__)
1674
+#define	r_arg1L	r22		/* multiplier Low */
1675
+#define	r_arg1H	r23		/* multiplier High */
1676
+#define	r_arg2L	r20		/* multiplicand Low */
1677
+#define	r_arg2H	r21		/* multiplicand High */
1678
+#define r_resL	r18     	/* result Low */
1679
+#define r_resH  r19	        /* result High */
1680
+
1681
+#if defined (L_mulhq3)
1682
+      	.global	__mulhq3
1683
+	.func	__mulhq3
1684
+__mulhq3:
1685
+        fmuls   r_arg1H, r_arg2H
1686
+        movw    r_resL, r0
1687
+        fmulsu  r_arg2H, r_arg1L
1688
+        clr     r_arg1L
1689
+        sbc     r_resH, r_arg1L
1690
+        add     r_resL, r1
1691
+        adc     r_resH, r_arg1L
1692
+        fmulsu  r_arg1H, r_arg2L
1693
+        sbc     r_resH, r_arg1L
1694
+        add     r_resL, r1
1695
+        adc     r_resH, r_arg1L
1696
+        clr     __zero_reg__
1697
+        ret
1698
+.endfunc
1699
+#endif  /* defined (L_mulhq3) */
1700
+
1701
+#if defined (L_muluhq3)        
1702
+	.global	__muluhq3
1703
+	.func	__muluhq3
1704
+__muluhq3:
1705
+        mul     r_arg1H, r_arg2H
1706
+        movw    r_resL, r0
1707
+        mul     r_arg1H, r_arg2L
1708
+        add     r_resL, r1
1709
+        clr     __zero_reg__
1710
+        adc     r_resH, __zero_reg__
1711
+        mul     r_arg1L, r_arg2H
1712
+        add     r_resL, r1
1713
+        clr     __zero_reg__
1714
+        adc     r_resH, __zero_reg__
1715
+        ret
1716
+.endfunc
1717
+#endif  /* defined (L_muluhq3) */
1718
+
1719
+#else
1720
+#define	r_arg1L	r24		/* multiplier Low */
1721
+#define	r_arg1H	r25		/* multiplier High */
1722
+#define	r_arg2L	r22		/* multiplicand Low */
1723
+#define	r_arg2H	r23		/* multiplicand High */
1724
+#define r_resL	__tmp_reg__	/* result Low */
1725
+#define r_resH  __zero_reg__	/* result High */
1726
+
1727
+#if defined (L_mulhq3)        
1728
+      	.global	__mulhq3
1729
+	.func	__mulhq3
1730
+__mulhq3:
1731
+        mov     r_resL, r_arg1H
1732
+        eor     r_resL, r_arg2H
1733
+        bst     r_resL, 7
1734
+        lsl     r_arg1L
1735
+        rol     r_arg1H
1736
+        lsl     r_arg2L
1737
+        rol     r_arg2H
1738
+        brcc    mulhq3_skipneg
1739
+        com     r_arg2H
1740
+        neg     r_arg2L
1741
+        sbci    r_arg2H, -1
1742
+mulhq3_skipneg:
1743
+        rcall   __muluhq3
1744
+        lsr     r_arg1H
1745
+        ror     r_arg1L
1746
+        brtc    mulhq3_exit
1747
+        com     r_arg1H
1748
+        neg     r_arg1L
1749
+        sbci    r_arg1H, -1
1750
+mulhq3_exit:
1751
+        ret
1752
+.endfunc
1753
+#endif  /* defined (L_mulhq3) */
1754
+
1755
+#if defined (L_muluhq3)
1756
+	.global	__muluhq3
1757
+	.func	__muluhq3
1758
+__muluhq3:
1759
+	clr	r_resL		; clear result
1760
+__muluhq3_loop:
1761
+	lsr	r_arg2H		; shift multiplicand
1762
+	ror	r_arg2L
1763
+        sbrs	r_arg1H,7
1764
+	rjmp	__muluhq3_skip
1765
+	add	r_resL,r_arg2L	; result + multiplicand
1766
+	adc	r_resH,r_arg2H
1767
+__muluhq3_skip:	
1768
+	lsl	r_arg1L 	; shift multiplier
1769
+	rol	r_arg1H
1770
+        brne    __muluhq3_loop
1771
+        cpi     r_arg1L, 0
1772
+        brne    __muluhq3_loop   ; exit multiplier = 0
1773
+	mov_l	r_arg1L,r_resL
1774
+	mov_h	r_arg1H,r_resH	; result to return register
1775
+        clr     __zero_reg__    ; zero the zero reg
1776
+	ret
1777
+.endfunc
1778
+#endif  /* defined (L_muluhq3) */
1779
+
1780
+#endif /* defined (__AVR_HAVE_MUL__) */
1781
+
1782
+#undef r_arg1L
1783
+#undef r_arg1H
1784
+#undef r_arg2L
1785
+#undef r_arg2H
1786
+#undef r_resL 	
1787
+#undef r_resH 
1788
+
1789
+/*******************************************************
1790
+        Fixed  Multiplication  8.8 x 8.8
1791
+*******************************************************/
1792
+
1793
+#if defined (__AVR_HAVE_MUL__)
1794
+#define	r_arg1L	r22		/* multiplier Low */
1795
+#define	r_arg1H	r23		/* multiplier High */
1796
+#define	r_arg2L	r20		/* multiplicand Low */
1797
+#define	r_arg2H	r21		/* multiplicand High */
1798
+#define r_resL	r18     	/* result Low */
1799
+#define r_resH  r19	        /* result High */
1800
+
1801
+#if defined (L_mulha3)
1802
+	.global	__mulha3
1803
+	.func	__mulha3
1804
+__mulha3:
1805
+        mul     r_arg1L, r_arg2L
1806
+        mov     r_resL, r1
1807
+        muls    r_arg1H, r_arg2H
1808
+        mov     r_resH, r0
1809
+        mulsu   r_arg1H, r_arg2L
1810
+        add     r_resL, r0
1811
+        adc     r_resH, r1
1812
+        mulsu   r_arg2H, r_arg1L
1813
+        add     r_resL, r0
1814
+        adc     r_resH, r1
1815
+        clr     __zero_reg__
1816
+        ret
1817
+.endfunc
1818
+#endif  /* defined (L_mulha3) */
1819
+
1820
+#if defined (L_muluha3)        
1821
+	.global	__muluha3
1822
+	.func	__muluha3
1823
+__muluha3:
1824
+        mul     r_arg1L, r_arg2L
1825
+        mov     r_resL, r1
1826
+        mul     r_arg1H, r_arg2H
1827
+        mov     r_resH, r0
1828
+        mul     r_arg1H, r_arg2L
1829
+        add     r_resL, r0
1830
+        adc     r_resH, r1
1831
+        mul     r_arg1L, r_arg2H
1832
+        add     r_resL, r0
1833
+        adc     r_resH, r1
1834
+        clr     __zero_reg__
1835
+        ret
1836
+.endfunc
1837
+#endif  /* defined (L_muluha3) */
1838
+
1839
+#else
1840
+
1841
+#define	r_arg1L	r24		/* multiplier Low */
1842
+#define	r_arg1H	r25		/* multiplier High */
1843
+#define	r_arg2L	r22		/* multiplicand Low */
1844
+#define	r_arg2H	r23		/* multiplicand High */
1845
+#define r_resL	r18     	/* result Low */
1846
+#define r_resH  r19	        /* result High */
1847
+#define r_scratchL  r0     	/* scratch Low */
1848
+#define r_scratchH  r1
1849
+
1850
+#if defined (L_mulha3)
1851
+       	.global	__mulha3
1852
+	.func	__mulha3
1853
+__mulha3:
1854
+        mov     r_resL, r_arg1H
1855
+        eor     r_resL, r_arg2H
1856
+        bst     r_resL, 7
1857
+        sbrs    r_arg1H, 7
1858
+        rjmp    __mulha3_arg1pos
1859
+        com     r_arg1H
1860
+        neg     r_arg1L
1861
+        sbci    r_arg1H,-1
1862
+__mulha3_arg1pos:
1863
+        sbrs    r_arg2H, 7
1864
+        rjmp    __mulha3_arg2pos
1865
+        com     r_arg2H
1866
+        neg     r_arg2L
1867
+        sbci    r_arg2H,-1
1868
+__mulha3_arg2pos:
1869
+        rcall   __muluha3
1870
+        brtc    __mulha3_exit
1871
+        com     r_resH
1872
+        neg     r_resL
1873
+        sbci    r_resH,-1
1874
+__mulha3_exit:
1875
+        ret
1876
+.endfunc        
1877
+#endif 	/* defined (L_mulha3) */
1878
+
1879
+#if defined (L_muluha3)        
1880
+       	.global	__muluha3
1881
+	.func	__muluha3
1882
+__muluha3:
1883
+	clr	r_resL		; clear result
1884
+        clr     r_resH
1885
+        mov_l   r0, r_arg1L     ; save multiplicand
1886
+        mov_h   r1, r_arg1H
1887
+__muluha3_loop1:
1888
+        sbrs	r_arg2H,0
1889
+	rjmp	__muluha3_skip1
1890
+	add	r_resL,r_arg1L	; result + multiplicand
1891
+	adc	r_resH,r_arg1H
1892
+__muluha3_skip1:
1893
+	lsl	r_arg1L		; shift multiplicand
1894
+	rol	r_arg1H
1895
+        sbiw    r_arg1L,0
1896
+        breq    __muluha3_loop1_done ; exit multiplicand = 0
1897
+        lsr     r_arg2H
1898
+        brne    __muluha3_loop1 ; exit multiplier = 0
1899
+__muluha3_loop1_done:
1900
+        mov_l   r_arg1L, r_scratchL     ; restore multiplicand
1901
+        mov_h   r_arg1H, r_scratchH
1902
+__muluha3_loop2:
1903
+	lsr	r_arg1H		; shift multiplicand
1904
+	ror	r_arg1L
1905
+        sbiw    r_arg1L,0
1906
+        breq    __muluha3_exit  ; exit if multiplicand = 0
1907
+        sbrs    r_arg2L,7
1908
+        rjmp    __muluha3_skip2
1909
+	add	r_resL,r_arg1L	; result + multiplicand
1910
+	adc	r_resH,r_arg1H
1911
+__muluha3_skip2:
1912
+        lsl     r_arg2L
1913
+        brne    __muluha3_loop2 ; exit if multiplier = 0
1914
+__muluha3_exit:
1915
+        clr     __zero_reg__    ; got clobbered
1916
+        ret
1917
+.endfunc        
1918
+#endif  /* defined (L_muluha3) */
1919
+
1920
+#endif /* defined (__AVR_HAVE_MUL__) */
1921
+
1922
+#undef r_arg1L
1923
+#undef r_arg1H
1924
+#undef r_arg2L
1925
+#undef r_arg2H
1926
+#undef r_resL 	
1927
+#undef r_resH 
1928
+
1929
+/*******************************************************
1930
+        Fixed  Multiplication  16.16 x 16.16
1931
+*******************************************************/
1932
+
1933
+#if defined (__AVR_HAVE_MUL__)
1934
+/* uses nonstandard registers because mulus only works from 16-23 */
1935
+#define r_clr    r15
1936
+
1937
+#define	r_arg1L  r16		/* multiplier Low */
1938
+#define	r_arg1H  r17
1939
+#define	r_arg1HL r18
1940
+#define	r_arg1HH r19		/* multiplier High */
1941
+
1942
+#define	r_arg2L  r20		/* multiplicand Low */
1943
+#define	r_arg2H	 r21
1944
+#define	r_arg2HL r22
1945
+#define	r_arg2HH r23		/* multiplicand High */
1946
+
1947
+#define r_resL	 r24     	/* result Low */
1948
+#define r_resH   r25
1949
+#define r_resHL	 r26
1950
+#define r_resHH  r27	        /* result High */
1951
+
1952
+#if defined (L_mulsa3)        
1953
+	.global	__mulsa3
1954
+	.func	__mulsa3
1955
+__mulsa3:
1956
+        clr     r_clr
1957
+        clr     r_resH
1958
+        clr     r_resHL
1959
+        clr     r_resHH        
1960
+        mul     r_arg1H, r_arg2L
1961
+        mov     r_resL, r1
1962
+        mul     r_arg1L, r_arg2H
1963
+        add     r_resL, r1
1964
+        adc     r_resH, r_clr
1965
+        mul     r_arg1L, r_arg2HL
1966
+        add     r_resL, r0
1967
+        adc     r_resH, r1
1968
+        adc     r_resHL, r_clr
1969
+        mul     r_arg1H, r_arg2H
1970
+        add     r_resL, r0
1971
+        adc     r_resH, r1
1972
+        adc     r_resHL, r_clr
1973
+        mul     r_arg1HL, r_arg2L
1974
+        add     r_resL, r0
1975
+        adc     r_resH, r1
1976
+        adc     r_resHL, r_clr
1977
+        mulsu   r_arg2HH, r_arg1L
1978
+        sbc     r_resHH, r_clr
1979
+        add     r_resH, r0
1980
+        adc     r_resHL, r1
1981
+        adc     r_resHH, r_clr
1982
+        mul     r_arg1H, r_arg2HL
1983
+        add     r_resH, r0
1984
+        adc     r_resHL, r1
1985
+        adc     r_resHH, r_clr
1986
+        mul     r_arg1HL, r_arg2H
1987
+        add     r_resH, r0
1988
+        adc     r_resHL, r1
1989
+        adc     r_resHH, r_clr
1990
+        mulsu   r_arg1HH, r_arg2L
1991
+        sbc     r_resHH, r_clr        
1992
+        add     r_resH, r0
1993
+        adc     r_resHL, r1
1994
+        adc     r_resHH, r_clr
1995
+        mulsu   r_arg2HH, r_arg1H
1996
+        add     r_resHL, r0
1997
+        adc     r_resHH, r1
1998
+        mul     r_arg1HL, r_arg2HL
1999
+        add     r_resHL, r0
2000
+        adc     r_resHH, r1
2001
+        mulsu   r_arg1HH, r_arg2H
2002
+        add     r_resHL, r0
2003
+        adc     r_resHH, r1
2004
+        mulsu   r_arg2HH, r_arg1HL
2005
+        add     r_resHH, r0
2006
+        mulsu   r_arg1HH, r_arg2HL
2007
+        add     r_resHH, r0
2008
+        clr     __zero_reg__
2009
+        ret
2010
+.endfunc
2011
+#endif
2012
+
2013
+#if defined (L_mulusa3)        
2014
+	.global	__mulusa3
2015
+	.func	__mulusa3
2016
+__mulusa3:
2017
+        clr     r_clr
2018
+        clr     r_resH
2019
+        clr     r_resHL
2020
+        clr     r_resHH        
2021
+        mul     r_arg1H, r_arg2L
2022
+        mov     r_resL, r1
2023
+        mul     r_arg1L, r_arg2H
2024
+        add     r_resL, r1
2025
+        adc     r_resH, r_clr
2026
+        mul     r_arg1L, r_arg2HL
2027
+        add     r_resL, r0
2028
+        adc     r_resH, r1
2029
+        adc     r_resHL, r_clr
2030
+        mul     r_arg1H, r_arg2H
2031
+        add     r_resL, r0
2032
+        adc     r_resH, r1
2033
+        adc     r_resHL, r_clr
2034
+        mul     r_arg1HL, r_arg2L
2035
+        add     r_resL, r0
2036
+        adc     r_resH, r1
2037
+        adc     r_resHL, r_clr
2038
+        mul     r_arg1L, r_arg2HH
2039
+        add     r_resH, r0
2040
+        adc     r_resHL, r1
2041
+        adc     r_resHH, r_clr
2042
+        mul     r_arg1H, r_arg2HL
2043
+        add     r_resH, r0
2044
+        adc     r_resHL, r1
2045
+        adc     r_resHH, r_clr
2046
+        mul     r_arg1HL, r_arg2H
2047
+        add     r_resH, r0
2048
+        adc     r_resHL, r1
2049
+        adc     r_resHH, r_clr
2050
+        mul     r_arg1HH, r_arg2L
2051
+        add     r_resH, r0
2052
+        adc     r_resHL, r1
2053
+        adc     r_resHH, r_clr
2054
+        mul     r_arg1H, r_arg2HH
2055
+        add     r_resHL, r0
2056
+        adc     r_resHH, r1
2057
+        mul     r_arg1HL, r_arg2HL
2058
+        add     r_resHL, r0
2059
+        adc     r_resHH, r1
2060
+        mul     r_arg1HH, r_arg2H
2061
+        add     r_resHL, r0
2062
+        adc     r_resHH, r1
2063
+        mul     r_arg1HL, r_arg2HH
2064
+        add     r_resHH, r0
2065
+        mul     r_arg1HH, r_arg2HL
2066
+        add     r_resHH, r0
2067
+        clr     __zero_reg__
2068
+        ret
2069
+.endfunc
2070
+#endif
2071
+
2072
+#else
2073
+
2074
+#define	r_arg1L  r18		/* multiplier Low */
2075
+#define	r_arg1H  r19
2076
+#define	r_arg1HL r20
2077
+#define	r_arg1HH r21		/* multiplier High */
2078
+
2079
+/* these registers needed for sbiw */
2080
+#define	r_arg2L	 r24		/* multiplicand Low */
2081
+#define	r_arg2H	 r25
2082
+#define	r_arg2HL r26
2083
+#define	r_arg2HH r27		/* multiplicand High */
2084
+
2085
+#define r_resL	 r14     	/* result Low */
2086
+#define r_resH   r15
2087
+#define r_resHL	 r16
2088
+#define r_resHH  r17	        /* result High */
2089
+
2090
+#define r_scratchL  r0     	/* scratch Low */
2091
+#define r_scratchH  r1
2092
+#define r_scratchHL r22
2093
+#define r_scratchHH r23	        /* scratch High */
2094
+
2095
+#if defined (L_mulsa3)
2096
+       	.global	__mulsa3
2097
+	.func	__mulsa3
2098
+__mulsa3:
2099
+        mov     r_resL, r_arg1HH
2100
+        eor     r_resL, r_arg2HH
2101
+        bst     r_resL, 7
2102
+        sbrs    r_arg1HH, 7
2103
+        rjmp    __mulsa3_arg1pos
2104
+        com     r_arg1HH
2105
+        com     r_arg1HL
2106
+        com     r_arg1H
2107
+        neg     r_arg1L
2108
+        sbci    r_arg1H,-1
2109
+        sbci    r_arg1HL,-1        
2110
+        sbci    r_arg1HH,-1
2111
+__mulsa3_arg1pos:
2112
+        sbrs    r_arg2HH, 7
2113
+        rjmp    __mulsa3_arg2pos
2114
+        com     r_arg2HH
2115
+        com     r_arg2HL       
2116
+        com     r_arg2H
2117
+        neg     r_arg2L
2118
+        sbci    r_arg2H,-1
2119
+        sbci    r_arg2HL,-1
2120
+        sbci    r_arg2HH,-1        
2121
+__mulsa3_arg2pos:
2122
+        rcall   __mulusa3
2123
+        brtc    __mulsa3_exit
2124
+        com     r_resHH
2125
+        com     r_resHL
2126
+        com     r_resH
2127
+        com     r_resL
2128
+        adc	r_resL,__zero_reg__
2129
+        adc	r_resH,__zero_reg__
2130
+        adc     r_resHL,__zero_reg__
2131
+        adc     r_resHH,__zero_reg__
2132
+__mulsa3_exit:
2133
+        ret
2134
+.endfunc        
2135
+#endif  /* defined (L_mulsa3) */
2136
+
2137
+#if defined (L_mulusa3)
2138
+       	.global	__mulusa3
2139
+	.func	__mulusa3
2140
+__mulusa3:
2141
+	clr	r_resL		; clear result
2142
+        clr     r_resH
2143
+        mov_l   r_resHL, r_resL
2144
+        mov_h   r_resHH, r_resH
2145
+        mov_l   r_scratchL, r_arg1L     ; save multiplicand
2146
+        mov_h   r_scratchH, r_arg1H
2147
+        mov_l   r_scratchHL, r_arg1HL
2148
+        mov_h   r_scratchHH, r_arg1HH
2149
+__mulusa3_loop1:
2150
+        sbrs	r_arg2HL,0
2151
+	rjmp	__mulusa3_skip1
2152
+	add	r_resL,r_arg1L	; result + multiplicand
2153
+	adc	r_resH,r_arg1H
2154
+	adc	r_resHL,r_arg1HL
2155
+	adc	r_resHH,r_arg1HH
2156
+__mulusa3_skip1:
2157
+	lsl	r_arg1L		; shift multiplicand
2158
+	rol	r_arg1H
2159
+	rol	r_arg1HL
2160
+	rol	r_arg1HH
2161
+        lsr     r_arg2HH
2162
+        ror     r_arg2HL
2163
+        sbiw    r_arg2HL,0
2164
+        brne    __mulusa3_loop1 ; exit multiplier = 0
2165
+__mulusa3_loop1_done:
2166
+        mov_l   r_arg1L, r_scratchL     ; restore multiplicand
2167
+        mov_h   r_arg1H, r_scratchH
2168
+        mov_l   r_arg1HL, r_scratchHL
2169
+        mov_h   r_arg1HH, r_scratchHH
2170
+__mulusa3_loop2:
2171
+	lsr	r_arg1HH		; shift multiplicand
2172
+	ror	r_arg1HL
2173
+        ror     r_arg1H
2174
+        ror     r_arg1L
2175
+        sbrs    r_arg2H,7
2176
+        rjmp    __mulusa3_skip2
2177
+	add	r_resL,r_arg1L	; result + multiplicand
2178
+	adc	r_resH,r_arg1H
2179
+	adc	r_resHL,r_arg1HL
2180
+	adc	r_resHH,r_arg1HH
2181
+__mulusa3_skip2:
2182
+        lsl     r_arg2L
2183
+        rol     r_arg2H
2184
+        sbiw    r_arg2L,0
2185
+        brne    __mulusa3_loop2 ; exit if multiplier = 0
2186
+__mulusa3_exit:
2187
+        clr     __zero_reg__    ; got clobbered
2188
+        ret
2189
+.endfunc        
2190
+#endif  /* defined (L_mulusa3) */
2191
+
2192
+#undef r_scratchL
2193
+#undef r_scratchH
2194
+#undef r_scratchHL
2195
+#undef r_scratchHH
2196
+        
2197
+#endif
2198
+
2199
+#undef	r_arg1L
2200
+#undef	r_arg1H
2201
+#undef	r_arg1HL
2202
+#undef	r_arg1HH
2203
+
2204
+#undef	r_arg2L
2205
+#undef	r_arg2H
2206
+#undef	r_arg2HL
2207
+#undef	r_arg2HH
2208
+
2209
+#undef r_resL
2210
+#undef r_resH
2211
+#undef r_resHL
2212
+#undef r_resHH
2213
+
2214
+/*******************************************************
2215
+              Fractional Division 8 / 8
2216
+*******************************************************/
2217
+#define	r_divd	r25	/* dividend */
2218
+#define	r_quo	r24	/* quotient */
2219
+#define	r_div	r22	/* divisor */
2220
+#define	r_cnt	r23	/* loop count */
2221
+
2222
+#if defined (L_divqq3)
2223
+	.global	__divqq3
2224
+	.func	__divqq3
2225
+__divqq3:
2226
+        mov     r0, r_divd
2227
+        eor     r0, r_div
2228
+        sbrc    r_div, 7
2229
+        neg     r_div          
2230
+        sbrc    r_divd, 7
2231
+        neg     r_divd          
2232
+        cp      r_divd, r_div
2233
+        breq    __divqq3_minus1  ; if equal return -1
2234
+        rcall   __udivuqq3
2235
+        lsr     r_quo
2236
+        sbrc    r0, 7   ; negate result if needed
2237
+        neg     r_quo
2238
+        ret
2239
+__divqq3_minus1:
2240
+        ldi     r_quo, 0x80
2241
+        ret
2242
+.endfunc
2243
+#endif 	/* defined (L_divqq3) */
2244
+
2245
+#if defined (L_udivuqq3)
2246
+	.global	__udivuqq3
2247
+	.func	__udivuqq3
2248
+__udivuqq3:
2249
+	clr	r_quo           ; clear quotient
2250
+	ldi	r_cnt,8	        ; init loop counter
2251
+__udivuqq3_loop:
2252
+	lsl	r_divd		; shift dividend
2253
+        brcs    __udivuqq3_ep   ; dividend overflow
2254
+	cp	r_divd,r_div	; compare dividend & divisor
2255
+	brcc	__udivuqq3_ep	; dividend >= divisor
2256
+	rol	r_quo		; shift quotient (with CARRY)
2257
+        rjmp    __udivuqq3_cont
2258
+__udivuqq3_ep:
2259
+	sub	r_divd,r_div	; restore dividend
2260
+	lsl	r_quo		; shift quotient (without CARRY)
2261
+__udivuqq3_cont:
2262
+	dec	r_cnt		; decrement loop counter
2263
+	brne	__udivuqq3_loop
2264
+	com	r_quo		; complement result 
2265
+				; because C flag was complemented in loop
2266
+	ret
2267
+.endfunc
2268
+#endif 	/* defined (L_udivuqq3) */
2269
+
2270
+#undef	r_divd
2271
+#undef	r_quo
2272
+#undef	r_div
2273
+#undef	r_cnt
2274
+        
2275
+
2276
+/*******************************************************
2277
+               Fractional Division 16 / 16
2278
+*******************************************************/
2279
+#define	r_divdL	r26	/* dividend Low */
2280
+#define	r_divdH	r27	/* dividend Hig */        
2281
+#define	r_quoL	r24	/* quotient Low */
2282
+#define	r_quoH	r25	/* quotient High */        
2283
+#define	r_divL	r22	/* divisor */
2284
+#define	r_divH	r23	/* divisor */        
2285
+#define	r_cnt 21
2286
+
2287
+#if defined (L_divhq3)
2288
+	.global	__divhq3
2289
+	.func	__divhq3
2290
+__divhq3:
2291
+        mov     r0, r_divdH
2292
+        eor     r0, r_divH
2293
+        sbrs    r_divH, 7
2294
+        rjmp    __divhq3_divpos
2295
+        com     r_divH
2296
+        neg     r_divL
2297
+        sbci    r_divH,-1
2298
+__divhq3_divpos:        
2299
+        sbrs    r_divdH, 7
2300
+        rjmp    __divhq3_divdpos
2301
+        com     r_divdH
2302
+        neg     r_divdL
2303
+        sbci    r_divdH,-1
2304
+__divhq3_divdpos:
2305
+        cp      r_divdL, r_divL
2306
+        cpc     r_divdH, r_divH
2307
+        breq    __divhq3_minus1  ; if equal return -1
2308
+        rcall   __udivuhq3
2309
+        lsr     r_quoH
2310
+        ror     r_quoL
2311
+        sbrs    r0, 7   ; negate result if needed
2312
+        ret
2313
+        com     r_quoH
2314
+        neg     r_quoL
2315
+        sbci    r_quoH,-1
2316
+        ret
2317
+__divhq3_minus1:
2318
+        ldi     r_quoH, 0x80
2319
+        clr     r_quoL
2320
+        ret
2321
+.endfunc
2322
+#endif 	/* defined (L_divhq3) */
2323
+
2324
+#if defined (L_udivuhq3)
2325
+	.global	__udivuhq3
2326
+	.func	__udivuhq3
2327
+__udivuhq3:
2328
+	sub	r_quoH,r_quoH   ; clear quotient and carry
2329
+        .global	__udivuha3_entry
2330
+__udivuha3_entry:       
2331
+	clr	r_quoL          ; clear quotient
2332
+	ldi	r_cnt,16        ; init loop counter
2333
+__udivuhq3_loop:
2334
+        rol     r_divdL		; shift dividend (with CARRY)
2335
+	rol	r_divdH
2336
+        brcs    __udivuhq3_ep   ; dividend overflow
2337
+	cp	r_divdL,r_divL	; compare dividend & divisor        
2338
+	cpc	r_divdH,r_divH
2339
+	brcc	__udivuhq3_ep	; dividend >= divisor
2340
+	rol	r_quoL		; shift quotient (with CARRY)
2341
+        rjmp    __udivuhq3_cont
2342
+__udivuhq3_ep:
2343
+	sub	r_divdL,r_divL	; restore dividend
2344
+	sbc	r_divdH,r_divH
2345
+	lsl	r_quoL		; shift quotient (without CARRY)
2346
+__udivuhq3_cont:
2347
+        rol     r_quoH          ; shift quotient
2348
+	dec	r_cnt		; decrement loop counter
2349
+	brne	__udivuhq3_loop
2350
+	com	r_quoL		; complement result 
2351
+        com     r_quoH          ; because C flag was complemented in loop
2352
+	ret
2353
+.endfunc
2354
+#endif 	/* defined (L_udivuhq3) */
2355
+
2356
+/*******************************************************
2357
+               Fixed Division 8.8 / 8.8
2358
+*******************************************************/
2359
+#if defined (L_divha3)
2360
+	.global	__divha3
2361
+	.func	__divha3
2362
+__divha3:
2363
+        mov     r0, r_divdH
2364
+        eor     r0, r_divH
2365
+        sbrs    r_divH, 7
2366
+        rjmp    __divha3_divpos
2367
+        com     r_divH
2368
+        neg     r_divL
2369
+        sbci    r_divH,-1
2370
+__divha3_divpos:        
2371
+        sbrs    r_divdH, 7
2372
+        rjmp    __divha3_divdpos
2373
+        com     r_divdH
2374
+        neg     r_divdL
2375
+        sbci    r_divdH,-1
2376
+__divha3_divdpos:
2377
+        rcall   __udivuha3
2378
+        sbrs    r0, 7   ; negate result if needed
2379
+        ret
2380
+        com     r_quoH
2381
+        neg     r_quoL
2382
+        sbci    r_quoH,-1
2383
+        ret
2384
+.endfunc
2385
+#endif 	/* defined (L_divha3) */
2386
+
2387
+#if defined (L_udivuha3)
2388
+	.global	__udivuha3
2389
+	.func	__udivuha3
2390
+__udivuha3:
2391
+        mov     r_quoH, r_divdL
2392
+        mov     r_divdL, r_divdH
2393
+	clr	r_divdH
2394
+        lsl     r_quoH           ; shift quotient into carry
2395
+        rjmp    __udivuha3_entry ; same as fractional after rearrange
2396
+.endfunc
2397
+#endif 	/* defined (L_udivuha3) */
2398
+
2399
+#undef	r_divdL
2400
+#undef	r_divdH
2401
+#undef	r_quoL
2402
+#undef	r_quoH
2403
+#undef	r_divL
2404
+#undef	r_divH
2405
+#undef	r_cnt
2406
+
2407
+/*******************************************************
2408
+            Fixed Division 16.16 / 16.16
2409
+*******************************************************/
2410
+#define r_arg1L  r24    /* arg1 gets passed already in place */
2411
+#define r_arg1H  r25
2412
+#define r_arg1HL r26
2413
+#define r_arg1HH r27        
2414
+#define	r_divdL  r26	/* dividend Low */
2415
+#define	r_divdH  r27
2416
+#define	r_divdHL r30
2417
+#define	r_divdHH r31	/* dividend High */        
2418
+#define	r_quoL	 r22	/* quotient Low */
2419
+#define	r_quoH	 r23
2420
+#define	r_quoHL	 r24
2421
+#define	r_quoHH	 r25	/* quotient High */        
2422
+#define	r_divL	 r18	/* divisor Low */
2423
+#define	r_divH	 r19
2424
+#define	r_divHL	 r20
2425
+#define	r_divHH	 r21	/* divisor High */        
2426
+#define	r_cnt  __zero_reg__  /* loop count (0 after the loop!) */
2427
+
2428
+#if defined (L_divsa3)
2429
+	.global	__divsa3
2430
+	.func	__divsa3
2431
+__divsa3:
2432
+        mov     r0, r27
2433
+        eor     r0, r_divHH        
2434
+        sbrs    r_divHH, 7
2435
+        rjmp    __divsa3_divpos
2436
+        com     r_divHH
2437
+        com     r_divHL
2438
+        com     r_divH        
2439
+        neg     r_divL
2440
+        sbci    r_divH,-1
2441
+        sbci    r_divHL,-1
2442
+        sbci    r_divHH,-1        
2443
+__divsa3_divpos:
2444
+        sbrs    r_arg1HH, 7
2445
+        rjmp    __divsa3_arg1pos
2446
+        com     r_arg1HH
2447
+        com     r_arg1HL
2448
+        com     r_arg1H        
2449
+        neg     r_arg1L
2450
+        sbci    r_arg1H,-1
2451
+        sbci    r_arg1HL,-1
2452
+        sbci    r_arg1HH,-1        
2453
+__divsa3_arg1pos:
2454
+        rcall   __udivusa3        
2455
+        sbrs    r0, 7   ; negate result if needed
2456
+        ret
2457
+        com     r_quoHH
2458
+        com     r_quoHL
2459
+        com     r_quoH        
2460
+        neg     r_quoL
2461
+        sbci    r_quoH,-1
2462
+        sbci    r_quoHL,-1
2463
+        sbci    r_quoHH,-1        
2464
+        ret
2465
+.endfunc
2466
+#endif 	/* defined (L_divsa3) */
2467
+
2468
+#if defined (L_udivusa3)
2469
+	.global	__udivusa3
2470
+	.func	__udivusa3
2471
+__udivusa3:
2472
+        ldi     r_divdHL, 32        ; init loop counter
2473
+        mov     r_cnt, r_divdHL
2474
+	clr	r_divdHL
2475
+	clr	r_divdHH        
2476
+	mov_l	r_quoL, r_divdHL
2477
+	mov_h	r_quoH, r_divdHH
2478
+	lsl     r_quoHL         ; shift quotient into carry
2479
+	rol     r_quoHH
2480
+__udivusa3_loop:
2481
+        rol     r_divdL 	; shift dividend (with CARRY)
2482
+	rol	r_divdH
2483
+	rol	r_divdHL
2484
+	rol	r_divdHH
2485
+        brcs    __udivusa3_ep   ; dividend overflow
2486
+	cp	r_divdL,r_divL	; compare dividend & divisor        
2487
+	cpc	r_divdH,r_divH
2488
+	cpc	r_divdHL,r_divHL
2489
+	cpc	r_divdHH,r_divHH
2490
+	brcc	__udivusa3_ep	; dividend >= divisor
2491
+	rol	r_quoL		; shift quotient (with CARRY)
2492
+        rjmp    __udivusa3_cont
2493
+__udivusa3_ep:
2494
+	sub	r_divdL,r_divL	; restore dividend
2495
+	sbc	r_divdH,r_divH
2496
+	sbc	r_divdHL,r_divHL
2497
+	sbc	r_divdHH,r_divHH
2498
+	lsl	r_quoL		; shift quotient (without CARRY)
2499
+__udivusa3_cont:
2500
+        rol     r_quoH          ; shift quotient
2501
+        rol     r_quoHL
2502
+        rol     r_quoHH
2503
+	dec	r_cnt		; decrement loop counter
2504
+	brne	__udivusa3_loop
2505
+	com	r_quoL		; complement result 
2506
+        com     r_quoH          ; because C flag was complemented in loop
2507
+	com	r_quoHL
2508
+        com     r_quoHH
2509
+	ret
2510
+.endfunc
2511
+#endif 	/* defined (L_udivusa3) */
2512
+
2513
+#undef	r_divdL
2514
+#undef	r_divdH
2515
+#undef	r_divdHL
2516
+#undef	r_divdHH
2517
+#undef	r_quoL
2518
+#undef	r_quoH
2519
+#undef	r_quoHL
2520
+#undef	r_quoHH
2521
+#undef	r_divL
2522
+#undef	r_divH
2523
+#undef	r_divHL
2524
+#undef	r_divHH
2525
+#undef	r_cnt
2526
diff -rupN gcc/config/avr/libgcc.S gcc/config/avr/libgcc.S
2527
--- gcc/config/avr/libgcc.S	2009-05-23 02:16:07.000000000 -0500
2528
+++ gcc/config/avr/libgcc.S	2010-09-21 14:31:30.000000000 -0500
2529
@@ -162,6 +162,23 @@ __mulhi3_exit:
2530
 	.global	__mulhisi3
2531
 	.func	__mulhisi3
2532
 __mulhisi3:
2533
+#if defined (__AVR_HAVE_MUL__)
2534
+	muls	r21, r19
2535
+	movw	r24, r0
2536
+	mul	r20, r18
2537
+	movw	r22, r0
2538
+	mulsu	r21, r18
2539
+	add	r23, r0
2540
+	adc	r24, r1
2541
+	clr	r1
2542
+	adc	r25, r1
2543
+	mulsu	r19, r20
2544
+	add	r23, r0
2545
+	adc	r24, r1
2546
+	clr	r1
2547
+	adc	r25, r1
2548
+	ret
2549
+#else
2550
 	mov_l	r18, r24
2551
 	mov_h	r19, r25
2552
 	clr	r24
2553
@@ -173,6 +190,7 @@ __mulhisi3:
2554
 	dec	r20
2555
 	mov	r21, r20
2556
 	rjmp	__mulsi3
2557
+#endif /* defined (__AVR_HAVE_MUL__) */
2558
 	.endfunc
2559
 #endif /* defined (L_mulhisi3) */
2560
 
2561
@@ -180,13 +198,31 @@ __mulhisi3:
2562
 	.global	__umulhisi3
2563
 	.func	__umulhisi3
2564
 __umulhisi3:
2565
-	mov_l	r18, r24
2566
-	mov_h	r19, r25
2567
+#if defined (__AVR_HAVE_MUL__)
2568
+	mul	r21, r19
2569
+	movw	r24, r0
2570
+	mul	r20, r18
2571
+	movw	r22, r0
2572
+	mul	r21, r18
2573
+	add	r23, r0
2574
+	adc	r24, r1
2575
+	clr	r1
2576
+	adc	r25, r1
2577
+	mul	r19, r20
2578
+	add	r23, r0
2579
+	adc	r24, r1
2580
+	clr	r1
2581
+	adc	r25, r1
2582
+	ret
2583
+#else
2584
+	mov_l	r22, r20
2585
+	mov_h	r23, r21
2586
 	clr	r24
2587
 	clr	r25
2588
 	clr	r20
2589
 	clr	r21
2590
 	rjmp	__mulsi3
2591
+#endif
2592
 	.endfunc
2593
 #endif /* defined (L_umulhisi3) */
2594
 
2595
@@ -199,7 +235,6 @@ __umulhisi3:
2596
 #define	r_arg1HL r24
2597
 #define	r_arg1HH r25		/* multiplier High */
2598
 
2599
-
2600
 #define	r_arg2L  r18		/* multiplicand Low */
2601
 #define	r_arg2H  r19	
2602
 #define	r_arg2HL r20
2603
@@ -555,6 +590,23 @@ __divmodsi4_neg1:
2604
 	.endfunc
2605
 #endif /* defined (L_divmodsi4) */
2606
 
2607
+#undef	r_remHH
2608
+#undef	r_remHL
2609
+#undef	r_remH
2610
+#undef	r_remL
2611
+
2612
+#undef	r_arg1HH
2613
+#undef	r_arg1HL
2614
+#undef	r_arg1H
2615
+#undef	r_arg1L
2616
+
2617
+#undef	r_arg2HH
2618
+#undef	r_arg2HL
2619
+#undef	r_arg2H
2620
+#undef	r_arg2L
2621
+	
2622
+#undef	r_cnt
2623
+
2624
 /**********************************
2625
  * This is a prologue subroutine
2626
  **********************************/
2627
@@ -897,3 +949,4 @@ __tablejump_elpm__:
2628
 	.endfunc
2629
 #endif /* defined (L_tablejump_elpm) */
2630
 
2631
+#include "libgcc-fixed.S"
2632
diff -rupN gcc/config/avr/t-avr gcc/config/avr/t-avr
2633
--- gcc/config/avr/t-avr	2009-12-24 14:32:38.000000000 -0600
2634
+++ gcc/config/avr/t-avr	2010-09-21 14:31:30.000000000 -0500
2635
@@ -36,6 +36,8 @@ LIB1ASMSRC = avr/libgcc.S
2636
 LIB1ASMFUNCS = \
2637
 	_mulqi3 \
2638
 	_mulhi3 \
2639
+	_mulhisi3 \
2640
+	_umulhisi3 \
2641
 	_mulsi3 \
2642
 	_udivmodqi4 \
2643
 	_divmodqi4 \
2644
@@ -54,6 +56,39 @@ LIB1ASMFUNCS = \
2645
 	_ctors \
2646
 	_dtors
2647
 
2648
+# Fixed point routines
2649
+LIB1ASMFUNCS += \
2650
+             _fractqqsf \
2651
+             _fractuqqsf \
2652
+             _fracthqsf \
2653
+             _fractuhqsf \
2654
+             _fracthasf \
2655
+             _fractuhasf \
2656
+             _fractsasf \
2657
+             _fractusasf \
2658
+             _fractsfqq \
2659
+             _fractsfuqq \
2660
+             _fractsfhq \
2661
+             _fractsfuhq \
2662
+             _fractsfha \
2663
+             _fractsfsa \
2664
+             _mulqq3 \
2665
+             _muluqq3 \
2666
+             _mulhq3 \
2667
+             _muluhq3 \
2668
+             _mulha3 \
2669
+             _muluha3 \
2670
+             _mulsa3 \
2671
+             _mulusa3 \
2672
+             _divqq3 \
2673
+             _udivuqq3 \
2674
+             _divhq3 \
2675
+             _udivuhq3 \
2676
+             _divha3 \
2677
+             _udivuha3 \
2678
+             _divsa3 \
2679
+             _udivusa3
2680
+
2681
 # We do not have the DF type.
2682
 # Most of the C functions in libgcc2 use almost all registers,
2683
 # so use -mcall-prologues for smaller code size.
2684
diff -rupN gcc/cse.c gcc/cse.c
2685
--- gcc/cse.c	2010-01-12 14:25:10.000000000 -0600
2686
+++ gcc/cse.c	2010-09-21 14:31:30.000000000 -0500
2687
@@ -3703,9 +3703,10 @@ fold_rtx (rtx x, rtx insn)
2688
 			  && exact_log2 (- INTVAL (const_arg1)) >= 0)))
2689
 		break;
2690
 
2691
-	      /* ??? Vector mode shifts by scalar
2692
+	      /* ??? Vector and Fixed Point shifts by scalar
2693
 		 shift operand are not supported yet.  */
2694
-	      if (is_shift && VECTOR_MODE_P (mode))
2695
+	      if (is_shift && (VECTOR_MODE_P (mode)
2696
+			       || ALL_FIXED_POINT_MODE_P (mode)))
2697
                 break;
2698
 
2699
 	      if (is_shift
2700
diff -rupN gcc/dwarf2out.c gcc/dwarf2out.c
2701
--- gcc/dwarf2out.c	2010-07-01 07:31:19.000000000 -0500
2702
+++ gcc/dwarf2out.c	2010-09-21 14:35:35.000000000 -0500
2703
@@ -12017,6 +12017,12 @@ base_type_die (tree type)
2704
 
2705
   add_AT_unsigned (base_type_result, DW_AT_byte_size,
2706
 		   int_size_in_bytes (type));
2707
+
2708
+  /* version 3 dwarf specifies that for fixed-point types DW_AT_binary_scale
2709
+     describes the location of the decimal place */
2710
+  if (TREE_CODE (type) == FIXED_POINT_TYPE)
2711
+    add_AT_int (base_type_result, DW_AT_binary_scale, -TYPE_FBIT (type));
2712
+
2713
   add_AT_unsigned (base_type_result, DW_AT_encoding, encoding);
2714
 
2715
   return base_type_result;
2716
@@ -15482,7 +15488,11 @@ add_const_value_attribute (dw_die_ref di
2717
 
2718
     case HIGH:
2719
     case CONST_FIXED:
2720
-      return false;
2721
+    {
2722
+        add_AT_double (die, DW_AT_const_value,
2723
+                          CONST_FIXED_VALUE_HIGH (rtl), CONST_FIXED_VALUE_LOW (rtl));
2724
+    }
2725
+    break;
2726
 
2727
     case MEM:
2728
       if (GET_CODE (XEXP (rtl, 0)) == CONST_STRING
2729
diff -rupN gcc/fold-const.c gcc/fold-const.c
2730
--- gcc/fold-const.c	2010-04-06 05:36:57.000000000 -0500
2731
+++ gcc/fold-const.c	2010-09-21 14:31:30.000000000 -0500
2732
@@ -12305,6 +12305,11 @@ fold_binary_loc (location_t loc,
2733
       if (TREE_CODE (arg1) == INTEGER_CST && tree_int_cst_sgn (arg1) < 0)
2734
 	return NULL_TREE;
2735
 
2736
+      /* Since fixed point types cannot perform bitwise and, or, etc..
2737
+	 don't try to convert to an expression with them.  */
2738
+      if (TREE_CODE(type) == FIXED_POINT_TYPE)
2739
+	return NULL_TREE;
2740
+
2741
       /* Turn (a OP c1) OP c2 into a OP (c1+c2).  */
2742
       if (TREE_CODE (op0) == code && host_integerp (arg1, false)
2743
 	  && TREE_INT_CST_LOW (arg1) < TYPE_PRECISION (type)
2744
diff -rupN gcc/varasm.c gcc/varasm.c
2745
--- gcc/varasm.c	2010-03-27 06:56:30.000000000 -0500
2746
+++ gcc/varasm.c	2010-09-21 14:31:30.000000000 -0500
2747
@@ -2709,7 +2709,7 @@ assemble_integer (rtx x, unsigned int si
2748
       else
2749
 	mclass = MODE_INT;
2750
 
2751
-      omode = mode_for_size (subsize * BITS_PER_UNIT, mclass, 0);
2752
+      omode = mode_for_size (subsize * BITS_PER_UNIT, MODE_INT, 0);
2753
       imode = mode_for_size (size * BITS_PER_UNIT, mclass, 0);
2754
 
2755
       for (i = 0; i < size; i += subsize)
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-301-gcc-4.5.1-xmega-v14 (-810 lines)
Lines 1-810 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-01-18 17:58:12.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-01-19 12:51:39.000000000 -0600
4
@@ -52,6 +52,7 @@
5
 static int avr_naked_function_p (tree);
6
 static int interrupt_function_p (tree);
7
 static int signal_function_p (tree);
8
+static int nmi_function_p (tree);
9
 static int avr_OS_task_function_p (tree);
10
 static int avr_OS_main_function_p (tree);
11
 static int avr_regs_to_save (HARD_REG_SET *);
12
@@ -122,6 +123,7 @@ static const struct attribute_spec avr_a
13
   { "progmem",   0, 0, false, false, false,  avr_handle_progmem_attribute },
14
   { "signal",    0, 0, true,  false, false,  avr_handle_fndecl_attribute },
15
   { "interrupt", 0, 0, true,  false, false,  avr_handle_fndecl_attribute },
16
+  { "nmi",       0, 0, true,  false, false,  avr_handle_fndecl_attribute },
17
   { "naked",     0, 0, false, true,  true,   avr_handle_fntype_attribute },
18
   { "OS_task",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
19
   { "OS_main",   0, 0, false, true,  true,   avr_handle_fntype_attribute },
20
@@ -314,6 +316,21 @@ signal_function_p (tree func)
21
   return a != NULL_TREE;
22
 }
23
 
24
+/* Return nonzero if FUNC is a nmi function as specified
25
+   by the "nmi" attribute.  */
26
+
27
+static int
28
+nmi_function_p (tree func)
29
+{
30
+  tree a;
31
+
32
+  if (TREE_CODE (func) != FUNCTION_DECL)
33
+    return 0;
34
+
35
+  a = lookup_attribute ("nmi", DECL_ATTRIBUTES (func));
36
+  return a != NULL_TREE;
37
+}
38
+
39
 /* Return nonzero if FUNC is a OS_task function.  */
40
 
41
 static int
42
@@ -543,6 +560,7 @@ expand_prologue (void)
43
   cfun->machine->is_naked = avr_naked_function_p (current_function_decl);
44
   cfun->machine->is_interrupt = interrupt_function_p (current_function_decl);
45
   cfun->machine->is_signal = signal_function_p (current_function_decl);
46
+  cfun->machine->is_nmi = nmi_function_p (current_function_decl);
47
   cfun->machine->is_OS_task = avr_OS_task_function_p (current_function_decl);
48
   cfun->machine->is_OS_main = avr_OS_main_function_p (current_function_decl);
49
   cfun->machine->stack_usage = 0;
50
@@ -583,18 +601,49 @@ expand_prologue (void)
51
 
52
       /* Push SREG.  */
53
       insn = emit_move_insn (tmp_reg_rtx, 
54
-                             gen_rtx_MEM (QImode, GEN_INT (SREG_ADDR)));
55
+                             gen_rtx_MEM (QImode, GEN_INT (AVR_SREG_ADDR)));
56
       RTX_FRAME_RELATED_P (insn) = 1;
57
       insn = emit_move_insn (pushbyte, tmp_reg_rtx);
58
       RTX_FRAME_RELATED_P (insn) = 1;
59
       cfun->machine->stack_usage++;
60
 
61
+      /* Push RAMPD, RAMPX, RAMPY. */
62
+      if (AVR_HAVE_RAMPX_Y_D)
63
+        {
64
+          /* Push RAMPD. */
65
+          insn = emit_move_insn (tmp_reg_rtx, 
66
+                                 gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)));
67
+          RTX_FRAME_RELATED_P (insn) = 1;
68
+          insn = emit_move_insn (pushbyte, tmp_reg_rtx);
69
+          RTX_FRAME_RELATED_P (insn) = 1;
70
+
71
+          /* Push RAMPX. */
72
+          if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
73
+            {
74
+              insn = emit_move_insn (tmp_reg_rtx, 
75
+                                     gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)));
76
+              RTX_FRAME_RELATED_P (insn) = 1;
77
+              insn = emit_move_insn (pushbyte, tmp_reg_rtx);
78
+              RTX_FRAME_RELATED_P (insn) = 1;
79
+            }
80
+
81
+          /* Push RAMPY. */
82
+          if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
83
+            {
84
+              insn = emit_move_insn (tmp_reg_rtx, 
85
+                                     gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)));
86
+      RTX_FRAME_RELATED_P (insn) = 1;
87
+      insn = emit_move_insn (pushbyte, tmp_reg_rtx);
88
+      RTX_FRAME_RELATED_P (insn) = 1;
89
+            }
90
+        }
91
+
92
       /* Push RAMPZ.  */
93
       if(AVR_HAVE_RAMPZ 
94
          && (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
95
         {
96
           insn = emit_move_insn (tmp_reg_rtx, 
97
-                                 gen_rtx_MEM (QImode, GEN_INT (RAMPZ_ADDR)));
98
+                                 gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPZ_ADDR)));
99
           RTX_FRAME_RELATED_P (insn) = 1;
100
           insn = emit_move_insn (pushbyte, tmp_reg_rtx);
101
           RTX_FRAME_RELATED_P (insn) = 1;
102
@@ -607,6 +656,41 @@ expand_prologue (void)
103
 
104
       /* Prevent any attempt to delete the setting of ZERO_REG!  */
105
       emit_use (zero_reg_rtx);
106
+	
107
+
108
+       /*
109
+       Clear RAMP? registers if used for data access in the interrupt/signal
110
+       context.  Do this after the zero register has been explictly cleared.
111
+       */
112
+       if (AVR_HAVE_RAMPX_Y_D)
113
+         {
114
+           /* Set RAMPD to 0. */
115
+           insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)), const0_rtx);
116
+           RTX_FRAME_RELATED_P (insn) = 1;
117
+
118
+           if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
119
+             {
120
+               /* Set RAMPX to 0. */
121
+               insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)), const0_rtx);
122
+               RTX_FRAME_RELATED_P (insn) = 1;
123
+             }
124
+
125
+           if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
126
+             {
127
+               /* Set RAMPY to 0. */
128
+               insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)), const0_rtx);
129
+               RTX_FRAME_RELATED_P (insn) = 1;
130
+             }
131
+
132
+           if(AVR_HAVE_RAMPZ
133
+              && (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
134
+             {
135
+               /* Set RAMPZ to 0. */
136
+               insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPZ_ADDR)), const0_rtx);
137
+               RTX_FRAME_RELATED_P (insn) = 1;
138
+             }
139
+         }
140
+
141
     }
142
   if (minimize && (frame_pointer_needed 
143
 		   || (AVR_2_BYTE_PC && live_seq > 6)
144
@@ -698,16 +782,16 @@ expand_prologue (void)
145
 		  insn = emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
146
 		  RTX_FRAME_RELATED_P (insn) = 1;
147
 		}
148
-	      else if (TARGET_NO_INTERRUPTS 
149
-		       || cfun->machine->is_signal
150
-		       || cfun->machine->is_OS_main)
151
+	      else if ((!AVR_XMEGA && TARGET_NO_INTERRUPTS)
152
+		       || (!AVR_XMEGA && cfun->machine->is_signal)
153
+		       || (!AVR_XMEGA && cfun->machine->is_OS_main))
154
 		{
155
 		  insn = 
156
 		    emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx, 
157
 						       frame_pointer_rtx));
158
 		  RTX_FRAME_RELATED_P (insn) = 1;		
159
 		}
160
-	      else if (cfun->machine->is_interrupt)
161
+	      else if (!AVR_XMEGA && cfun->machine->is_interrupt)
162
 		{
163
 		  insn = emit_insn (gen_movhi_sp_r_irq_on (stack_pointer_rtx, 
164
 							   frame_pointer_rtx));
165
@@ -878,13 +962,13 @@ expand_epilogue (void)
166
 		{
167
 		  emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
168
 		}
169
-	      else if (TARGET_NO_INTERRUPTS 
170
-		       || cfun->machine->is_signal)
171
+	      else if ((!AVR_XMEGA && TARGET_NO_INTERRUPTS) 
172
+		       || (!AVR_XMEGA && cfun->machine->is_signal))
173
 		{
174
 		  emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx, 
175
 						     frame_pointer_rtx));
176
 		}
177
-	      else if (cfun->machine->is_interrupt)
178
+	      else if (!AVR_XMEGA && cfun->machine->is_interrupt)
179
 		{
180
 		  emit_insn (gen_movhi_sp_r_irq_on (stack_pointer_rtx, 
181
 						    frame_pointer_rtx));
182
@@ -937,14 +1021,39 @@ expand_epilogue (void)
183
              && (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
184
             {
185
 	      emit_insn (gen_popqi (tmp_reg_rtx));
186
-	      emit_move_insn (gen_rtx_MEM(QImode, GEN_INT(RAMPZ_ADDR)), 
187
+	      emit_move_insn (gen_rtx_MEM(QImode, GEN_INT(AVR_RAMPZ_ADDR)), 
188
+			      tmp_reg_rtx);
189
+	    }
190
+
191
+          /* Restore RAMPY, RAMPX, RAMPD using tmp reg as scratch. */
192
+          if (AVR_HAVE_RAMPX_Y_D)
193
+            {
194
+              /* Pop RAMPY. */
195
+              if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
196
+                {
197
+                  emit_insn (gen_popqi (tmp_reg_rtx));
198
+                  emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)),
199
+                                  tmp_reg_rtx);
200
+                }
201
+
202
+              /* Pop RAMPX. */
203
+              if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
204
+                {
205
+                  emit_insn (gen_popqi (tmp_reg_rtx));
206
+                  emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)),
207
+                                  tmp_reg_rtx);
208
+                }
209
+
210
+              /* Pop RAMPD. */
211
+              emit_insn (gen_popqi (tmp_reg_rtx));
212
+              emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)),
213
 			      tmp_reg_rtx);
214
 	    }
215
 
216
           /* Restore SREG using tmp reg as scratch.  */
217
           emit_insn (gen_popqi (tmp_reg_rtx));
218
       
219
-          emit_move_insn (gen_rtx_MEM(QImode, GEN_INT(SREG_ADDR)), 
220
+          emit_move_insn (gen_rtx_MEM(QImode, GEN_INT(AVR_SREG_ADDR)), 
221
 			  tmp_reg_rtx);
222
 
223
           /* Restore tmp REG.  */
224
@@ -1722,9 +1831,17 @@ output_movhi (rtx insn, rtx operands[], 
225
 		return *l = 1, AS2 (out,__SP_L__,%A1);
226
               /* Use simple load of stack pointer if no interrupts are 
227
 		 used.  */
228
-	      else if (TARGET_NO_INTERRUPTS)
229
+	      else if (!AVR_XMEGA && TARGET_NO_INTERRUPTS) 
230
 		return *l = 2, (AS2 (out,__SP_H__,%B1) CR_TAB
231
 				AS2 (out,__SP_L__,%A1));
232
+              if(AVR_XMEGA)
233
+                {
234
+            	  *l = 2;
235
+                  return (AS2 (out,__SP_L__,%A1)  CR_TAB
236
+                          AS2 (out,__SP_H__,%B1));
237
+                }
238
+              else
239
+                {
240
 	      *l = 5;
241
 	      return (AS2 (in,__tmp_reg__,__SREG__)  CR_TAB
242
 		      "cli"                          CR_TAB
243
@@ -1732,6 +1849,7 @@ output_movhi (rtx insn, rtx operands[], 
244
 		      AS2 (out,__SREG__,__tmp_reg__) CR_TAB
245
 		      AS2 (out,__SP_L__,%A1));
246
 	    }
247
+	    }
248
 	  else if (test_hard_reg_class (STACK_REG, src))
249
 	    {
250
 	      *l = 2;	
251
@@ -1865,7 +1983,7 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
252
   
253
   if (CONSTANT_ADDRESS_P (x))
254
     {
255
-      if (CONST_INT_P (x) && INTVAL (x) == SREG_ADDR)
256
+      if (CONST_INT_P (x) && INTVAL (x) == AVR_SREG_ADDR)
257
 	{
258
 	  *l = 1;
259
 	  return AS2 (in,%0,__SREG__);
260
@@ -1873,7 +1991,8 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
261
       if (optimize > 0 && io_address_operand (x, QImode))
262
 	{
263
 	  *l = 1;
264
-	  return AS2 (in,%0,%m1-0x20);
265
+	  op[2] = GEN_INT(AVR_IO_OFFSET);
266
+	  return AS2 (in,%0,%m1-%2);
267
 	}
268
       *l = 2;
269
       return AS2 (lds,%0,%m1);
270
@@ -2061,8 +2180,9 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
271
       if (optimize > 0 && io_address_operand (base, HImode))
272
 	{
273
 	  *l = 2;
274
-	  return (AS2 (in,%A0,%m1-0x20) CR_TAB
275
-		  AS2 (in,%B0,%m1+1-0x20));
276
+	  op[2] = GEN_INT(AVR_IO_OFFSET);
277
+	  return (AS2 (in,%A0,%m1-%2) CR_TAB
278
+		  AS2 (in,%B0,%m1+1-%2));
279
 	}
280
       *l = 4;
281
       return (AS2 (lds,%A0,%m1) CR_TAB
282
@@ -2561,7 +2681,7 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
283
   
284
   if (CONSTANT_ADDRESS_P (x))
285
     {
286
-      if (CONST_INT_P (x) && INTVAL (x) == SREG_ADDR)
287
+      if (CONST_INT_P (x) && INTVAL (x) == AVR_SREG_ADDR)
288
 	{
289
 	  *l = 1;
290
 	  return AS2 (out,__SREG__,%1);
291
@@ -2569,7 +2689,8 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
292
       if (optimize > 0 && io_address_operand (x, QImode))
293
 	{
294
 	  *l = 1;
295
-	  return AS2 (out,%m0-0x20,%1);
296
+	  op[2] = GEN_INT(AVR_IO_OFFSET);
297
+	  return AS2 (out,%m0-%2,%1);
298
 	}
299
       *l = 2;
300
       return AS2 (sts,%m0,%1);
301
@@ -2648,9 +2769,18 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
302
       if (optimize > 0 && io_address_operand (base, HImode))
303
 	{
304
 	  *l = 2;
305
-	  return (AS2 (out,%m0+1-0x20,%B1) CR_TAB
306
-		  AS2 (out,%m0-0x20,%A1));
307
+	  op[2] = GEN_INT(AVR_IO_OFFSET);
308
+          if (AVR_XMEGA)
309
+	    return (AS2 (out,%A0-%2,%A1) CR_TAB
310
+		    AS2 (out,%B0-%2,%B1));
311
+	  else
312
+	    return (AS2 (out,%m0+1-%2,%B1) CR_TAB
313
+		    AS2 (out,%m0-%2,%A1));
314
 	}
315
+      if (AVR_XMEGA)
316
+        return *l = 4, (AS2 (sts,%A0,%A1) CR_TAB
317
+			AS2 (sts,%B0,%B1));
318
+      else
319
       return *l = 4, (AS2 (sts,%m0+1,%B1) CR_TAB
320
 		      AS2 (sts,%m0,%A1));
321
     }
322
@@ -2667,11 +2797,20 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
323
 			      AS2 (adiw,r26,1)          CR_TAB
324
 			      AS2 (st,X,__tmp_reg__));
325
               else
326
+	        {
327
+                  if (!AVR_XMEGA)
328
 		return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
329
 			      AS2 (adiw,r26,1)          CR_TAB
330
 			      AS2 (st,X,__tmp_reg__)    CR_TAB
331
                               AS2 (sbiw,r26,1)          CR_TAB
332
                               AS2 (st,X,r26));
333
+		  else
334
+ 		    return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
335
+			          AS2 (st,X,r26)            CR_TAB
336
+ 			          AS2 (adiw,r26,1)          CR_TAB
337
+ 			          AS2 (st,X,__tmp_reg__)    CR_TAB
338
+			          AS2 (sbiw,r26,1));
339
+		}
340
             }
341
           else
342
             {
343
@@ -2679,14 +2818,27 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
344
                 return *l=2, (AS2 (st,X+,%A1) CR_TAB
345
                               AS2 (st,X,%B1));
346
               else
347
+		{
348
+                  if (!AVR_XMEGA)
349
                 return *l=3, (AS2 (adiw,r26,1) CR_TAB
350
                               AS2 (st,X,%B1)   CR_TAB
351
                               AS2 (st,-X,%A1));
352
+	          else
353
+                    return *l=3, (AS2 (st,X+,%A1) CR_TAB
354
+                                  AS2 (st,X,%B1) CR_TAB
355
+                                  AS2 (sbiw,r26,1));
356
+		}
357
             }
358
         }
359
       else
360
+        {
361
+	  if (!AVR_XMEGA)
362
         return  *l=2, (AS2 (std,%0+1,%B1) CR_TAB
363
                        AS2 (st,%0,%A1));
364
+	  else
365
+            return  *l=2, (AS2 (st,%0,%A1)    CR_TAB
366
+                           AS2 (std,%0+1,%B1));
367
+        }
368
     }
369
   else if (GET_CODE (base) == PLUS)
370
     {
371
@@ -2697,6 +2849,8 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
372
 	  if (reg_base != REG_Y)
373
 	    fatal_insn ("incorrect insn:",insn);
374
 
375
+          if (!AVR_XMEGA)
376
+            {
377
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
378
 	    return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
379
 			    AS2 (std,Y+63,%B1)    CR_TAB
380
@@ -2710,11 +2864,29 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
381
 			  AS2 (subi,r28,lo8(%o0))  CR_TAB
382
 			  AS2 (sbci,r29,hi8(%o0)));
383
 	}
384
+	  else
385
+	    {
386
+ 	      if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
387
+ 	        return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
388
+			        AS2 (std,Y+62,%A1)    CR_TAB
389
+ 			        AS2 (std,Y+63,%B1)    CR_TAB
390
+ 			        AS2 (sbiw,r28,%o0-62));
391
+ 
392
+ 	      return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
393
+ 			      AS2 (sbci,r29,hi8(-%o0)) CR_TAB
394
+			      AS2 (st,Y,%A1)           CR_TAB
395
+ 			      AS2 (std,Y+1,%B1)        CR_TAB
396
+ 			      AS2 (subi,r28,lo8(%o0))  CR_TAB
397
+ 			      AS2 (sbci,r29,hi8(%o0)));
398
+ 	    }
399
+	}
400
       if (reg_base == REG_X)
401
 	{
402
 	  /* (X + d) = R */
403
 	  if (reg_src == REG_X)
404
             {
405
+	      if (!AVR_XMEGA)
406
+	        {
407
 	      *l = 7;
408
 	      return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
409
 		      AS2 (mov,__zero_reg__,r27) CR_TAB
410
@@ -2724,21 +2896,57 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
411
 		      AS1 (clr,__zero_reg__)     CR_TAB
412
                       AS2 (sbiw,r26,%o0));
413
 	    }
414
+	      else
415
+	        {
416
+ 	          *l = 7;
417
+ 	          return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
418
+ 		          AS2 (mov,__zero_reg__,r27) CR_TAB
419
+		          AS2 (adiw,r26,%o0)         CR_TAB
420
+		          AS2 (st,X+,__tmp_reg__)    CR_TAB
421
+ 		          AS2 (st,X,__zero_reg__)    CR_TAB
422
+ 		          AS1 (clr,__zero_reg__)     CR_TAB
423
+		          AS2 (sbiw,r26,%o0+1));
424
+	        }
425
+	    }
426
+	  if (!AVR_XMEGA)
427
+            {	    
428
 	  *l = 4;
429
           return (AS2 (adiw,r26,%o0+1) CR_TAB
430
                   AS2 (st,X,%B1)       CR_TAB
431
                   AS2 (st,-X,%A1)      CR_TAB
432
                   AS2 (sbiw,r26,%o0));
433
 	}
434
+	  else
435
+	    {
436
+ 	      *l = 4;
437
+	      return (AS2 (adiw,r26,%o0) CR_TAB
438
+		      AS2 (st,X+,%A1)    CR_TAB
439
+		      AS2 (st,X,%B1)     CR_TAB
440
+		      AS2 (sbiw,r26,%o0+1));
441
+            }
442
+	}
443
+	
444
+      if (!AVR_XMEGA)
445
       return *l=2, (AS2 (std,%B0,%B1)    CR_TAB
446
                     AS2 (std,%A0,%A1));
447
+      else
448
+        return *l=2, (AS2 (std,%A0,%A1)    CR_TAB
449
+	              AS2 (std,%B0,%B1));
450
     }
451
   else if (GET_CODE (base) == PRE_DEC) /* (--R) */
452
+    {
453
+      if (mem_volatile_p && AVR_XMEGA)
454
+        return *l = 4, (AS2 (sbiw,%r0,2)    CR_TAB 
455
+                        AS2 (st,%p0+,%A1)   CR_TAB
456
+                        AS2 (st,%p0,%B1)    CR_TAB
457
+                        AS2 (sbiw,%r0,1));
458
+      else
459
     return *l=2, (AS2 (st,%0,%B1) CR_TAB
460
 		  AS2 (st,%0,%A1));
461
+    }
462
   else if (GET_CODE (base) == POST_INC) /* (R++) */
463
     {
464
-      if (mem_volatile_p)
465
+      if (mem_volatile_p && !AVR_XMEGA)
466
         {
467
           if (REGNO (XEXP (base, 0)) == REG_X)
468
             {
469
@@ -4874,6 +5082,16 @@ avr_asm_declare_function_name (FILE *fil
470
         }
471
     }
472
 
473
+  else if (cfun->machine->is_nmi)
474
+   {
475
+     if (strncmp (name, "__vector", strlen ("__vector")) != 0)
476
+       {
477
+         warning_at (DECL_SOURCE_LOCATION (decl), 0,
478
+		     "%qs appears to be a misspelled nmi handler",
479
+                     name);
480
+       }
481
+   }
482
+
483
   ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
484
   ASM_OUTPUT_LABEL (file, name);
485
 }
486
@@ -5174,7 +5392,8 @@ avr_file_start (void)
487
 /*  fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);*/
488
   fputs ("__SREG__ = 0x3f\n"
489
 	 "__SP_H__ = 0x3e\n"
490
-	 "__SP_L__ = 0x3d\n", asm_out_file);
491
+	 "__SP_L__ = 0x3d\n"
492
+	 "__CCP__  = 0x34\n", asm_out_file);
493
   
494
   fputs ("__tmp_reg__ = 0\n" 
495
          "__zero_reg__ = 1\n", asm_out_file);
496
@@ -6273,16 +6492,17 @@ avr_out_sbxx_branch (rtx insn, rtx opera
497
 
498
   if (GET_CODE (operands[1]) == CONST_INT)
499
     {
500
-      if (INTVAL (operands[1]) < 0x40)
501
+       operands[4] = GEN_INT(AVR_IO_OFFSET); /* operands[3] is for the jump */
502
+       if (low_io_address_operand (operands[1], VOIDmode))
503
 	{
504
 	  if (comp == EQ)
505
-	    output_asm_insn (AS2 (sbis,%m1-0x20,%2), operands);
506
+ 	    output_asm_insn (AS2 (sbis,%1-%4,%2), operands);
507
 	  else
508
-	    output_asm_insn (AS2 (sbic,%m1-0x20,%2), operands);
509
+ 	    output_asm_insn (AS2 (sbic,%1-%4,%2), operands);
510
 	}
511
       else
512
 	{
513
-	  output_asm_insn (AS2 (in,__tmp_reg__,%m1-0x20), operands);
514
+ 	  output_asm_insn (AS2 (in,__tmp_reg__,%1-%4), operands);
515
 	  if (comp == EQ)
516
 	    output_asm_insn (AS2 (sbrs,__tmp_reg__,%2), operands);
517
 	  else
518
diff -Naurp gcc/config/avr/avr-c.c gcc/config/avr/avr-c.c
519
--- gcc/config/avr/avr-c.c	2009-12-24 14:32:38.000000000 -0600
520
+++ gcc/config/avr/avr-c.c	2011-01-19 12:51:39.000000000 -0600
521
@@ -81,5 +81,18 @@ avr_cpu_cpp_builtins (struct cpp_reader 
522
 
523
   if (TARGET_NO_INTERRUPTS)
524
     cpp_define (pfile, "__NO_INTERRUPTS__");
525
+	
526
+	 if (avr_current_arch->xmega)
527
+    {
528
+      cpp_define (pfile, "__AVR_XMEGA__");
529
+      cpp_define (pfile, "__AVR_HAVE_SPMX__");
530
+    }
531
+  if (avr_current_arch->have_rampx_y_d)
532
+    {
533
+      cpp_define (pfile, "__AVR_HAVE_RAMPX__");
534
+      cpp_define (pfile, "__AVR_HAVE_RAMPY__");
535
+      cpp_define (pfile, "__AVR_HAVE_RAMPD__");
536
+    }
537
+
538
 }
539
 
540
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
541
--- gcc/config/avr/avr-devices.c	2009-07-17 13:49:03.000000000 -0500
542
+++ gcc/config/avr/avr-devices.c	2011-01-19 12:51:39.000000000 -0600
543
@@ -36,7 +36,14 @@ const struct base_arch_s avr_arch_types[
544
   { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=4",   "avr4" },
545
   { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=5",   "avr5" },
546
   { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, "__AVR_ARCH__=51",  "avr51" },
547
-  { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, "__AVR_ARCH__=6",   "avr6" }
548
+  { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, "__AVR_ARCH__=6",   "avr6" },
549
+  { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0x2000, "__AVR_ARCH__=101", "avrxmega1" },
550
+  { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, "__AVR_ARCH__=102", "avrxmega2" },
551
+  { 0, 1, 1, 1, 0, 0, 0, 1, 1, 0x2000, "__AVR_ARCH__=103", "avrxmega3" },
552
+  { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0x2000, "__AVR_ARCH__=104", "avrxmega4" },
553
+  { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0x2000, "__AVR_ARCH__=105", "avrxmega5" },
554
+  { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, "__AVR_ARCH__=106", "avrxmega6" },  
555
+  { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, "__AVR_ARCH__=107", "avrxmega7" }
556
 };
557
 
558
 /* List of all known AVR MCU types - if updated, it has to be kept
559
@@ -189,6 +196,39 @@ const struct mcu_type_s avr_mcu_types[] 
560
   { "avr6",                 ARCH_AVR6, NULL,                        0, 0x0200, "m2561" },
561
   { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200, "m2561" },
562
   { "atmega2561",           ARCH_AVR6, "__AVR_ATmega2561__",        0, 0x0200, "m2561" },
563
+    /* Enhanced, == 256K.  */
564
+    /* Xmega, <= 8K FLASH.  */
565
+    /* Xmega, > 8K, <= 64K FLASH, <= 64K RAM.  */
566
+  { "avrxmega2",    ARCH_AVRXMEGA2, NULL,                           0, 0x2000, "x32a4" },
567
+  { "atxmega16a4",  ARCH_AVRXMEGA2, "__AVR_ATxmega16A4__",          0, 0x2000, "x16a4" },
568
+  { "atxmega16d4",  ARCH_AVRXMEGA2, "__AVR_ATxmega16D4__",          0, 0x2000, "x16d4" },
569
+  { "atxmega16x1",  ARCH_AVRXMEGA2, "__AVR_ATxmega16X1__",          0, 0x2000, "x16x1" },
570
+  { "atxmega32a4",  ARCH_AVRXMEGA2, "__AVR_ATxmega32A4__",          0, 0x2000, "x32a4" },
571
+  { "atxmega32d4",  ARCH_AVRXMEGA2, "__AVR_ATxmega32D4__",          0, 0x2000, "x32d4" },
572
+  { "atxmega32x1",  ARCH_AVRXMEGA2, "__AVR_ATxmega32X1__",          0, 0x2000, "x32x1" },
573
+    /* Xmega, > 8K, <= 64K FLASH, > 64K RAM.  */
574
+    /* { "avrxmega3",    ARCH_AVRXMEGA3, NULL }, */
575
+    /* Xmega, > 64K, <= 128K FLASH, <= 64K RAM.  */
576
+  { "avrxmega4",    ARCH_AVRXMEGA4, NULL,                           0, 0x2000, "x64d3" },
577
+  { "atxmega64a3",  ARCH_AVRXMEGA4, "__AVR_ATxmega64A3__",          0, 0x2000, "x64a3" },
578
+  { "atxmega64d3",  ARCH_AVRXMEGA4, "__AVR_ATxmega64D3__",          0, 0x2000, "x64d3" },
579
+    /* Xmega, > 64K, <= 128K FLASH, > 64K RAM.  */
580
+  { "avrxmega5",    ARCH_AVRXMEGA5, NULL,                           0, 0x2000, "x64a1" },
581
+  { "atxmega64a1",  ARCH_AVRXMEGA5, "__AVR_ATxmega64A1__",          0, 0x2000, "x64a1" },
582
+  { "atxmega64a1u",  ARCH_AVRXMEGA5, "__AVR_ATxmega64A1U__",        0, 0x2000, "x64a1u" },
583
+    /* Xmega, > 128K, <= 256K FLASH, <= 64K RAM.  */
584
+  { "avrxmega6",    ARCH_AVRXMEGA6, NULL,                           0, 0x2000, "x128a3" },
585
+  { "atxmega128a3", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3__",         0, 0x2000, "x128a3" },
586
+  { "atxmega128d3", ARCH_AVRXMEGA6, "__AVR_ATxmega128D3__",         0, 0x2000, "x128d3" },
587
+  { "atxmega192a3", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3__",         0, 0x2000, "x192a3" },
588
+  { "atxmega192d3", ARCH_AVRXMEGA6, "__AVR_ATxmega192D3__",         0, 0x2000, "x192d3" },
589
+  { "atxmega256a3", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3__",         0, 0x2000, "x256a3" },
590
+  { "atxmega256a3b",ARCH_AVRXMEGA6, "__AVR_ATxmega256A3B__",        0, 0x2000, "x256a3b" },
591
+  { "atxmega256d3", ARCH_AVRXMEGA6, "__AVR_ATxmega256D3__",         0, 0x2000, "x256d3" },
592
+    /* Xmega, > 128K, <= 256K FLASH, > 64K RAM.  */
593
+  { "avrxmega7",    ARCH_AVRXMEGA7, NULL,                           0, 0x2000, "x128a1" },
594
+  { "atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__",         0, 0x2000, "x128a1" },
595
+  { "atxmega128a1u", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1U__",       0, 0x2000, "x128a1u" },
596
     /* Assembler only.  */
597
   { "avr1",                 ARCH_AVR1, NULL,                        0, 0x0060, "s1200" },
598
   { "at90s1200",            ARCH_AVR1, "__AVR_AT90S1200__",         0, 0x0060, "s1200" },
599
diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
600
--- gcc/config/avr/avr.h	2010-01-11 17:12:14.000000000 -0600
601
+++ gcc/config/avr/avr.h	2011-01-19 12:51:39.000000000 -0600
602
@@ -45,11 +45,11 @@ struct base_arch_s {
603
   /* Core have 'EICALL' and 'EIJMP' instructions.  */
604
   int have_eijmp_eicall;
605
 
606
-  /* Reserved for xmega architecture.  */
607
-  int reserved;
608
+  /* Core is in Xmega family.  */
609
+  int xmega;
610
 
611
-  /* Reserved for xmega architecture.  */
612
-  int reserved2;
613
+  /* Core have RAMPX, RAMPY and RAMPD registers.  */
614
+  int have_rampx_y_d;
615
   
616
   /* Default start of data section address for architecture.  */
617
   int default_data_section_start;
618
@@ -75,7 +75,14 @@ enum avr_arch
619
   ARCH_AVR4,
620
   ARCH_AVR5,
621
   ARCH_AVR51,
622
-  ARCH_AVR6
623
+  ARCH_AVR6,
624
+  ARCH_AVRXMEGA1,
625
+  ARCH_AVRXMEGA2,
626
+  ARCH_AVRXMEGA3,
627
+  ARCH_AVRXMEGA4,
628
+  ARCH_AVRXMEGA5,
629
+  ARCH_AVRXMEGA6,
630
+  ARCH_AVRXMEGA7
631
 };
632
 
633
 struct mcu_type_s {
634
@@ -118,10 +125,18 @@ extern GTY(()) section *progmem_section;
635
 #define AVR_HAVE_RAMPZ (avr_current_arch->have_elpm)
636
 #define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)
637
 #define AVR_HAVE_8BIT_SP (avr_current_device->short_sp || TARGET_TINY_STACK)
638
+#define AVR_XMEGA (avr_current_arch->xmega)
639
+#define AVR_HAVE_RAMPX_Y_D (avr_current_arch->have_rampx_y_d)
640
 
641
 #define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
642
 #define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
643
 
644
+#define AVR_IO_OFFSET (AVR_XMEGA ? 0 : 0x20)
645
+#define AVR_RAMPD_ADDR (AVR_XMEGA ? 0x38 : 0)
646
+#define AVR_RAMPX_ADDR (AVR_XMEGA ? 0x39 : 0)
647
+#define AVR_RAMPY_ADDR (AVR_XMEGA ? 0x3A : 0)
648
+#define AVR_RAMPZ_ADDR (AVR_XMEGA ? 0x3B : 0x5B)
649
+#define AVR_SREG_ADDR (AVR_XMEGA ? 0x3F: 0x5F)
650
 #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
651
 
652
 #define OVERRIDE_OPTIONS avr_override_options ()
653
@@ -842,6 +857,10 @@ struct GTY(()) machine_function
654
      as specified by the "signal" attribute.  */
655
   int is_signal;
656
   
657
+  /* 'true' - if current function is a signal function
658
+   as specified by the "nmi" attribute.  */
659
+   int is_nmi;
660
+  
661
   /* 'true' - if current function is a 'task' function 
662
      as specified by the "OS_task" attribute.  */
663
   int is_OS_task;
664
diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
665
--- gcc/config/avr/avr.md	2011-01-18 17:58:12.000000000 -0600
666
+++ gcc/config/avr/avr.md	2011-01-19 12:51:39.000000000 -0600
667
@@ -49,9 +49,6 @@
668
    (TMP_REGNO	0)	; temporary register r0
669
    (ZERO_REGNO	1)	; zero register r1
670
    
671
-   (SREG_ADDR   0x5F)
672
-   (RAMPZ_ADDR  0x5B)
673
-   
674
    (UNSPEC_STRLEN	0)
675
    (UNSPEC_INDEX_JMP	1)
676
    (UNSPEC_SEI		2)
677
@@ -2962,7 +2959,8 @@
678
   "(optimize > 0)"
679
 {
680
   operands[2] = GEN_INT (exact_log2 (~INTVAL (operands[1]) & 0xff));
681
-  return AS2 (cbi,%m0-0x20,%2);
682
+  operands[3] = GEN_INT(AVR_IO_OFFSET);
683
+  return AS2 (cbi,%0-%3,%2);
684
 }
685
   [(set_attr "length" "1")
686
    (set_attr "cc" "none")])
687
@@ -2974,7 +2972,8 @@
688
   "(optimize > 0)"
689
 {
690
   operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1]) & 0xff));
691
-  return AS2 (sbi,%m0-0x20,%2);
692
+  operands[3] = GEN_INT(AVR_IO_OFFSET);
693
+  return AS2 (sbi,%0-%3,%2);
694
 }
695
   [(set_attr "length" "1")
696
    (set_attr "cc" "none")])
697
diff -Naurp gcc/config/avr/libgcc.S gcc/config/avr/libgcc.S
698
--- gcc/config/avr/libgcc.S	2011-01-18 17:58:12.000000000 -0600
699
+++ gcc/config/avr/libgcc.S	2011-01-19 12:51:39.000000000 -0600
700
@@ -637,11 +637,19 @@ __prologue_saves__:
701
 	in	r29,__SP_H__
702
 	sub	r28,r26
703
 	sbc	r29,r27
704
+
705
+/* Restore stack pointer. */
706
+#if defined (__AVR_XMEGA__)
707
+	out	__SP_L__,r28
708
+	out	__SP_H__,r29
709
+#else
710
 	in	__tmp_reg__,__SREG__
711
 	cli
712
 	out	__SP_H__,r29
713
 	out	__SREG__,__tmp_reg__
714
 	out	__SP_L__,r28
715
+#endif
716
+
717
 #if defined (__AVR_HAVE_EIJMP_EICALL__)
718
 	eijmp
719
 #else
720
@@ -679,11 +687,18 @@ __epilogue_restores__:
721
 	ldd	r27,Y+1
722
 	add	r28,r30
723
 	adc	r29,__zero_reg__
724
+	
725
+/* Restore stack pointer. */
726
+#if defined(__AVR_XMEGA__)
727
+	out	__SP_L__,r28
728
+	out	__SP_H__,r29
729
+#else
730
 	in	__tmp_reg__,__SREG__
731
 	cli
732
 	out	__SP_H__,r29
733
 	out	__SREG__,__tmp_reg__
734
 	out	__SP_L__,r28
735
+#endif	
736
 	mov_l	r28, r26
737
 	mov_h	r29, r27
738
 	ret
739
diff -Naurp gcc/config/avr/predicates.md gcc/config/avr/predicates.md
740
--- gcc/config/avr/predicates.md	2009-12-24 13:53:57.000000000 -0600
741
+++ gcc/config/avr/predicates.md	2011-01-19 12:51:39.000000000 -0600
742
@@ -45,17 +45,23 @@
743
 ;; Return true if OP is a valid address for lower half of I/O space.
744
 (define_predicate "low_io_address_operand"
745
   (and (match_code "const_int")
746
-       (match_test "IN_RANGE((INTVAL (op)), 0x20, 0x3F)")))
747
+       (if_then_else (match_test "AVR_XMEGA") 
748
+                     (match_test "IN_RANGE((INTVAL (op)), 0x00, 0x1F)")
749
+	             (match_test "IN_RANGE((INTVAL (op)), 0x20, 0x3F)"))))
750
 
751
 ;; Return true if OP is a valid address for high half of I/O space.
752
 (define_predicate "high_io_address_operand"
753
   (and (match_code "const_int")
754
-       (match_test "IN_RANGE((INTVAL (op)), 0x40, 0x5F)")))
755
+       (if_then_else (match_test "AVR_XMEGA") 
756
+                     (match_test "IN_RANGE((INTVAL (op)), 0x20, 0x3F)")
757
+	             (match_test "IN_RANGE((INTVAL (op)), 0x40, 0x5F)"))))
758
 
759
 ;; Return true if OP is a valid address of I/O space.
760
 (define_predicate "io_address_operand"
761
   (and (match_code "const_int")
762
-       (match_test "IN_RANGE((INTVAL (op)), 0x20, (0x60 - GET_MODE_SIZE(mode)))")))
763
+       (if_then_else (match_test "AVR_XMEGA") 
764
+       		(match_test "IN_RANGE((INTVAL (op)), 0x0, (0x40 - GET_MODE_SIZE(mode)))")
765
+       		(match_test "IN_RANGE((INTVAL (op)), 0x20, (0x60 - GET_MODE_SIZE(mode)))"))))
766
 
767
 ;; Return 1 if OP is the zero constant for MODE.
768
 (define_predicate "const0_operand"
769
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
770
--- gcc/config/avr/t-avr	2011-01-18 17:58:12.000000000 -0600
771
+++ gcc/config/avr/t-avr	2011-01-19 12:51:39.000000000 -0600
772
@@ -107,8 +107,8 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(sr
773
 
774
 FPBIT = fp-bit.c
775
 
776
-MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6
777
-MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6
778
+MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7
779
+MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7
780
 
781
 # The many avr2 matches are not listed here - this is the default.
782
 MULTILIB_MATCHES = \
783
@@ -223,7 +223,26 @@ MULTILIB_MATCHES = \
784
 	mmcu?avr51=mmcu?m3000s \
785
 	mmcu?avr51=mmcu?m3001b \
786
  	mmcu?avr6=mmcu?atmega2560 \
787
- 	mmcu?avr6=mmcu?atmega2561
788
+	mmcu?avr6=mmcu?atmega2561 \
789
+	mmcu?avrxmega2=mmcu?atxmega16a4 \
790
+	mmcu?avrxmega2=mmcu?atxmega16d4 \
791
+	mmcu?avrxmega2=mmcu?atxmega16x1 \
792
+	mmcu?avrxmega2=mmcu?atxmega32d4 \
793
+	mmcu?avrxmega2=mmcu?atxmega32a4 \
794
+	mmcu?avrxmega2=mmcu?atxmega32x1 \
795
+	mmcu?avrxmega4=mmcu?atxmega64a3 \
796
+	mmcu?avrxmega4=mmcu?atxmega64d3 \
797
+	mmcu?avrxmega5=mmcu?atxmega64a1 \
798
+	mmcu?avrxmega5=mmcu?atxmega64a1u \
799
+	mmcu?avrxmega6=mmcu?atxmega128a3 \
800
+	mmcu?avrxmega6=mmcu?atxmega128d3 \
801
+	mmcu?avrxmega6=mmcu?atxmega192a3 \
802
+	mmcu?avrxmega6=mmcu?atxmega192d3 \
803
+	mmcu?avrxmega6=mmcu?atxmega256a3 \
804
+	mmcu?avrxmega6=mmcu?atxmega256a3b \
805
+	mmcu?avrxmega6=mmcu?atxmega256d3 \
806
+	mmcu?avrxmega7=mmcu?atxmega128a1 \
807
+	mmcu?avrxmega7=mmcu?atxmega128a1u
808
 
809
 MULTILIB_EXCEPTIONS =
810
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-302-gcc-4.5.1-avrtiny10 (-2132 lines)
Lines 1-2132 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-01-19 13:03:59.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-01-19 13:11:23.000000000 -0600
4
@@ -232,8 +232,8 @@ avr_override_options (void)
5
   avr_current_arch = &avr_arch_types[avr_current_device->arch];
6
   avr_extra_arch_macro = avr_current_device->macro;
7
 
8
-  tmp_reg_rtx  = gen_rtx_REG (QImode, TMP_REGNO);
9
-  zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO);
10
+  tmp_reg_rtx  = gen_rtx_REG (QImode, AVR_TINY ? TMP_REGNO_AVRTINY10 : TMP_REGNO);
11
+  zero_reg_rtx = gen_rtx_REG (QImode, AVR_TINY ? ZERO_REGNO_AVRTINY10 : ZERO_REGNO);
12
 
13
   init_machine_status = avr_init_machine_status;
14
 }
15
@@ -1641,7 +1641,7 @@ avr_simplify_comparison_p (enum machine_
16
 int
17
 function_arg_regno_p(int r)
18
 {
19
-  return (r >= 8 && r <= 25);
20
+  return (AVR_TINY ? r >= 20 && r <= 25 : r >= 8 && r <= 25);
21
 }
22
 
23
 /* Initializing the variable cum for the state at the beginning
24
@@ -1651,7 +1651,11 @@ void
25
 init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname,
26
 		      tree fndecl ATTRIBUTE_UNUSED)
27
 {
28
+  if (AVR_TINY) 
29
+	  cum->nregs = 6;
30
+  else 
31
   cum->nregs = 18;
32
+
33
   cum->regno = FIRST_CUM_REG;
34
   if (!libname && fntype)
35
     {
36
@@ -1675,9 +1679,8 @@ avr_num_arg_regs (enum machine_mode mode
37
   else
38
     size = GET_MODE_SIZE (mode);
39
 
40
-  /* Align all function arguments to start in even-numbered registers.
41
+  /* if not AVR_TINY, Align all function arguments to start in even-numbered registers.
42
      Odd-sized arguments leave holes above them.  */
43
-
44
   return (size + 1) & ~1;
45
 }
46
 
47
@@ -2009,10 +2012,20 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
48
 	    fatal_insn ("incorrect insn:",insn);
49
 
50
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (src)))
51
-	    return *l = 3, (AS2 (adiw,r28,%o1-63) CR_TAB
52
+	    return *l = 3, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o1-63))) CR_TAB 
53
+				          AS2 (sbci,r29,hi8(-(%o1-63))) CR_TAB
54
+						  AS2 (subi,r28,lo8(-63))       CR_TAB 
55
+				          AS2 (sbci,r29,hi8(-63))       CR_TAB
56
+			              AS2 (ld,%0,Y)                 CR_TAB
57
+						  AS2 (subi,r28,lo8(63))       CR_TAB 
58
+				          AS2 (sbci,r29,hi8(63))       CR_TAB
59
+						  AS2 (subi,r28,lo8(%o1-63)) CR_TAB 
60
+				          AS2 (sbci,r29,hi8(%o1-63)))  
61
+		                   : (AS2 (adiw,r28,%o1-63) CR_TAB
62
 			    AS2 (ldd,%0,Y+63)     CR_TAB
63
 			    AS2 (sbiw,r28,%o1-63));
64
 
65
+
66
 	  return *l = 5, (AS2 (subi,r28,lo8(-%o1)) CR_TAB
67
 			  AS2 (sbci,r29,hi8(-%o1)) CR_TAB
68
 			  AS2 (ld,%0,Y)            CR_TAB
69
@@ -2025,15 +2038,38 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
70
 	     it but I have this situation with extremal optimizing options.  */
71
 	  if (reg_overlap_mentioned_p (dest, XEXP (x,0))
72
 	      || reg_unused_after (insn, XEXP (x,0)))
73
-	    return *l = 2, (AS2 (adiw,r26,%o1) CR_TAB
74
+	    return *l = 2, AVR_TINY ? (AS2 (subi,r26,lo8(-(%o1))) CR_TAB
75
+						  AS2 (sbci,r27,hi8(-(%o1))) CR_TAB
76
+						  AS2 (ld,%0,X))
77
+						   : (AS2 (adiw,r26,%o1) CR_TAB
78
 			    AS2 (ld,%0,X));
79
 
80
-	  return *l = 3, (AS2 (adiw,r26,%o1) CR_TAB
81
+	    return *l = 3, AVR_TINY ? (AS2 (subi,r26,lo8(-(%o1))) CR_TAB
82
+						  AS2 (sbci,r27,hi8(-(%o1))) CR_TAB
83
+						  AS2 (ld,%0,X) CR_TAB
84
+						  AS2 (subi,r26,lo8(%o1)) CR_TAB 
85
+				          AS2 (sbci,r27,hi8(%o1))) 
86
+						   : (AS2 (adiw,r26,%o1) CR_TAB
87
 			  AS2 (ld,%0,X)      CR_TAB
88
 			  AS2 (sbiw,r26,%o1));
89
 	}
90
+
91
       *l = 1;
92
-      return AS2 (ldd,%0,%1);
93
+	  op[2] = XEXP(x, 0);
94
+	  if(REGNO(op[2]) == REG_Y)
95
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
96
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
97
+						AS2 (ld,%0,Y)              CR_TAB
98
+			            AS2 (subi,%A2,lo8(%o1)) CR_TAB
99
+						AS2 (sbci,%B2,hi8(%o1)))
100
+						 :   AS2 (ldd,%0,%1);
101
+	  if(REGNO(op[2]) == REG_Z)
102
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
103
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
104
+						AS2 (ld,%0,Z)              CR_TAB
105
+			            AS2 (subi,%A2,lo8(%o1)) CR_TAB
106
+						AS2 (sbci,%B2,hi8(%o1)))
107
+						 :   AS2 (ldd,%0,%1);
108
     }
109
   *l = 1;
110
   return AS2 (ld,%0,%1);
111
@@ -2073,14 +2109,34 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
112
 		      AS2 (ld,%B0,X));
113
 	    }
114
 	  *l  = 3;
115
-	  return (AS2 (ld,%A0,X+) CR_TAB
116
+	  return AVR_TINY ? (AS2 (ld,%A0,X+) CR_TAB
117
+				AS2 (ld,%B0,X)  CR_TAB
118
+				AS2 (subi,r26,lo8(1))          CR_TAB
119
+				AS2 (sbci,r27,hi8(1))) 
120
+		         : (AS2 (ld,%A0,X+) CR_TAB
121
 		  AS2 (ld,%B0,X) CR_TAB
122
 		  AS2 (sbiw,r26,1));
123
         }
124
       else                      /* (R)  */
125
 	{
126
 	  *l = 2;
127
-	  return (AS2 (ld,%A0,%1)    CR_TAB
128
+	  if(reg_base == REG_Y)
129
+	  return AVR_TINY ? (AS2 (ld,%A0,%1) CR_TAB
130
+				AS2 (subi,r28,lo8((-1))) CR_TAB
131
+				AS2 (sbci,r29,hi8((-1))) CR_TAB 
132
+		        AS2 (ld,%B0,%1) CR_TAB
133
+				AS2 (subi,r28,lo8(1)) CR_TAB
134
+				AS2 (sbci,r29,hi8(1)))		   
135
+		         : (AS2 (ld,%A0,%1) CR_TAB
136
+				AS2 (ldd,%B0,%1+1));
137
+	  if(reg_base == REG_Z)
138
+	  return AVR_TINY ? (AS2 (ld,%A0,%1) CR_TAB
139
+				AS2 (subi,r30,lo8((-1))) CR_TAB
140
+				AS2 (sbci,r31,hi8((-1))) CR_TAB 
141
+		        AS2 (ld,%B0,%1) CR_TAB
142
+				AS2 (subi,r30,lo8(1)) CR_TAB
143
+				AS2 (sbci,r31,hi8(1)))
144
+		         : (AS2 (ld,%A0,%1) CR_TAB
145
 		  AS2 (ldd,%B0,%1+1));
146
 	}
147
     }
148
@@ -2095,12 +2151,30 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
149
 	    fatal_insn ("incorrect insn:",insn);
150
 	  
151
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (src)))
152
-	    return *l = 4, (AS2 (adiw,r28,%o1-62) CR_TAB
153
+	    return *l = 4, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o1-62))) CR_TAB 
154
+				          AS2 (sbci,r29,hi8(-(%o1-62))) CR_TAB
155
+						  AS2 (subi,r28,lo8(-62))       CR_TAB 
156
+				          AS2 (sbci,r29,hi8(-62))       CR_TAB
157
+			              AS2 (ld,%A0,Y+)                CR_TAB
158
+			              AS2 (ld,%B0,Y)                CR_TAB
159
+						  AS2 (subi,r28,lo8(63))       CR_TAB 
160
+				          AS2 (sbci,r29,hi8(63))       CR_TAB
161
+						  AS2 (subi,r28,lo8(%o1-62)) CR_TAB 
162
+				          AS2 (sbci,r29,hi8(%o1-62)))  
163
+			               : (AS2 (adiw,r28,%o1-62) CR_TAB
164
 			    AS2 (ldd,%A0,Y+62)    CR_TAB
165
 			    AS2 (ldd,%B0,Y+63)    CR_TAB
166
 			    AS2 (sbiw,r28,%o1-62));
167
 
168
-	  return *l = 6, (AS2 (subi,r28,lo8(-%o1)) CR_TAB
169
+	  return *l = 6, AVR_TINY ? (AS2 (subi,r28,lo8(-%o1)) CR_TAB
170
+						AS2 (sbci,r29,hi8(-%o1)) CR_TAB
171
+						AS2 (ld,%A0,Y+)          CR_TAB
172
+						AS2 (ld,%B0,Y)           CR_TAB
173
+						AS2 (subi,r28,lo8(1))   CR_TAB
174
+						AS2 (sbci,r29,hi8(1))   CR_TAB
175
+			     		AS2 (subi,r28,lo8(%o1))  CR_TAB
176
+						AS2 (sbci,r29,hi8(%o1)))
177
+						 : (AS2 (subi,r28,lo8(-%o1)) CR_TAB
178
 			  AS2 (sbci,r29,hi8(-%o1)) CR_TAB
179
 			  AS2 (ld,%A0,Y)           CR_TAB
180
 			  AS2 (ldd,%B0,Y+1)        CR_TAB
181
@@ -2115,12 +2189,23 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
182
 	  
183
 	  *l = 4;
184
 	  if (reg_base == reg_dest)
185
-	    return (AS2 (adiw,r26,%o1)      CR_TAB
186
+	    return AVR_TINY ? (AS2 (subi,r26,lo8(-%o1))      CR_TAB
187
+				  AS2 (sbci,r27,hi8(-%o1))      CR_TAB
188
+		          AS2 (ld,__tmp_reg__,X+)       CR_TAB
189
+		          AS2 (ld,%B0,X)                CR_TAB
190
+		          AS2 (mov,%A0,__tmp_reg__))
191
+			       : (AS2 (adiw,r26,%o1)      CR_TAB
192
 		    AS2 (ld,__tmp_reg__,X+) CR_TAB
193
 		    AS2 (ld,%B0,X)          CR_TAB
194
 		    AS2 (mov,%A0,__tmp_reg__));
195
 
196
-	  return (AS2 (adiw,r26,%o1) CR_TAB
197
+	    return AVR_TINY ? (AS2 (subi,r26,lo8(-%o1))      CR_TAB
198
+	   	          AS2 (sbci,r27,hi8(-%o1))      CR_TAB
199
+		          AS2 (ld,%A0,X+)			     CR_TAB
200
+		          AS2 (ld,%B0,X)                CR_TAB
201
+				  AS2 (subi,r26,lo8(%o1+1))     CR_TAB 
202
+				  AS2 (sbci,r27,hi8(%o1+1)))  
203
+		           : (AS2 (adiw,r26,%o1) CR_TAB
204
 		  AS2 (ld,%A0,X+)    CR_TAB
205
 		  AS2 (ld,%B0,X)     CR_TAB
206
 		  AS2 (sbiw,r26,%o1+1));
207
@@ -2129,14 +2214,54 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
208
       if (reg_base == reg_dest)
209
 	{
210
 	  *l = 3;
211
-	  return (AS2 (ldd,__tmp_reg__,%A1) CR_TAB
212
+	  op[2] = XEXP(base, 0);
213
+
214
+	  if(REGNO(op[2]) == REG_Y)
215
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
216
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
217
+						AS2 (ld,__tmp_reg__,Y+)     CR_TAB
218
+		                AS2 (ld,%B0,Y)         CR_TAB
219
+						AS2 (subi,%A2,lo8(%o1+1)) CR_TAB
220
+						AS2 (subi,%B2,hi8(%o1+1)) CR_TAB
221
+						AS2 (mov,%A0,__tmp_reg__))
222
+				         :  (AS2 (ldd,__tmp_reg__,%A1) CR_TAB
223
+		                AS2 (ldd,%B0,%B1)         CR_TAB
224
+		                AS2 (mov,%A0,__tmp_reg__));
225
+	  if(REGNO(op[2]) == REG_Z)
226
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
227
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
228
+						AS2 (ld,__tmp_reg__,Z+)     CR_TAB
229
+		                AS2 (ld,%B0,Z)         CR_TAB
230
+						AS2 (subi,%A2,lo8(%o1+1)) CR_TAB
231
+						AS2 (subi,%B2,hi8(%o1+1)) CR_TAB
232
+						AS2 (mov,%A0,__tmp_reg__))
233
+				         :  (AS2 (ldd,__tmp_reg__,%A1) CR_TAB
234
 		  AS2 (ldd,%B0,%B1)         CR_TAB
235
 		  AS2 (mov,%A0,__tmp_reg__));
236
 	}
237
-      
238
       *l = 2;
239
-      return (AS2 (ldd,%A0,%A1) CR_TAB
240
+
241
+	  op[2] = XEXP(base, 0);
242
+
243
+	  if(REGNO(op[2]) == REG_Y)
244
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
245
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
246
+						AS2 (ld,%A0,Y+)             CR_TAB
247
+		                AS2 (ld,%B0,Y)               CR_TAB
248
+						AS2 (subi,%A2,lo8(%o1+1)) CR_TAB
249
+						AS2 (subi,%B2,hi8(%o1+1)))
250
+				         :  (AS2 (ldd,%A0,%A1) CR_TAB
251
+		                AS2 (ldd,%B0,%B1));
252
+	  if(REGNO(op[2]) == REG_Z)
253
+			  return AVR_TINY ? ( AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
254
+						AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
255
+						AS2 (ld,%A0,Z+)             CR_TAB
256
+		                AS2 (ld,%B0,Z)              CR_TAB
257
+						AS2 (subi,%A2,lo8(%o1+1)) CR_TAB
258
+						AS2 (subi,%B2,hi8(%o1+1)))
259
+				         :  (AS2 (ldd,%A0,%A1) CR_TAB
260
 	      AS2 (ldd,%B0,%B1));
261
+      
262
     }
263
   else if (GET_CODE (base) == PRE_DEC) /* (--R) */
264
     {
265
@@ -2148,7 +2273,13 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
266
           if (REGNO (XEXP (base, 0)) == REG_X)
267
             {
268
               *l = 4;
269
-              return (AS2 (sbiw,r26,2)  CR_TAB
270
+              return AVR_TINY ? (AS2 (subi,r26,lo8(2))  CR_TAB
271
+					    AS2 (sbci,r27,hi8(2))   CR_TAB
272
+                        AS2 (ld,%A0,X+)            CR_TAB
273
+                        AS2 (ld,%B0,X)             CR_TAB
274
+						AS2 (subi,r26,lo8(1))  CR_TAB
275
+						AS2 (sbci,r27,hi8(1)))
276
+				         : (AS2 (sbiw,r26,2)  CR_TAB
277
                       AS2 (ld,%A0,X+)   CR_TAB
278
                       AS2 (ld,%B0,X)    CR_TAB
279
                       AS2 (sbiw,r26,1));
280
@@ -2156,7 +2287,16 @@ out_movhi_r_mr (rtx insn, rtx op[], int 
281
           else
282
             {
283
               *l = 3;
284
-              return (AS2 (sbiw,%r1,2)   CR_TAB
285
+			  //FIXME:check the code once again for AVR_TINY
286
+              return AVR_TINY ? (AS2 (subi,%A1,lo8(3))  CR_TAB 
287
+					    AS2 (sbci,%B1,hi8(3))  CR_TAB
288
+                        AS2 (ld,%A0,%p1)       CR_TAB
289
+						AS2 (subi,%A1,lo8(-1)) CR_TAB
290
+						AS2 (sbci,%B1,hi8(-1)) CR_TAB
291
+                        AS2 (ld,%B0,%p1)       CR_TAB
292
+						AS2 (subi,%A1,lo8(1)) CR_TAB
293
+						AS2 (sbci,%B1,hi8(1)))
294
+				         : (AS2 (sbiw,%r1,2)   CR_TAB
295
                       AS2 (ld,%A0,%p1)  CR_TAB
296
                       AS2 (ldd,%B0,%p1+1));
297
             }
298
@@ -2212,13 +2352,23 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
299
         {
300
           if (reg_dest == REG_X)
301
 	    /* "ld r26,-X" is undefined */
302
-	    return *l=7, (AS2 (adiw,r26,3)        CR_TAB
303
+	    return *l=7, AVR_TINY ? (AS2 (subi,r26,lo8(-3))  CR_TAB
304
+						AS2 (sbci,r27,hi8(-3))  CR_TAB
305
+			            AS2 (ld,r29,X)          CR_TAB
306
+			            AS2 (ld,r28,-X)         CR_TAB
307
+			            AS2 (ld,__tmp_reg__,-X) CR_TAB
308
+			            AS2 (subi,r26,lo8(1))   CR_TAB
309
+			            AS2 (sbci,r27,hi8(1))   CR_TAB
310
+			            AS2 (ld,r26,X)          CR_TAB
311
+			            AS2 (mov,r27,__tmp_reg__))
312
+			             : (AS2 (adiw,r26,3)        CR_TAB
313
 			  AS2 (ld,r29,X)          CR_TAB
314
 			  AS2 (ld,r28,-X)         CR_TAB
315
 			  AS2 (ld,__tmp_reg__,-X) CR_TAB
316
 			  AS2 (sbiw,r26,1)        CR_TAB
317
 			  AS2 (ld,r26,X)          CR_TAB
318
 			  AS2 (mov,r27,__tmp_reg__));
319
+
320
           else if (reg_dest == REG_X - 2)
321
             return *l=5, (AS2 (ld,%A0,X+)  CR_TAB
322
                           AS2 (ld,%B0,X+) CR_TAB
323
@@ -2231,7 +2381,13 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
324
                            AS2 (ld,%C0,X+) CR_TAB
325
                            AS2 (ld,%D0,X));
326
           else
327
-            return  *l=5, (AS2 (ld,%A0,X+)  CR_TAB
328
+            return  *l=5, AVR_TINY ? (AS2 (ld,%A0,X+) CR_TAB
329
+                             AS2 (ld,%B0,X+) CR_TAB
330
+                             AS2 (ld,%C0,X+) CR_TAB
331
+                             AS2 (ld,%D0,X)  CR_TAB
332
+                             AS2 (subi,r26,lo8(3)) CR_TAB
333
+                             AS2 (sbci,r27,hi8(3)))
334
+					          : (AS2 (ld,%A0,X+) CR_TAB
335
                            AS2 (ld,%B0,X+) CR_TAB
336
                            AS2 (ld,%C0,X+) CR_TAB
337
                            AS2 (ld,%D0,X)  CR_TAB
338
@@ -2240,22 +2396,97 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
339
       else
340
         {
341
           if (reg_dest == reg_base)
342
-            return *l=5, (AS2 (ldd,%D0,%1+3) CR_TAB
343
+		  {
344
+			  if(reg_base == REG_Y)
345
+            return *l=5, AVR_TINY ? (AS2 (subi,r28,lo8(-3)) CR_TAB
346
+							AS2 (sbci,r29,hi8(-3)) CR_TAB
347
+				            AS2 (ld,%D0,Y)        CR_TAB
348
+                            AS2 (ld,%C0,-Y)        CR_TAB
349
+                            AS2 (subi,r28,lo8(1)) CR_TAB
350
+                            AS2 (sbci,r29,hi8(1)) CR_TAB
351
+                            AS2 (ld,__tmp_reg__,%1)  CR_TAB
352
+                            AS2 (subi,r28,lo8(1)) CR_TAB
353
+                            AS2 (sbci,r29,hi8(1)) CR_TAB
354
+                            AS2 (ld,%A0,%1)  CR_TAB
355
+                            AS2 (mov,%B0,__tmp_reg__))
356
+				             : (AS2 (ldd,%D0,%1+3) CR_TAB
357
+                            AS2 (ldd,%C0,%1+2) CR_TAB
358
+                            AS2 (ldd,__tmp_reg__,%1+1)  CR_TAB
359
+                            AS2 (ld,%A0,%1)  CR_TAB
360
+                            AS2 (mov,%B0,__tmp_reg__));
361
+			  if(reg_base == REG_Z)
362
+            return *l=5, AVR_TINY ? (AS2 (subi,r30,lo8(-3)) CR_TAB
363
+							AS2 (sbci,r31,hi8(-3)) CR_TAB
364
+				            AS2 (ld,%D0,Z)        CR_TAB
365
+                            AS2 (ld,%C0,-Z)        CR_TAB
366
+                            AS2 (subi,r30,lo8(1)) CR_TAB
367
+                            AS2 (sbci,r31,hi8(1)) CR_TAB
368
+                            AS2 (ld,__tmp_reg__,%1)  CR_TAB
369
+                            AS2 (subi,r30,lo8(1)) CR_TAB
370
+                            AS2 (sbci,r31,hi8(1)) CR_TAB
371
+                            AS2 (ld,%A0,%1)  CR_TAB
372
+                            AS2 (mov,%B0,__tmp_reg__))
373
+				             : (AS2 (ldd,%D0,%1+3) CR_TAB
374
                           AS2 (ldd,%C0,%1+2) CR_TAB
375
                           AS2 (ldd,__tmp_reg__,%1+1)  CR_TAB
376
                           AS2 (ld,%A0,%1)  CR_TAB
377
                           AS2 (mov,%B0,__tmp_reg__));
378
+		  }
379
+
380
           else if (reg_base == reg_dest + 2)
381
-            return *l=5, (AS2 (ld ,%A0,%1)    CR_TAB
382
+		  {
383
+			  if(reg_base == REG_Y)
384
+            return *l=5, AVR_TINY ? (AS2 (ld ,%A0,Y+)       CR_TAB
385
+                            AS2 (ld,%B0,Y+) CR_TAB
386
+                            AS2 (ld,__tmp_reg__,Y+) CR_TAB
387
+                            AS2 (ld,%D0,Y) CR_TAB
388
+                            AS2 (subi,r28,lo8(3)) CR_TAB
389
+                            AS2 (sbci,r29,hi8(3)) CR_TAB
390
+                            AS2 (mov,%C0,__tmp_reg__))
391
+				             : (AS2 (ld ,%A0,%1)    CR_TAB
392
+                            AS2 (ldd,%B0,%1+1) CR_TAB
393
+                            AS2 (ldd,__tmp_reg__,%1+2)  CR_TAB
394
+                            AS2 (ldd,%D0,%1+3) CR_TAB
395
+                            AS2 (mov,%C0,__tmp_reg__));
396
+			  if(reg_base == REG_Z)
397
+            return *l=5, AVR_TINY ? (AS2 (ld ,%A0,Z+)       CR_TAB
398
+                            AS2 (ld,%B0,Z+) CR_TAB
399
+                            AS2 (ld,__tmp_reg__,Z+) CR_TAB
400
+                            AS2 (ld,%D0,Z) CR_TAB
401
+                            AS2 (subi,r30,lo8(3)) CR_TAB
402
+                            AS2 (sbci,r31,hi8(3)) CR_TAB
403
+                            AS2 (mov,%C0,__tmp_reg__))
404
+				             : (AS2 (ld ,%A0,%1)    CR_TAB
405
                           AS2 (ldd,%B0,%1+1) CR_TAB
406
                           AS2 (ldd,__tmp_reg__,%1+2)  CR_TAB
407
                           AS2 (ldd,%D0,%1+3) CR_TAB
408
                           AS2 (mov,%C0,__tmp_reg__));
409
+		  }
410
           else
411
-            return *l=4, (AS2 (ld ,%A0,%1)   CR_TAB
412
+		  {
413
+			  if(reg_base == REG_Y)
414
+            return *l=4, AVR_TINY ? (AS2 (ld ,%A0,Y+)   CR_TAB
415
+                            AS2 (ld,%B0,Y+) CR_TAB
416
+                            AS2 (ld,%C0,Y+) CR_TAB
417
+                            AS2 (ld,%D0,Y)  CR_TAB
418
+                            AS2 (subi,r28,lo8(3)) CR_TAB
419
+                            AS2 (sbci,r29,hi8(3)))
420
+						     : (AS2 (ld ,%A0,%1)   CR_TAB
421
                           AS2 (ldd,%B0,%1+1) CR_TAB
422
                           AS2 (ldd,%C0,%1+2) CR_TAB
423
                           AS2 (ldd,%D0,%1+3));
424
+			  if(reg_base == REG_Z)
425
+            return *l=4, AVR_TINY ? (AS2 (ld ,%A0,Z+)   CR_TAB
426
+                            AS2 (ld,%B0,Z+) CR_TAB
427
+                            AS2 (ld,%C0,Z+) CR_TAB
428
+                            AS2 (ld,%D0,Z) CR_TAB
429
+                            AS2 (subi,r30,lo8(3)) CR_TAB
430
+                            AS2 (sbci,r31,hi8(3))) 
431
+						     : (AS2 (ld ,%A0,%1)   CR_TAB
432
+                            AS2 (ldd,%B0,%1+1) CR_TAB
433
+                            AS2 (ldd,%C0,%1+2) CR_TAB
434
+                            AS2 (ldd,%D0,%1+3));
435
+        }
436
         }
437
     }
438
   else if (GET_CODE (base) == PLUS) /* (R + i) */
439
@@ -2268,14 +2499,36 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
440
 	    fatal_insn ("incorrect insn:",insn);
441
 
442
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (src)))
443
-	    return *l = 6, (AS2 (adiw,r28,%o1-60) CR_TAB
444
+	    return *l = 6, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o1-60))) CR_TAB
445
+						  AS2 (sbci,r29,hi8(-(%o1-60))) CR_TAB
446
+                          AS2 (subi,r28,lo8(-60)) CR_TAB
447
+                          AS2 (sbci,r29,hi8(-60)) CR_TAB
448
+						  AS2 (ld,%A0,Y+)    CR_TAB
449
+						  AS2 (ld,%B0,Y+)    CR_TAB
450
+						  AS2 (ld,%C0,Y+)    CR_TAB
451
+						  AS2 (ld,%D0,Y)    CR_TAB
452
+                          AS2 (subi,r28,lo8(63)) CR_TAB
453
+                          AS2 (sbci,r29,hi8(63)) CR_TAB
454
+                          AS2 (subi,r28,lo8(%o1-60)) CR_TAB
455
+                          AS2 (sbci,r29,hi8(%o1-60)))
456
+						   : (AS2 (adiw,r28,%o1-60) CR_TAB
457
 			    AS2 (ldd,%A0,Y+60)    CR_TAB
458
 			    AS2 (ldd,%B0,Y+61)    CR_TAB
459
 			    AS2 (ldd,%C0,Y+62)    CR_TAB
460
 			    AS2 (ldd,%D0,Y+63)    CR_TAB
461
 			    AS2 (sbiw,r28,%o1-60));
462
 
463
-	  return *l = 8, (AS2 (subi,r28,lo8(-%o1)) CR_TAB
464
+	  return *l = 8, AVR_TINY ? (AS2 (subi,r28,lo8(-%o1)) CR_TAB
465
+						AS2 (sbci,r29,hi8(-%o1)) CR_TAB
466
+						AS2 (ld,%A0,Y+)           CR_TAB
467
+						AS2 (ld,%B0,Y+)           CR_TAB
468
+						AS2 (ld,%C0,Y+)           CR_TAB
469
+						AS2 (ld,%D0,Y)           CR_TAB
470
+                        AS2 (subi,r28,lo8(3))   CR_TAB
471
+                        AS2 (sbci,r29,hi8(3))   CR_TAB
472
+						AS2 (subi,r28,lo8(%o1))  CR_TAB
473
+						AS2 (sbci,r29,hi8(%o1)))
474
+			             : (AS2 (subi,r28,lo8(-%o1)) CR_TAB
475
 			  AS2 (sbci,r29,hi8(-%o1)) CR_TAB
476
 			  AS2 (ld,%A0,Y)           CR_TAB
477
 			  AS2 (ldd,%B0,Y+1)        CR_TAB
478
@@ -2293,7 +2546,16 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
479
 	    {
480
 	      *l = 7;
481
 	      /* "ld r26,-X" is undefined */
482
-	      return (AS2 (adiw,r26,%o1+3)    CR_TAB
483
+	      return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o1+3)))  CR_TAB
484
+					AS2 (sbci,r27,hi8(-(%o1+3)))  CR_TAB
485
+					AS2 (ld,r29,X)          CR_TAB
486
+		            AS2 (ld,r28,-X)         CR_TAB
487
+		            AS2 (ld,__tmp_reg__,-X) CR_TAB
488
+                    AS2 (subi,r26,lo8(1))   CR_TAB
489
+                    AS2 (sbci,r27,hi8(1))   CR_TAB
490
+		            AS2 (ld,r26,X)          CR_TAB
491
+		            AS2 (mov,r27,__tmp_reg__))
492
+		             : (AS2 (adiw,r26,%o1+3)    CR_TAB
493
 		      AS2 (ld,r29,X)          CR_TAB
494
 		      AS2 (ld,r28,-X)         CR_TAB
495
 		      AS2 (ld,__tmp_reg__,-X) CR_TAB
496
@@ -2303,14 +2565,29 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
497
 	    }
498
 	  *l = 6;
499
 	  if (reg_dest == REG_X - 2)
500
-	    return (AS2 (adiw,r26,%o1)      CR_TAB
501
+	    return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o1))) CR_TAB
502
+				  AS2 (sbci,r27,hi8(-(%o1))) CR_TAB
503
+		          AS2 (ld,r24,X+)         CR_TAB
504
+		          AS2 (ld,r25,X+)         CR_TAB
505
+		          AS2 (ld,__tmp_reg__,X+) CR_TAB
506
+		          AS2 (ld,r27,X)          CR_TAB
507
+		          AS2 (mov,r26,__tmp_reg__))
508
+		           : (AS2 (adiw,r26,%o1)      CR_TAB
509
 		    AS2 (ld,r24,X+)         CR_TAB
510
 		    AS2 (ld,r25,X+)         CR_TAB
511
 		    AS2 (ld,__tmp_reg__,X+) CR_TAB
512
 		    AS2 (ld,r27,X)          CR_TAB
513
 		    AS2 (mov,r26,__tmp_reg__));
514
 
515
-	  return (AS2 (adiw,r26,%o1) CR_TAB
516
+	  return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o1))) CR_TAB
517
+			    AS2 (sbci,r27,hi8(-(%o1))) CR_TAB
518
+		        AS2 (ld,%A0,X+)    CR_TAB
519
+		        AS2 (ld,%B0,X+)    CR_TAB
520
+		        AS2 (ld,%C0,X+)    CR_TAB
521
+		        AS2 (ld,%D0,X)     CR_TAB
522
+		        AS2 (subi,r26,lo8(%o1+3)) CR_TAB
523
+				AS2 (sbci,r27,hi8(%o1+3)))
524
+				 : (AS2 (adiw,r26,%o1) CR_TAB
525
 		  AS2 (ld,%A0,X+)    CR_TAB
526
 		  AS2 (ld,%B0,X+)    CR_TAB
527
 		  AS2 (ld,%C0,X+)    CR_TAB
528
@@ -2318,18 +2595,99 @@ out_movsi_r_mr (rtx insn, rtx op[], int 
529
 		  AS2 (sbiw,r26,%o1+3));
530
 	}
531
       if (reg_dest == reg_base)
532
-        return *l=5, (AS2 (ldd,%D0,%D1) CR_TAB
533
+	  {
534
+			op[2] = XEXP(base, 0);
535
+
536
+		if(REGNO(op[2]) == REG_Y)
537
+        return *l=5, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1+4))) CR_TAB
538
+						AS2 (sbci,%B2,hi8(-(%o1+4))) CR_TAB
539
+						AS2 (ld,%D0,-Y)               CR_TAB
540
+		                AS2 (ld,%C0,-Y)               CR_TAB
541
+		                AS2 (ld,__tmp_reg__,-Y)       CR_TAB
542
+		                AS2 (ld,%A0,-Y)               CR_TAB
543
+                        AS2 (subi,%A2,lo8(%o1)) CR_TAB
544
+						AS2 (sbci,%B2,hi8(%o1)) CR_TAB
545
+                        AS2 (mov,%B0,__tmp_reg__))
546
+			             : (AS2 (ldd,%D0,%D1) CR_TAB
547
+                        AS2 (ldd,%C0,%C1) CR_TAB
548
+                        AS2 (ldd,__tmp_reg__,%B1)  CR_TAB
549
+                        AS2 (ldd,%A0,%A1) CR_TAB
550
+                        AS2 (mov,%B0,__tmp_reg__));
551
+		if(REGNO(op[2]) == REG_Z)
552
+        return *l=5, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1+4))) CR_TAB
553
+						AS2 (sbci,%B2,hi8(-(%o1+4))) CR_TAB
554
+						AS2 (ld,%D0,-Z)               CR_TAB
555
+		                AS2 (ld,%C0,-Z)               CR_TAB
556
+		                AS2 (ld,__tmp_reg__,-Z)       CR_TAB
557
+		                AS2 (ld,%A0,-Z)               CR_TAB
558
+                        AS2 (subi,%A2,lo8(%o1)) CR_TAB
559
+						AS2 (sbci,%B2,hi8(%o1)) CR_TAB
560
+                        AS2 (mov,%B0,__tmp_reg__))
561
+			             : (AS2 (ldd,%D0,%D1)			CR_TAB
562
                       AS2 (ldd,%C0,%C1) CR_TAB
563
                       AS2 (ldd,__tmp_reg__,%B1)  CR_TAB
564
                       AS2 (ldd,%A0,%A1) CR_TAB
565
                       AS2 (mov,%B0,__tmp_reg__));
566
+	  }
567
       else if (reg_dest == reg_base - 2)
568
-        return *l=5, (AS2 (ldd,%A0,%A1) CR_TAB
569
+	  {
570
+			op[2] = XEXP(base, 0);
571
+
572
+		if(REGNO(op[2]) == REG_Y)
573
+        return *l=5, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1)))   CR_TAB
574
+						AS2 (subi,%B2,hi8(-(%o1)))   CR_TAB
575
+		                AS2 (ld,%A0,Y+)               CR_TAB
576
+		                AS2 (ld,%B0,Y+)               CR_TAB
577
+		                AS2 (ld,__tmp_reg__,Y+)       CR_TAB
578
+						AS2 (ld,%D0,Y)               CR_TAB
579
+						AS2 (subi,%A2,lo8(%o1+3)) CR_TAB
580
+						AS2 (sbci,%B2,hi8(%o1+3)) CR_TAB
581
+                        AS2 (mov,%C0,__tmp_reg__)) 
582
+			             : (AS2 (ldd,%A0,%A1)          CR_TAB
583
                       AS2 (ldd,%B0,%B1) CR_TAB
584
                       AS2 (ldd,__tmp_reg__,%C1)  CR_TAB
585
                       AS2 (ldd,%D0,%D1) CR_TAB
586
                       AS2 (mov,%C0,__tmp_reg__));
587
-      return *l=4, (AS2 (ldd,%A0,%A1) CR_TAB
588
+		if(REGNO(op[2]) == REG_Z)
589
+        return *l=5, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1)))   CR_TAB
590
+						AS2 (subi,%B2,hi8(-(%o1)))   CR_TAB
591
+		                AS2 (ld,%A0,Z+)              CR_TAB
592
+		                AS2 (ld,%B0,Z+)              CR_TAB
593
+		                AS2 (ld,__tmp_reg__,Z+)      CR_TAB
594
+						AS2 (ld,%D0,Z)               CR_TAB
595
+						AS2 (subi,%A2,lo8(%o1+3))    CR_TAB
596
+						AS2 (sbci,%B2,hi8(%o1+3))    CR_TAB
597
+                        AS2 (mov,%C0,__tmp_reg__)) 
598
+			             : (AS2 (ldd,%A0,%A1)          CR_TAB
599
+                        AS2 (ldd,%B0,%B1)          CR_TAB
600
+                        AS2 (ldd,__tmp_reg__,%C1)  CR_TAB
601
+                        AS2 (ldd,%D0,%D1)          CR_TAB
602
+                        AS2 (mov,%C0,__tmp_reg__));
603
+	  }
604
+			op[2] = XEXP(base, 0);
605
+		if(REGNO(op[2]) == REG_Y)
606
+        return *l=4, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1)))   CR_TAB
607
+						AS2 (subi,%B2,hi8(-(%o1)))   CR_TAB
608
+		                AS2 (ld,%A0,Y+)               CR_TAB
609
+		                AS2 (ld,%B0,Y+)               CR_TAB
610
+		                AS2 (ld,%C0,Y+)               CR_TAB
611
+						AS2 (ld,%D0,Y)                CR_TAB
612
+						AS2 (subi,%A2,lo8(%o1+3)) CR_TAB
613
+						AS2 (sbci,%B2,hi8(%o1+3))) 
614
+			             : (AS2 (ldd,%A0,%A1) CR_TAB
615
+                        AS2 (ldd,%B0,%B1) CR_TAB
616
+                        AS2 (ldd,%C0,%C1) CR_TAB
617
+                        AS2 (ldd,%D0,%D1));
618
+		if(REGNO(op[2]) == REG_Z)
619
+        return *l=4, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o1)))   CR_TAB
620
+						AS2 (subi,%B2,hi8(-(%o1)))   CR_TAB
621
+		                AS2 (ld,%A0,Z+)               CR_TAB
622
+		                AS2 (ld,%B0,Z+)               CR_TAB
623
+		                AS2 (ld,%C0,Z+)               CR_TAB
624
+						AS2 (ld,%D0,Z)               CR_TAB
625
+						AS2 (subi,%A2,lo8(%o1+3)) CR_TAB
626
+						AS2 (sbci,%B2,hi8(%o1+3)))
627
+			             : (AS2 (ldd,%A0,%A1) CR_TAB
628
                     AS2 (ldd,%B0,%B1) CR_TAB
629
                     AS2 (ldd,%C0,%C1) CR_TAB
630
                     AS2 (ldd,%D0,%D1));
631
@@ -2380,14 +2738,30 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
632
             {
633
 	      /* "st X+,r26" is undefined */
634
               if (reg_unused_after (insn, base))
635
-		return *l=6, (AS2 (mov,__tmp_reg__,r27) CR_TAB
636
+		return *l=6, AVR_TINY ? (AS2 (mov,__tmp_reg__,r27) CR_TAB
637
+			            AS2 (st,X,r26)            CR_TAB
638
+			            AS2 (subi,r26,lo8(-1))    CR_TAB
639
+			            AS2 (sbci,r27,hi8(-1))    CR_TAB
640
+			            AS2 (st,X+,__tmp_reg__)   CR_TAB
641
+			            AS2 (st,X+,r28)           CR_TAB
642
+			            AS2 (st,X,r29))
643
+			             : (AS2 (mov,__tmp_reg__,r27) CR_TAB
644
 			      AS2 (st,X,r26)            CR_TAB
645
 			      AS2 (adiw,r26,1)          CR_TAB
646
 			      AS2 (st,X+,__tmp_reg__)   CR_TAB
647
 			      AS2 (st,X+,r28)           CR_TAB
648
 			      AS2 (st,X,r29));
649
               else
650
-                return *l=7, (AS2 (mov,__tmp_reg__,r27) CR_TAB
651
+        return *l=7, AVR_TINY ? (AS2 (mov,__tmp_reg__,r27) CR_TAB
652
+			            AS2 (st,X,r26)            CR_TAB
653
+			            AS2 (subi,r26,lo8(-1))    CR_TAB
654
+			            AS2 (sbci,r27,hi8(-1))    CR_TAB
655
+			            AS2 (st,X+,__tmp_reg__)   CR_TAB
656
+			            AS2 (st,X+,r28)           CR_TAB
657
+			            AS2 (st,X,r29)            CR_TAB
658
+			            AS2 (subi,r26,lo8(3))     CR_TAB
659
+			            AS2 (sbci,r27,hi8(3)))
660
+				         : (AS2 (mov,__tmp_reg__,r27) CR_TAB
661
 			      AS2 (st,X,r26)            CR_TAB
662
 			      AS2 (adiw,r26,1)          CR_TAB
663
 			      AS2 (st,X+,__tmp_reg__)   CR_TAB
664
@@ -2406,7 +2780,16 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
665
                               AS2 (st,%0,__tmp_reg__)   CR_TAB
666
                               AS1 (clr,__zero_reg__));
667
               else
668
-                return *l=8, (AS2 (mov,__zero_reg__,%C1) CR_TAB
669
+                return *l=8, AVR_TINY ? (AS2 (mov,__zero_reg__,%C1) CR_TAB
670
+                                AS2 (mov,__tmp_reg__,%D1)  CR_TAB
671
+                                AS2 (st,%0+,%A1)           CR_TAB
672
+                                AS2 (st,%0+,%B1)           CR_TAB
673
+                                AS2 (st,%0+,__zero_reg__)  CR_TAB
674
+                                AS2 (st,%0,__tmp_reg__)    CR_TAB
675
+                                AS1 (clr,__zero_reg__)     CR_TAB
676
+			                    AS2 (subi,r26,lo8(3))      CR_TAB
677
+			                    AS2 (sbci,r27,hi8(3)))
678
+					             : (AS2 (mov,__zero_reg__,%C1) CR_TAB
679
                               AS2 (mov,__tmp_reg__,%D1) CR_TAB
680
                               AS2 (st,%0+,%A1) CR_TAB
681
                               AS2 (st,%0+,%B1) CR_TAB
682
@@ -2415,18 +2798,44 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
683
                               AS1 (clr,__zero_reg__)     CR_TAB
684
                               AS2 (sbiw,r26,3));
685
             }
686
-          return *l=5, (AS2 (st,%0+,%A1)  CR_TAB
687
+          return *l=5, AVR_TINY ? (AS2 (st,%0+,%A1)  CR_TAB
688
+                          AS2 (st,%0+,%B1)  CR_TAB
689
+                          AS2 (st,%0+,%C1)  CR_TAB
690
+                          AS2 (st,%0,%D1)   CR_TAB
691
+			              AS2 (subi,r26,lo8(3))      CR_TAB
692
+			              AS2 (sbci,r27,hi8(3)))
693
+				           : (AS2 (st,%0+,%A1)  CR_TAB
694
                         AS2 (st,%0+,%B1) CR_TAB
695
                         AS2 (st,%0+,%C1) CR_TAB
696
                         AS2 (st,%0,%D1)  CR_TAB
697
                         AS2 (sbiw,r26,3));
698
         }
699
       else
700
-        return *l=4, (AS2 (st,%0,%A1)    CR_TAB
701
+	 {
702
+		 if(reg_base == REG_Y)
703
+        return *l=4, AVR_TINY ? (AS2 (st,Y+,%A1)        CR_TAB
704
+		                AS2 (st,Y+,%B1)        CR_TAB
705
+		                AS2 (st,Y+,%C1)        CR_TAB
706
+		                AS2 (st,Y,%D1)        CR_TAB
707
+				        AS2 (subi,r28,lo8(3)) CR_TAB
708
+				        AS2 (sbci,r29,lo8(3)))
709
+			             : (AS2 (st,%0,%A1)    CR_TAB
710
+		                AS2 (std,%0+1,%B1) CR_TAB
711
+		                AS2 (std,%0+2,%C1) CR_TAB
712
+		                AS2 (std,%0+3,%D1));
713
+		 if(reg_base == REG_Z)
714
+        return *l=4, AVR_TINY ? (AS2 (st,Z+,%A1)        CR_TAB
715
+		                AS2 (st,Z+,%B1)        CR_TAB
716
+		                AS2 (st,Z+,%C1)        CR_TAB
717
+		                AS2 (st,Z,%D1)        CR_TAB
718
+				        AS2 (subi,r30,lo8(3)) CR_TAB
719
+				        AS2 (sbci,r31,lo8(3)))
720
+			             : (AS2 (st,%0,%A1)    CR_TAB
721
 		      AS2 (std,%0+1,%B1) CR_TAB
722
 		      AS2 (std,%0+2,%C1) CR_TAB
723
 		      AS2 (std,%0+3,%D1));
724
     }
725
+    }
726
   else if (GET_CODE (base) == PLUS) /* (R + i) */
727
     {
728
       int disp = INTVAL (XEXP (base, 1));
729
@@ -2437,14 +2846,35 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
730
 	    fatal_insn ("incorrect insn:",insn);
731
 
732
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
733
-	    return *l = 6, (AS2 (adiw,r28,%o0-60) CR_TAB
734
+	    return *l = 6, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o0-60))) CR_TAB
735
+				          AS2 (sbci,r29,hi8(-(%o0-60))) CR_TAB
736
+				          AS2 (subi,r28,lo8(-60)) CR_TAB
737
+				          AS2 (sbci,r29,lo8(-60)) CR_TAB
738
+			              AS2 (st,Y+,%A1)          CR_TAB
739
+			              AS2 (st,Y+,%B1)          CR_TAB
740
+			              AS2 (st,Y+,%C1)          CR_TAB
741
+			              AS2 (st,Y,%D1)          CR_TAB
742
+				          AS2 (subi,r28,lo8(63)) CR_TAB
743
+				          AS2 (sbci,r29,lo8(63)) CR_TAB
744
+			              AS2 (subi,r28,lo8(%o0-60)) CR_TAB 
745
+			              AS2 (sbci,r29,hi8(%o0-60)))  
746
+			               : (AS2 (adiw,r28,%o0-60) CR_TAB
747
 			    AS2 (std,Y+60,%A1)    CR_TAB
748
 			    AS2 (std,Y+61,%B1)    CR_TAB
749
 			    AS2 (std,Y+62,%C1)    CR_TAB
750
 			    AS2 (std,Y+63,%D1)    CR_TAB
751
 			    AS2 (sbiw,r28,%o0-60));
752
-
753
-	  return *l = 8, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
754
+	  return *l = 8, AVR_TINY ? (AS2 (subi,r28,lo8(-%o0)) CR_TAB
755
+			            AS2 (sbci,r29,hi8(-%o0)) CR_TAB
756
+			            AS2 (st,Y+,%A1)           CR_TAB
757
+			            AS2 (st,Y+,%B1)           CR_TAB
758
+			            AS2 (st,Y+,%C1)           CR_TAB
759
+			            AS2 (st,Y,%D1)           CR_TAB
760
+				        AS2 (subi,r28,lo8(3))   CR_TAB
761
+				        AS2 (sbci,r29,lo8(3))   CR_TAB
762
+			            AS2 (subi,r28,lo8(%o0))  CR_TAB
763
+			            AS2 (sbci,r29,hi8(%o0)))
764
+			             : (AS2 (subi,r28,lo8(-%o0)) CR_TAB
765
 			  AS2 (sbci,r29,hi8(-%o0)) CR_TAB
766
 			  AS2 (st,Y,%A1)           CR_TAB
767
 			  AS2 (std,Y+1,%B1)        CR_TAB
768
@@ -2459,7 +2889,18 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
769
 	  if (reg_src == REG_X)
770
 	    {
771
 	      *l = 9;
772
-	      return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
773
+	      return AVR_TINY ? (AS2 (mov,__tmp_reg__,r26)  CR_TAB
774
+		            AS2 (mov,__zero_reg__,r27) CR_TAB
775
+	                AS2 (subi,r26,lo8(-(%o0))) CR_TAB
776
+			        AS2 (sbci,r27,hi8(-(%o0))) CR_TAB
777
+		            AS2 (st,X+,__tmp_reg__)    CR_TAB
778
+		            AS2 (st,X+,__zero_reg__)   CR_TAB
779
+		            AS2 (st,X+,r28)            CR_TAB
780
+		            AS2 (st,X,r29)             CR_TAB
781
+		            AS1 (clr,__zero_reg__)     CR_TAB
782
+					AS2 (subi,r26,lo8(%o0+3))  CR_TAB
783
+		            AS2 (sbci,r27,hi8(%o0+3)))
784
+			         : (AS2 (mov,__tmp_reg__,r26)  CR_TAB
785
 		      AS2 (mov,__zero_reg__,r27) CR_TAB
786
 		      AS2 (adiw,r26,%o0)         CR_TAB
787
 		      AS2 (st,X+,__tmp_reg__)    CR_TAB
788
@@ -2472,7 +2913,18 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
789
 	  else if (reg_src == REG_X - 2)
790
 	    {
791
 	      *l = 9;
792
-	      return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
793
+	      return AVR_TINY ? (AS2 (mov,__tmp_reg__,r26)  CR_TAB
794
+		            AS2 (mov,__zero_reg__,r27) CR_TAB
795
+	                AS2 (subi,r26,lo8(-(%o0))) CR_TAB
796
+			        AS2 (sbci,r27,hi8(-(%o0))) CR_TAB
797
+		            AS2 (st,X+,r24)            CR_TAB
798
+		            AS2 (st,X+,r25)            CR_TAB
799
+		            AS2 (st,X+,__tmp_reg__)    CR_TAB
800
+		            AS2 (st,X,__zero_reg__)    CR_TAB
801
+		            AS1 (clr,__zero_reg__)     CR_TAB
802
+					AS2 (subi,r26,lo8(%o0+3)) CR_TAB
803
+		            AS2 (sbci,r27,hi8(%o0+3)))
804
+			         : (AS2 (mov,__tmp_reg__,r26)  CR_TAB
805
 		      AS2 (mov,__zero_reg__,r27) CR_TAB
806
 		      AS2 (adiw,r26,%o0)         CR_TAB
807
 		      AS2 (st,X+,r24)            CR_TAB
808
@@ -2483,14 +2935,46 @@ out_movsi_mr_r (rtx insn, rtx op[], int 
809
 		      AS2 (sbiw,r26,%o0+3));
810
 	    }
811
 	  *l = 6;
812
-	  return (AS2 (adiw,r26,%o0) CR_TAB
813
+	  return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o0))) CR_TAB
814
+			    AS2 (sbci,r27,hi8(-(%o0))) CR_TAB
815
+		        AS2 (st,X+,%A1)    CR_TAB
816
+		        AS2 (st,X+,%B1)    CR_TAB
817
+		        AS2 (st,X+,%C1)    CR_TAB
818
+		        AS2 (st,X,%D1)     CR_TAB
819
+				AS2 (subi,r26,lo8(%o0+3)) CR_TAB
820
+		        AS2 (sbci,r27,hi8(%o0+3)))
821
+		         : (AS2 (adiw,r26,%o0) CR_TAB
822
 		  AS2 (st,X+,%A1)    CR_TAB
823
 		  AS2 (st,X+,%B1)    CR_TAB
824
 		  AS2 (st,X+,%C1)    CR_TAB
825
 		  AS2 (st,X,%D1)     CR_TAB
826
 		  AS2 (sbiw,r26,%o0+3));
827
 	}
828
-      return *l=4, (AS2 (std,%A0,%A1)    CR_TAB
829
+		op[2] = XEXP(base, 0);
830
+		if(REGNO(op[2]) == REG_Y)
831
+      return *l=4, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0)))    CR_TAB
832
+					  AS2 (sbci,%B2,hi8(-(%o0)))    CR_TAB
833
+		              AS2 (st,Y+,%A1)               CR_TAB
834
+		              AS2 (st,Y+,%B1)               CR_TAB
835
+		              AS2 (st,Y+,%C1)               CR_TAB
836
+		              AS2 (st,Y,%D1)                CR_TAB
837
+					  AS2 (subi,%A2,lo8(%o0+3))     CR_TAB
838
+					  AS2 (sbci,%B2,hi8(%o0+3)))
839
+		               : (AS2 (std,%A0,%A1)    CR_TAB
840
+		              AS2 (std,%B0,%B1)    CR_TAB
841
+		              AS2 (std,%C0,%C1)    CR_TAB
842
+		              AS2 (std,%D0,%D1));
843
+
844
+		if(REGNO(op[2]) == REG_Z)
845
+      return *l=4, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0)))    CR_TAB
846
+					  AS2 (sbci,%B2,hi8(-(%o0)))    CR_TAB
847
+		              AS2 (st,Z+,%A1)              CR_TAB
848
+		              AS2 (st,Z+,%B1)             CR_TAB
849
+		              AS2 (st,Z+,%C1)             CR_TAB
850
+		              AS2 (st,Z,%D1)              CR_TAB
851
+					  AS2 (subi,%A2,lo8(%o0+3))    CR_TAB
852
+					  AS2 (sbci,%B2,hi8(%o0+3)))
853
+		               : (AS2 (std,%A0,%A1)    CR_TAB
854
 		    AS2 (std,%B0,%B1) CR_TAB
855
 		    AS2 (std,%C0,%C1) CR_TAB
856
 		    AS2 (std,%D0,%D1));
857
@@ -2707,7 +3191,16 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
858
 	    fatal_insn ("incorrect insn:",insn);
859
 
860
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
861
-	    return *l = 3, (AS2 (adiw,r28,%o0-63) CR_TAB
862
+	    return *l = 3, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o0-63))) CR_TAB
863
+				          AS2 (sbci,r29,hi8(-(%o0-63))) CR_TAB
864
+						  AS2 (subi,r28,lo8(-63)) CR_TAB
865
+						  AS2 (sbci,r29,hi8(-63)) CR_TAB
866
+			              AS2 (st,Y,%1)           CR_TAB
867
+						  AS2 (subi,r28,lo8(63)) CR_TAB
868
+						  AS2 (sbci,r29,hi8(63)) CR_TAB
869
+				          AS2 (subi,r28,lo8(%o0-63)) CR_TAB
870
+			              AS2 (sbci,r29,hi8(%o0-63)))
871
+			               : (AS2 (adiw,r28,%o0-63) CR_TAB
872
 			    AS2 (std,Y+63,%1)     CR_TAB
873
 			    AS2 (sbiw,r28,%o0-63));
874
 
875
@@ -2722,11 +3215,21 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
876
 	  if (reg_overlap_mentioned_p (src, XEXP (x, 0)))
877
 	    {
878
 	      if (reg_unused_after (insn, XEXP (x,0)))
879
-		return *l = 3, (AS2 (mov,__tmp_reg__,%1) CR_TAB
880
+		return *l = 3, AVR_TINY ? (AS2 (mov,__tmp_reg__,%1) CR_TAB
881
+			              AS2 (subi,r26,lo8(-(%o0)))       CR_TAB
882
+			              AS2 (sbci,r27,hi8(-(%o0)))       CR_TAB
883
+				          AS2 (st,X,__tmp_reg__))
884
+			               : (AS2 (mov,__tmp_reg__,%1) CR_TAB
885
 				AS2 (adiw,r26,%o0)       CR_TAB
886
 				AS2 (st,X,__tmp_reg__));
887
 
888
-	      return *l = 4, (AS2 (mov,__tmp_reg__,%1) CR_TAB
889
+	      return *l = 4, AVR_TINY ? (AS2 (mov,__tmp_reg__,%1) CR_TAB
890
+			                AS2 (subi,r26,lo8(-(%o0)))       CR_TAB
891
+			                AS2 (sbci,r27,hi8(-(%o0)))       CR_TAB
892
+			                AS2 (st,X,__tmp_reg__)   CR_TAB
893
+			                AS2 (subi,r26,lo8(%o0))       CR_TAB
894
+			                AS2 (sbci,r27,hi8(%o0)))
895
+				             : (AS2 (mov,__tmp_reg__,%1) CR_TAB
896
 			      AS2 (adiw,r26,%o0)       CR_TAB
897
 			      AS2 (st,X,__tmp_reg__)   CR_TAB
898
 			      AS2 (sbiw,r26,%o0));
899
@@ -2734,16 +3237,38 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
900
 	  else
901
 	    {
902
 	      if (reg_unused_after (insn, XEXP (x,0)))
903
-		return *l = 2, (AS2 (adiw,r26,%o0) CR_TAB
904
+		return *l = 2, AVR_TINY ? (AS2 (subi,r26,lo8(-(%o0)))       CR_TAB
905
+			              AS2 (sbci,r27,hi8(-(%o0)))       CR_TAB
906
+				          AS2 (st,X,%1))
907
+			               : (AS2 (adiw,r26,%o0) CR_TAB
908
 				AS2 (st,X,%1));
909
 
910
-	      return *l = 3, (AS2 (adiw,r26,%o0) CR_TAB
911
+	      return *l = 3, AVR_TINY ? (AS2 (subi,r26,lo8(-(%o0)))       CR_TAB
912
+			                AS2 (sbci,r27,hi8(-(%o0)))       CR_TAB
913
+			                AS2 (st,X,%1)                    CR_TAB
914
+			                AS2 (subi,r26,lo8(%o0))          CR_TAB
915
+			                AS2 (sbci,r27,hi8(%o0)))
916
+							 : (AS2 (adiw,r26,%o0) CR_TAB
917
 			      AS2 (st,X,%1)      CR_TAB
918
 			      AS2 (sbiw,r26,%o0));
919
 	    }
920
 	}
921
       *l = 1;
922
-      return AS2 (std,%0,%1);
923
+	  op[2] = XEXP(x, 0);
924
+	  if(REGNO(op[2]) == REG_Y)
925
+      return AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
926
+				AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
927
+		        AS2 (st,Y,%1)              CR_TAB
928
+                AS2 (subi,%A2,lo8(%o0)) CR_TAB
929
+				AS2 (sbci,%B2,hi8(%o0)))
930
+		         :  AS2 (std,%0,%1);
931
+	  if(REGNO(op[2]) == REG_Z)
932
+      return AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
933
+				AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
934
+		        AS2 (st,Z,%1)              CR_TAB
935
+                AS2 (subi,%A2,lo8(%o0)) CR_TAB
936
+				AS2 (sbci,%B2,hi8(%o0)))
937
+		         :  AS2 (std,%0,%1);
938
     }
939
   *l = 1;
940
   return AS2 (st,%0,%1);
941
@@ -2792,20 +3317,39 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
942
             {
943
               /* "st X+,r26" and "st -X,r26" are undefined.  */
944
               if (!mem_volatile_p && reg_unused_after (insn, src))
945
-		return *l=4, (AS2 (mov,__tmp_reg__,r27) CR_TAB
946
+		return *l=4, AVR_TINY ? (AS2 (mov,__tmp_reg__,r27)  CR_TAB
947
+			            AS2 (st,X,r26)             CR_TAB
948
+			            AS2 (subi,r26,lo8(-1))     CR_TAB
949
+			            AS2 (sbci,r27,hi8(-1))     CR_TAB
950
+			            AS2 (st,X,__tmp_reg__))
951
+			             : (AS2 (mov,__tmp_reg__,r27)  CR_TAB
952
 			      AS2 (st,X,r26)            CR_TAB
953
 			      AS2 (adiw,r26,1)          CR_TAB
954
 			      AS2 (st,X,__tmp_reg__));
955
               else
956
 	        {
957
                   if (!AVR_XMEGA)
958
-		return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
959
+		    return *l=5, AVR_TINY ? (AS2 (mov,__tmp_reg__,r27) CR_TAB
960
+							AS2 (subi,r26,lo8(-1))    CR_TAB
961
+							AS2 (sbci,r27,hi8(-1))    CR_TAB
962
+							AS2 (st,X,__tmp_reg__)    CR_TAB
963
+							AS2 (subi,r26,lo8(1))     CR_TAB
964
+							AS2 (sbci,r27,hi8(1))     CR_TAB
965
+							AS2 (st,X,r26))
966
+							 : (AS2 (mov,__tmp_reg__,r27) CR_TAB
967
 			      AS2 (adiw,r26,1)          CR_TAB
968
 			      AS2 (st,X,__tmp_reg__)    CR_TAB
969
                               AS2 (sbiw,r26,1)          CR_TAB
970
                               AS2 (st,X,r26));
971
 		  else
972
- 		    return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
973
+ 		    return *l=5, AVR_TINY ? (AS2 (mov,__tmp_reg__,r27) CR_TAB
974
+			                AS2 (st,X,r26)            CR_TAB
975
+						    AS2 (subi,r26,lo8(-1))    CR_TAB
976
+						    AS2 (sbci,r27,hi8(-1))    CR_TAB
977
+ 			                AS2 (st,X,__tmp_reg__)    CR_TAB
978
+						    AS2 (subi,r26,lo8(1))     CR_TAB
979
+						    AS2 (sbci,r27,hi8(1)))
980
+				             : (AS2 (mov,__tmp_reg__,r27) CR_TAB
981
 			          AS2 (st,X,r26)            CR_TAB
982
  			          AS2 (adiw,r26,1)          CR_TAB
983
  			          AS2 (st,X,__tmp_reg__)    CR_TAB
984
@@ -2820,11 +3364,19 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
985
               else
986
 		{
987
                   if (!AVR_XMEGA)
988
-                return *l=3, (AS2 (adiw,r26,1) CR_TAB
989
+                    return *l=3, AVR_TINY ? (AS2 (subi,r26,lo8(-1)) CR_TAB
990
+							        AS2 (sbci,r27,hi8(-1)) CR_TAB
991
+                                    AS2 (st,X,%B1)         CR_TAB
992
+                                    AS2 (st,-X,%A1))
993
+						             : (AS2 (adiw,r26,1) CR_TAB
994
                               AS2 (st,X,%B1)   CR_TAB
995
                               AS2 (st,-X,%A1));
996
 	          else
997
-                    return *l=3, (AS2 (st,X+,%A1) CR_TAB
998
+                    return *l=3, AVR_TINY ? (AS2 (st,X+,%A1) CR_TAB
999
+                                    AS2 (st,X,%B1) CR_TAB
1000
+						            AS2 (subi,r26,lo8(1))     CR_TAB
1001
+						            AS2 (sbci,r27,hi8(1)))
1002
+						             : (AS2 (st,X+,%A1) CR_TAB
1003
                                   AS2 (st,X,%B1) CR_TAB
1004
                                   AS2 (sbiw,r26,1));
1005
 		}
1006
@@ -2833,13 +3385,41 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1007
       else
1008
         {
1009
 	  if (!AVR_XMEGA)
1010
-        return  *l=2, (AS2 (std,%0+1,%B1) CR_TAB
1011
+	  {
1012
+		    if(reg_base == REG_Y)
1013
+            return  *l=2, AVR_TINY ? (AS2 (subi,r28,lo8(-1))  CR_TAB
1014
+			                 AS2 (sbci,r29,hi8(-1))  CR_TAB
1015
+                             AS2 (st,Y,%B1)         CR_TAB
1016
+                             AS2 (st,-Y,%A1))
1017
+				              : (AS2 (std,%0+1,%B1)      CR_TAB
1018
+                             AS2 (st,%0,%A1));
1019
+		    if(reg_base == REG_Z)
1020
+            return  *l=2, AVR_TINY ? (AS2 (subi,r30,lo8(-1))  CR_TAB
1021
+			                 AS2 (sbci,r31,hi8(-1))  CR_TAB
1022
+                             AS2 (st,Z,%B1)         CR_TAB
1023
+                             AS2 (st,-Z,%A1))
1024
+				              : (AS2 (std,%0+1,%B1)      CR_TAB
1025
                        AS2 (st,%0,%A1));
1026
+	  }
1027
 	  else
1028
-            return  *l=2, (AS2 (st,%0,%A1)    CR_TAB
1029
+	  {
1030
+		    if(reg_base == REG_Y)
1031
+            return  *l=2, AVR_TINY ? (AS2 (st,Y+,%A1)        CR_TAB
1032
+                             AS2 (st,Y,%B1)        CR_TAB
1033
+					         AS2 (subi,r28,lo8(1))  CR_TAB
1034
+			                 AS2 (sbci,r29,hi8(1)))
1035
+					          : (AS2 (st,%0,%A1)    CR_TAB
1036
+                             AS2 (std,%0+1,%B1));
1037
+		    if(reg_base == REG_Z)
1038
+            return  *l=2, AVR_TINY ? (AS2 (st,Z+,%A1)         CR_TAB
1039
+                             AS2 (st,Z,%B1)         CR_TAB
1040
+					         AS2 (subi,r30,lo8(1))  CR_TAB
1041
+			                 AS2 (sbci,r31,hi8(1)))
1042
+					          : (AS2 (st,%0,%A1)    CR_TAB
1043
                            AS2 (std,%0+1,%B1));
1044
         }
1045
     }
1046
+    }
1047
   else if (GET_CODE (base) == PLUS)
1048
     {
1049
       int disp = INTVAL (XEXP (base, 1));
1050
@@ -2852,12 +3432,30 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1051
           if (!AVR_XMEGA)
1052
             {
1053
 	  if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
1054
-	    return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
1055
+	        return *l = 4, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o0-62))) CR_TAB
1056
+					          AS2 (sbci,r29,hi8(-(%o0-62))) CR_TAB
1057
+							  AS2 (subi,r28,lo8(-63))       CR_TAB
1058
+							  AS2 (sbci,r29,hi8(-63))       CR_TAB
1059
+			                  AS2 (st,Y,%B1)				 CR_TAB
1060
+			                  AS2 (st,-Y,%A1)				 CR_TAB
1061
+							  AS2 (subi,r28,lo8(62))       CR_TAB
1062
+							  AS2 (sbci,r29,hi8(62))       CR_TAB
1063
+			                  AS2 (subi,r28,lo8(%o0-62))    CR_TAB
1064
+			                  AS2 (sbci,r29,hi8(%o0-62)))
1065
+				               : (AS2 (adiw,r28,%o0-62) CR_TAB
1066
 			    AS2 (std,Y+63,%B1)    CR_TAB
1067
 			    AS2 (std,Y+62,%A1)    CR_TAB
1068
 			    AS2 (sbiw,r28,%o0-62));
1069
 
1070
-	  return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1071
+	      return *l = 6, AVR_TINY ? (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1072
+			                AS2 (sbci,r29,hi8(-%o0)) CR_TAB
1073
+							AS2 (subi,r28,lo8(-1))   CR_TAB
1074
+							AS2 (sbci,r29,hi8(-1))   CR_TAB
1075
+			                AS2 (st,Y,%B1)           CR_TAB
1076
+			                AS2 (st,-Y,%A1)           CR_TAB
1077
+			                AS2 (subi,r28,lo8(%o0))  CR_TAB
1078
+			                AS2 (sbci,r29,hi8(%o0)))
1079
+				             : (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1080
 			  AS2 (sbci,r29,hi8(-%o0)) CR_TAB
1081
 			  AS2 (std,Y+1,%B1)        CR_TAB
1082
 			  AS2 (st,Y,%A1)           CR_TAB
1083
@@ -2867,12 +3465,30 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1084
 	  else
1085
 	    {
1086
  	      if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
1087
- 	        return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
1088
+	        return *l = 4, AVR_TINY ? (AS2 (subi,r28,lo8(-(%o0-62))) CR_TAB
1089
+					          AS2 (sbci,r29,hi8(-(%o0-62))) CR_TAB
1090
+							  AS2 (subi,r28,lo8(-62))       CR_TAB
1091
+							  AS2 (sbci,r29,hi8(-62))       CR_TAB
1092
+			                  AS2 (st,Y+,%A1)				 CR_TAB
1093
+			                  AS2 (st,Y,%B1)				 CR_TAB
1094
+							  AS2 (subi,r28,lo8(63))       CR_TAB
1095
+							  AS2 (sbci,r29,hi8(63))       CR_TAB
1096
+			                  AS2 (subi,r28,lo8(%o0-62))    CR_TAB
1097
+			                  AS2 (sbci,r29,hi8(%o0-62)))
1098
+				               : (AS2 (adiw,r28,%o0-62) CR_TAB
1099
 			        AS2 (std,Y+62,%A1)    CR_TAB
1100
  			        AS2 (std,Y+63,%B1)    CR_TAB
1101
  			        AS2 (sbiw,r28,%o0-62));
1102
  
1103
- 	      return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1104
+	      return *l = 6, AVR_TINY ? (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1105
+			                AS2 (sbci,r29,hi8(-%o0)) CR_TAB
1106
+			                AS2 (st,Y+,%A1)           CR_TAB
1107
+			                AS2 (st,Y,%B1)           CR_TAB
1108
+							AS2 (subi,r28,lo8(1))   CR_TAB
1109
+							AS2 (sbci,r29,hi8(1))   CR_TAB
1110
+			                AS2 (subi,r28,lo8(%o0))  CR_TAB
1111
+			                AS2 (sbci,r29,hi8(%o0)))
1112
+				             : (AS2 (subi,r28,lo8(-%o0)) CR_TAB
1113
  			      AS2 (sbci,r29,hi8(-%o0)) CR_TAB
1114
 			      AS2 (st,Y,%A1)           CR_TAB
1115
  			      AS2 (std,Y+1,%B1)        CR_TAB
1116
@@ -2888,7 +3504,16 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1117
 	      if (!AVR_XMEGA)
1118
 	        {
1119
 	      *l = 7;
1120
-	      return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1121
+	          return AVR_TINY ? (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1122
+		                AS2 (mov,__zero_reg__,r27) CR_TAB
1123
+                        AS2 (subi,r26,lo8(-(%o0+1)))   CR_TAB
1124
+                        AS2 (sbci,r27,hi8(-(%o0+1)))   CR_TAB
1125
+		                AS2 (st,X,__zero_reg__)    CR_TAB
1126
+		                AS2 (st,-X,__tmp_reg__)    CR_TAB
1127
+		                AS1 (clr,__zero_reg__)     CR_TAB
1128
+                        AS2 (subi,r26,lo8(%o0))    CR_TAB
1129
+                        AS2 (sbci,r27,hi8(%o0))) 
1130
+				         : (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1131
 		      AS2 (mov,__zero_reg__,r27) CR_TAB
1132
                       AS2 (adiw,r26,%o0+1)       CR_TAB
1133
 		      AS2 (st,X,__zero_reg__)    CR_TAB
1134
@@ -2899,19 +3524,35 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1135
 	      else
1136
 	        {
1137
  	          *l = 7;
1138
- 	          return (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1139
+			  return AVR_TINY ? (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1140
  		          AS2 (mov,__zero_reg__,r27) CR_TAB
1141
-		          AS2 (adiw,r26,%o0)         CR_TAB
1142
+				        AS2 (subi,r26,lo8(-(%o0)))   CR_TAB
1143
+				        AS2 (sbci,r27,hi8(-(%o0)))   CR_TAB
1144
 		          AS2 (st,X+,__tmp_reg__)    CR_TAB
1145
  		          AS2 (st,X,__zero_reg__)    CR_TAB
1146
  		          AS1 (clr,__zero_reg__)     CR_TAB
1147
-		          AS2 (sbiw,r26,%o0+1));
1148
+				        AS2 (subi,r26,lo8(%o0+1))    CR_TAB
1149
+				        AS2 (sbci,r27,hi8(%o0+1)))
1150
+				         : (AS2 (mov,__tmp_reg__,r26)  CR_TAB
1151
+						AS2 (mov,__zero_reg__,r27) CR_TAB
1152
+						AS2 (adiw,r26,%o0+1)       CR_TAB
1153
+						AS2 (st,X+,__tmp_reg__)    CR_TAB
1154
+						AS2 (st,X,__zero_reg__)    CR_TAB
1155
+						AS1 (clr,__zero_reg__)     CR_TAB
1156
+						AS2 (sbiw,r26,%o0));
1157
+
1158
 	        }
1159
 	    }
1160
 	  if (!AVR_XMEGA)
1161
             {	    
1162
 	  *l = 4;
1163
-          return (AS2 (adiw,r26,%o0+1) CR_TAB
1164
+              return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o0+1)))   CR_TAB
1165
+                        AS2 (sbci,r27,hi8(-(%o0+1)))   CR_TAB
1166
+                        AS2 (st,X,%B1)       CR_TAB
1167
+                        AS2 (st,-X,%A1)      CR_TAB
1168
+                        AS2 (subi,r26,lo8(%o0))    CR_TAB
1169
+                        AS2 (sbci,r27,hi8(%o0))) 
1170
+				         : (AS2 (adiw,r26,%o0+1) CR_TAB
1171
                   AS2 (st,X,%B1)       CR_TAB
1172
                   AS2 (st,-X,%A1)      CR_TAB
1173
                   AS2 (sbiw,r26,%o0));
1174
@@ -2919,7 +3560,13 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1175
 	  else
1176
 	    {
1177
  	      *l = 4;
1178
-	      return (AS2 (adiw,r26,%o0) CR_TAB
1179
+              return AVR_TINY ? (AS2 (subi,r26,lo8(-(%o0)))   CR_TAB
1180
+                        AS2 (sbci,r27,hi8(-(%o0)))   CR_TAB
1181
+                        AS2 (st,X+,%A1)       CR_TAB
1182
+                        AS2 (st,X,%B1)      CR_TAB
1183
+                        AS2 (subi,r26,lo8(%o0))    CR_TAB
1184
+                        AS2 (sbci,r27,hi8(%o0))) 
1185
+				         : (AS2 (adiw,r26,%o0) CR_TAB
1186
 		      AS2 (st,X+,%A1)    CR_TAB
1187
 		      AS2 (st,X,%B1)     CR_TAB
1188
 		      AS2 (sbiw,r26,%o0+1));
1189
@@ -2927,11 +3574,49 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1190
 	}
1191
 	
1192
       if (!AVR_XMEGA)
1193
-      return *l=2, (AS2 (std,%B0,%B1)    CR_TAB
1194
+	  {
1195
+		op[2] = XEXP(base, 0);
1196
+		if(REGNO(op[2]) == REG_Y)
1197
+        return *l=2, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0+2)))    CR_TAB
1198
+						AS2 (sbci,%B2,hi8(-(%o0+2)))    CR_TAB
1199
+						AS2 (st,-Y,%B1)                  CR_TAB
1200
+                        AS2 (st,-Y,%A1)                  CR_TAB
1201
+                        AS2 (subi,%A2,lo8(%o0))    CR_TAB
1202
+						AS2 (sbci,%B2,hi8(%o0)))   
1203
+			             : (AS2 (std,%B0,%B1)    CR_TAB
1204
                     AS2 (std,%A0,%A1));
1205
+		if(REGNO(op[2]) == REG_Z)
1206
+        return *l=2, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0+1)))    CR_TAB
1207
+						AS2 (sbci,%B2,hi8(-(%o0+1)))    CR_TAB
1208
+						AS2 (st,-Z,%B1)                  CR_TAB
1209
+                        AS2 (st,-Z,%A1)                  CR_TAB
1210
+                        AS2 (subi,%A2,lo8(%o0))    CR_TAB
1211
+						AS2 (sbci,%B2,hi8(%o0)))   
1212
+			             : (AS2 (std,%B0,%B1)    CR_TAB
1213
+                        AS2 (std,%A0,%A1));
1214
+	  }
1215
       else
1216
-        return *l=2, (AS2 (std,%A0,%A1)    CR_TAB
1217
+	  {
1218
+		op[2] = XEXP(base, 0);
1219
+		if(REGNO(op[2]) == REG_Y)
1220
+        return *l=2, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0)))    CR_TAB
1221
+						AS2 (sbci,%B2,hi8(-(%o0)))    CR_TAB
1222
+                        AS2 (st,Y+,%A1)                CR_TAB
1223
+						AS2 (st,Y,%B1)                 CR_TAB                 
1224
+				        AS2 (subi,%A2,lo8(%o0+1))    CR_TAB
1225
+						AS2 (sbci,%B2,hi8(%o0+1)))
1226
+                         : (AS2 (std,%A0,%A1)    CR_TAB
1227
 	              AS2 (std,%B0,%B1));
1228
+		if(REGNO(op[2]) == REG_Z)
1229
+        return *l=2, AVR_TINY ? (AS2 (subi,%A2,lo8(-(%o0)))    CR_TAB
1230
+						AS2 (sbci,%B2,hi8(-(%o0)))    CR_TAB
1231
+                        AS2 (st,Z+,%A1)                CR_TAB
1232
+						AS2 (st,Z,%B1)                CR_TAB 
1233
+				        AS2 (subi,%A2,lo8(%o0+1))    CR_TAB
1234
+						AS2 (sbci,%B2,hi8(%o0+1))) 
1235
+                         : (AS2 (std,%A0,%A1)    CR_TAB
1236
+	                    AS2 (std,%B0,%B1));
1237
+	  }
1238
     }
1239
   else if (GET_CODE (base) == PRE_DEC) /* (--R) */
1240
     {
1241
@@ -2951,15 +3636,30 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
1242
           if (REGNO (XEXP (base, 0)) == REG_X)
1243
             {
1244
               *l = 4;
1245
-              return (AS2 (adiw,r26,1)  CR_TAB
1246
+              return AVR_TINY ? (AS2 (subi,r26,lo8(-1))  CR_TAB
1247
+					    AS2 (sbci,r27,hi8(-1))  CR_TAB
1248
+                        AS2 (st,X,%B1)    CR_TAB
1249
+                        AS2 (st,-X,%A1)   CR_TAB
1250
+						AS2 (subi,r26,lo8(-2)) CR_TAB
1251
+						AS2 (sbci,r27,hi8(-2)))
1252
+				         : (AS2 (adiw,r26,1)  CR_TAB
1253
                       AS2 (st,X,%B1)    CR_TAB
1254
                       AS2 (st,-X,%A1)   CR_TAB
1255
                       AS2 (adiw,r26,2));
1256
             }
1257
           else
1258
             {
1259
+			  //FIXME:check the code once again for AVR_TINY
1260
               *l = 3;
1261
-              return (AS2 (std,%p0+1,%B1) CR_TAB
1262
+              return AVR_TINY ? (AS2 (subi,%A0,lo8(-1)) CR_TAB
1263
+						AS2 (sbci,%B0,hi8(-1)) CR_TAB
1264
+						AS2 (st,%p0,%B1)       CR_TAB
1265
+                        AS2 (subi,%A0,lo8(1)) CR_TAB
1266
+						AS2 (sbci,%B0,hi8(1)) CR_TAB
1267
+                        AS2 (st,%p0,%A1)       CR_TAB
1268
+                        AS2 (subi,%A0,lo8(-3)) CR_TAB 
1269
+					    AS2 (sbci,%B0,hi8(-3)))
1270
+				         : (AS2 (std,%p0+1,%B1) CR_TAB
1271
                       AS2 (st,%p0,%A1)    CR_TAB
1272
                       AS2 (adiw,%r0,2));
1273
             }
1274
@@ -3049,7 +3749,9 @@ out_tsthi (rtx insn, rtx op, int *l)
1275
   if (test_hard_reg_class (ADDW_REGS, op))
1276
     {
1277
       if (l) *l = 1;
1278
-      return AS2 (sbiw,%0,0);
1279
+      return AVR_TINY ? (AS2 (subi,%A0,lo8(0)) CR_TAB
1280
+				AS2 (sbci,%B0,hi8(0)))
1281
+		         :  AS2 (sbiw,%0,0);
1282
     }
1283
   if (l) *l = 2;
1284
   return (AS2 (cp,%A0,__zero_reg__) CR_TAB
1285
@@ -3070,7 +3772,11 @@ out_tstsi (rtx insn, rtx op, int *l)
1286
   if (test_hard_reg_class (ADDW_REGS, op))
1287
     {
1288
       if (l) *l = 3;
1289
-      return (AS2 (sbiw,%A0,0) CR_TAB
1290
+      return AVR_TINY ? (AS2 (subi,%A0,lo8(-(-0))) CR_TAB
1291
+				AS2 (sbci,%B0,hi8(-(-0))) CR_TAB
1292
+                AS2 (cpc,%C0,__zero_reg__) CR_TAB
1293
+                AS2 (cpc,%D0,__zero_reg__))
1294
+		         : (AS2 (sbiw,%A0,0) CR_TAB
1295
               AS2 (cpc,%C0,__zero_reg__) CR_TAB
1296
               AS2 (cpc,%D0,__zero_reg__));
1297
     }
1298
@@ -5392,10 +6098,12 @@ avr_file_start (void)
1299
 /*  fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);*/
1300
   fputs ("__SREG__ = 0x3f\n"
1301
 	 "__SP_H__ = 0x3e\n"
1302
-	 "__SP_L__ = 0x3d\n"
1303
-	 "__CCP__  = 0x34\n", asm_out_file);
1304
+	 "__SP_L__ = 0x3d\n", asm_out_file);
1305
+
1306
+  AVR_TINY ? fputs ("__CCP__ = 0x3c\n", asm_out_file) : fputs ("__CCP__ = 0x34\n", asm_out_file);
1307
   
1308
-  fputs ("__tmp_reg__ = 0\n" 
1309
+  AVR_TINY ? fputs ("__tmp_reg__ = 16\n" 
1310
+		            "__zero_reg__ = 17\n", asm_out_file) : fputs ("__tmp_reg__ = 0\n" 
1311
          "__zero_reg__ = 1\n", asm_out_file);
1312
 
1313
   /* FIXME: output these only if there is anything in the .data / .bss
1314
diff -Naurp gcc/config/avr/avr-c.c gcc/config/avr/avr-c.c
1315
--- gcc/config/avr/avr-c.c	2011-01-19 13:03:59.000000000 -0600
1316
+++ gcc/config/avr/avr-c.c	2011-01-19 13:11:23.000000000 -0600
1317
@@ -94,5 +94,9 @@ avr_cpu_cpp_builtins (struct cpp_reader 
1318
       cpp_define (pfile, "__AVR_HAVE_RAMPD__");
1319
     }
1320
 
1321
+  if (avr_current_arch->avrtiny)
1322
+ 	{
1323
+      cpp_define (pfile, "__AVR_TINY__");
1324
+ 	}
1325
 }
1326
 
1327
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
1328
--- gcc/config/avr/avr-devices.c	2011-01-19 13:03:59.000000000 -0600
1329
+++ gcc/config/avr/avr-devices.c	2011-01-19 13:11:23.000000000 -0600
1330
@@ -26,24 +26,25 @@
1331
 /* List of all known AVR MCU architectyres.  */
1332
 
1333
 const struct base_arch_s avr_arch_types[] = {
1334
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, NULL,               "avr2" },  /* unknown device specified */
1335
-  { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=1",   "avr1" },
1336
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=2",   "avr2" },
1337
-  { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=25",  "avr25" },
1338
-  { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=3",   "avr3" },
1339
-  { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=31",  "avr31" },
1340
-  { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=35",  "avr35" },
1341
-  { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=4",   "avr4" },
1342
-  { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=5",   "avr5" },
1343
-  { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, "__AVR_ARCH__=51",  "avr51" },
1344
-  { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, "__AVR_ARCH__=6",   "avr6" },
1345
-  { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0x2000, "__AVR_ARCH__=101", "avrxmega1" },
1346
-  { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, "__AVR_ARCH__=102", "avrxmega2" },
1347
-  { 0, 1, 1, 1, 0, 0, 0, 1, 1, 0x2000, "__AVR_ARCH__=103", "avrxmega3" },
1348
-  { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0x2000, "__AVR_ARCH__=104", "avrxmega4" },
1349
-  { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0x2000, "__AVR_ARCH__=105", "avrxmega5" },
1350
-  { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, "__AVR_ARCH__=106", "avrxmega6" },  
1351
-  { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, "__AVR_ARCH__=107", "avrxmega7" }
1352
+  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, NULL,               "avr2" },  /* unknown device specified */
1353
+  { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=1",   "avr1" },
1354
+  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=2",   "avr2" },
1355
+  { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=25",  "avr25" },
1356
+  { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=3",   "avr3" },
1357
+  { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=31",  "avr31" },
1358
+  { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=35",  "avr35" },
1359
+  { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=4",   "avr4" },
1360
+  { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=5",   "avr5" },
1361
+  { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=51",  "avr51" },
1362
+  { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, "__AVR_ARCH__=6",   "avr6" },
1363
+  { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=101", "avrxmega1" },
1364
+  { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=102", "avrxmega2" },
1365
+  { 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0x2000, "__AVR_ARCH__=103", "avrxmega3" },
1366
+  { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=104", "avrxmega4" },
1367
+  { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, "__AVR_ARCH__=105", "avrxmega5" },
1368
+  { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, "__AVR_ARCH__=106", "avrxmega6" },  
1369
+  { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, "__AVR_ARCH__=107", "avrxmega7" },
1370
+  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, "__AVR_ARCH__=201", "avrtiny10" }
1371
 };
1372
 
1373
 /* List of all known AVR MCU types - if updated, it has to be kept
1374
@@ -229,6 +230,14 @@ const struct mcu_type_s avr_mcu_types[] 
1375
   { "avrxmega7",    ARCH_AVRXMEGA7, NULL,                           0, 0x2000, "x128a1" },
1376
   { "atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__",         0, 0x2000, "x128a1" },
1377
   { "atxmega128a1u", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1U__",       0, 0x2000, "x128a1u" },
1378
+ 	/* tiny10 family */
1379
+  { "avrtiny10",   ARCH_AVRTINY10, NULL,                            0, 0x0040, "tn10" },
1380
+  { "attiny4",     ARCH_AVRTINY10, "__AVR_ATtiny4__",               0, 0x0040, "tn4" },
1381
+  { "attiny5",     ARCH_AVRTINY10, "__AVR_ATtiny5__",               0, 0x0040, "tn5" },
1382
+  { "attiny9",     ARCH_AVRTINY10, "__AVR_ATtiny9__",               0, 0x0040, "tn9" },
1383
+  { "attiny10",    ARCH_AVRTINY10, "__AVR_ATtiny10__",              0, 0x0040, "tn10" },
1384
+  { "attiny20",    ARCH_AVRTINY10, "__AVR_ATtiny20__",              0, 0x0040, "tn20" },
1385
+  { "attiny40",    ARCH_AVRTINY10, "__AVR_ATtiny40__",              0, 0x0040, "tn40" },
1386
     /* Assembler only.  */
1387
   { "avr1",                 ARCH_AVR1, NULL,                        0, 0x0060, "s1200" },
1388
   { "at90s1200",            ARCH_AVR1, "__AVR_AT90S1200__",         0, 0x0060, "s1200" },
1389
diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
1390
--- gcc/config/avr/avr.h	2011-01-19 13:03:59.000000000 -0600
1391
+++ gcc/config/avr/avr.h	2011-01-19 13:11:23.000000000 -0600
1392
@@ -51,6 +51,9 @@ struct base_arch_s {
1393
   /* Core have RAMPX, RAMPY and RAMPD registers.  */
1394
   int have_rampx_y_d;
1395
   
1396
+  /* Core is in avrtiny10 family.  */
1397
+  int avrtiny;
1398
+
1399
   /* Default start of data section address for architecture.  */
1400
   int default_data_section_start;
1401
 
1402
@@ -82,7 +85,8 @@ enum avr_arch
1403
   ARCH_AVRXMEGA4,
1404
   ARCH_AVRXMEGA5,
1405
   ARCH_AVRXMEGA6,
1406
-  ARCH_AVRXMEGA7
1407
+  ARCH_AVRXMEGA7,
1408
+  ARCH_AVRTINY10
1409
 };
1410
 
1411
 struct mcu_type_s {
1412
@@ -126,6 +130,7 @@ extern GTY(()) section *progmem_section;
1413
 #define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)
1414
 #define AVR_HAVE_8BIT_SP (avr_current_device->short_sp || TARGET_TINY_STACK)
1415
 #define AVR_XMEGA (avr_current_arch->xmega)
1416
+#define AVR_TINY  (avr_current_arch->avrtiny)
1417
 #define AVR_HAVE_RAMPX_Y_D (avr_current_arch->have_rampx_y_d)
1418
 
1419
 #define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
1420
@@ -249,7 +254,6 @@ extern GTY(()) section *progmem_section;
1421
 
1422
 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
1423
 
1424
-
1425
 #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
1426
 
1427
 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
1428
@@ -313,6 +317,41 @@ enum reg_class {
1429
   {0xffffffff,0x00000003}	/* ALL_REGS */				\
1430
 }
1431
 
1432
+/* Zero or more C statements that may conditionally modify five variables
1433
+   fixed_regs, call_used_regs, global_regs, reg_names, and reg_class_contents,
1434
+   to take into account any dependence of these register sets on target flags.
1435
+   The first three of these are of type char [] (interpreted as Boolean
1436
+   vectors). global_regs is a const char *[], and reg_class_contents is a
1437
+   HARD_REG_SET. Before the macro is called, fixed_regs, call_used_regs,
1438
+   reg_class_contents, and reg_names have been initialized from
1439
+   FIXED_REGISTERS, CALL_USED_REGISTERS, REG_CLASS_CONTENTS, and
1440
+   REGISTER_NAMES, respectively. global_regs has been cleared, and any
1441
+   ‘-ffixed-reg’, ‘-fcall-used-reg’ and ‘-fcall-saved-reg’ command options
1442
+   have been applied.
1443
+
1444
+   You need not define this macro if it has no work to do.
1445
+
1446
+   If the usage of an entire class of registers depends on the target flags,
1447
+   you may indicate this to GCC by using this macro to modify fixed_regs and
1448
+   call_used_regs to 1 for each of the registers in the classes which should
1449
+   not be used by GCC. Also define the macro REG_CLASS_FROM_LETTER /
1450
+   REG_CLASS_FROM_CONSTRAINT to return NO_REGS if it is called with a letter
1451
+   for a class that shouldnÂ’t be used.  (However, if this class is not included
1452
+   in GENERAL_REGS and all of the insn patterns whose constraints permit this
1453
+   class are controlled by target switches, then GCC will automatically avoid
1454
+   using these registers when the target switches are opposed to them.) */
1455
+
1456
+#define CONDITIONAL_REGISTER_USAGE             \
1457
+   if (AVR_TINY) {                             \
1458
+     int i;                                    \
1459
+     for (i = 0;  i <= 17;  i++) {             \
1460
+       fixed_regs[i] = 1;                      \
1461
+       call_used_regs[i] = 1;                  \
1462
+     }                                         \
1463
+	CLEAR_HARD_REG_SET(reg_class_contents[(int)ADDW_REGS]);           \
1464
+	CLEAR_HARD_REG_SET(reg_class_contents[(int)NO_LD_REGS]);           \
1465
+   }
1466
+
1467
 #define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
1468
 
1469
 /* The following macro defines cover classes for Integrated Register
1470
diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
1471
--- gcc/config/avr/avr.md	2011-01-19 13:03:59.000000000 -0600
1472
+++ gcc/config/avr/avr.md	2011-01-19 13:11:23.000000000 -0600
1473
@@ -186,6 +186,9 @@
1474
   DONE;
1475
 })
1476
 
1477
+(define_constants
1478
+ [(TMP_REGNO_AVRTINY10	16)	; temporary register r16
1479
+  (ZERO_REGNO_AVRTINY10	17)])	; zero register r17
1480
 
1481
 (define_insn "*push<ALLQ:mode>"
1482
   [(set (mem:ALLQ (post_dec (reg:HI REG_SP)))
1483
@@ -479,7 +482,7 @@
1484
   rtx addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
1485
 
1486
   /* Create rtx for tmp register - we use this as scratch.  */
1487
-  rtx tmp_reg_rtx  = gen_rtx_REG (QImode, TMP_REGNO);
1488
+  rtx tmp_reg_rtx  = gen_rtx_REG (QImode, AVR_TINY ? TMP_REGNO_AVRTINY10 : TMP_REGNO);
1489
 
1490
   if (GET_CODE (operands[2]) != CONST_INT)
1491
     FAIL;
1492
@@ -2900,7 +2903,7 @@
1493
 			UNSPEC_INDEX_JMP))
1494
    (use (label_ref (match_operand 1 "" "")))
1495
    (clobber (match_dup 0))]
1496
-  "AVR_HAVE_JMP_CALL && !AVR_HAVE_EIJMP_EICALL"
1497
+  "(AVR_HAVE_JMP_CALL && !AVR_HAVE_EIJMP_EICALL)"
1498
   "lsl r30
1499
 	rol r31
1500
 	lpm
1501
diff -Naurp gcc/config/avr/libgcc-fixed.S gcc/config/avr/libgcc-fixed.S
1502
--- gcc/config/avr/libgcc-fixed.S	2011-01-18 17:58:12.000000000 -0600
1503
+++ gcc/config/avr/libgcc-fixed.S	2011-01-19 13:11:23.000000000 -0600
1504
@@ -29,13 +29,17 @@ Boston, MA 02110-1301, USA.  */
1505
 
1506
 /* Fixed point library routines for avr.  */
1507
 
1508
+#if defined (__AVR_TINY__)
1509
+#define __zero_reg__ r17
1510
+#define __tmp_reg__ r16
1511
+#else
1512
 #define __zero_reg__ r1
1513
 #define __tmp_reg__ r0
1514
+#endif
1515
 #define __SREG__ 0x3f
1516
 #define __SP_H__ 0x3e
1517
 #define __SP_L__ 0x3d
1518
 #define __RAMPZ__ 0x3B
1519
-
1520
 /* Conversions to float.  */
1521
 #if defined (L_fractqqsf)
1522
         .global __fractqqsf
1523
@@ -281,15 +285,15 @@ __muluqq3_exit:
1524
 	.func	__mulhq3
1525
 __mulhq3:
1526
         fmuls   r_arg1H, r_arg2H
1527
-        movw    r_resL, r0
1528
+        movw    r_resL, __tmp_reg__
1529
         fmulsu  r_arg2H, r_arg1L
1530
         clr     r_arg1L
1531
         sbc     r_resH, r_arg1L
1532
-        add     r_resL, r1
1533
+        add     r_resL, __zero_reg__
1534
         adc     r_resH, r_arg1L
1535
         fmulsu  r_arg1H, r_arg2L
1536
         sbc     r_resH, r_arg1L
1537
-        add     r_resL, r1
1538
+        add     r_resL, __zero_reg__
1539
         adc     r_resH, r_arg1L
1540
         clr     __zero_reg__
1541
         ret
1542
@@ -301,13 +305,13 @@ __mulhq3:
1543
 	.func	__muluhq3
1544
 __muluhq3:
1545
         mul     r_arg1H, r_arg2H
1546
-        movw    r_resL, r0
1547
+        movw    r_resL, __tmp_reg__
1548
         mul     r_arg1H, r_arg2L
1549
-        add     r_resL, r1
1550
+        add     r_resL, __zero_reg__
1551
         clr     __zero_reg__
1552
         adc     r_resH, __zero_reg__
1553
         mul     r_arg1L, r_arg2H
1554
-        add     r_resL, r1
1555
+        add     r_resL, __zero_reg__
1556
         clr     __zero_reg__
1557
         adc     r_resH, __zero_reg__
1558
         ret
1559
@@ -401,15 +405,15 @@ __muluhq3_skip:	
1560
 	.func	__mulha3
1561
 __mulha3:
1562
         mul     r_arg1L, r_arg2L
1563
-        mov     r_resL, r1
1564
+        mov     r_resL, __zero_reg__
1565
         muls    r_arg1H, r_arg2H
1566
-        mov     r_resH, r0
1567
+        mov     r_resH, __tmp_reg__
1568
         mulsu   r_arg1H, r_arg2L
1569
-        add     r_resL, r0
1570
-        adc     r_resH, r1
1571
+        add     r_resL, __tmp_reg__
1572
+        adc     r_resH, __zero_reg__
1573
         mulsu   r_arg2H, r_arg1L
1574
-        add     r_resL, r0
1575
-        adc     r_resH, r1
1576
+        add     r_resL, __tmp_reg__
1577
+        adc     r_resH, __zero_reg__
1578
         clr     __zero_reg__
1579
         ret
1580
 .endfunc
1581
@@ -420,15 +424,15 @@ __mulha3:
1582
 	.func	__muluha3
1583
 __muluha3:
1584
         mul     r_arg1L, r_arg2L
1585
-        mov     r_resL, r1
1586
+        mov     r_resL, __zero_reg__
1587
         mul     r_arg1H, r_arg2H
1588
-        mov     r_resH, r0
1589
+        mov     r_resH, __tmp_reg__
1590
         mul     r_arg1H, r_arg2L
1591
-        add     r_resL, r0
1592
-        adc     r_resH, r1
1593
+        add     r_resL, __tmp_reg__
1594
+        adc     r_resH, __zero_reg__
1595
         mul     r_arg1L, r_arg2H
1596
-        add     r_resL, r0
1597
-        adc     r_resH, r1
1598
+        add     r_resL, __tmp_reg__
1599
+        adc     r_resH, __zero_reg__
1600
         clr     __zero_reg__
1601
         ret
1602
 .endfunc
1603
@@ -442,8 +446,8 @@ __muluha3:
1604
 #define	r_arg2H	r23		/* multiplicand High */
1605
 #define r_resL	r18     	/* result Low */
1606
 #define r_resH  r19	        /* result High */
1607
-#define r_scratchL  r0     	/* scratch Low */
1608
-#define r_scratchH  r1
1609
+#define r_scratchL  __tmp_reg__     	/* scratch Low */
1610
+#define r_scratchH  __zero_reg__
1611
 
1612
 #if defined (L_mulha3)
1613
        	.global	__mulha3
1614
@@ -480,8 +484,8 @@ __mulha3_exit:
1615
 __muluha3:
1616
 	clr	r_resL		; clear result
1617
         clr     r_resH
1618
-        mov_l   r0, r_arg1L     ; save multiplicand
1619
-        mov_h   r1, r_arg1H
1620
+        mov_l   __tmp_reg__, r_arg1L     ; save multiplicand
1621
+        mov_h   __zero_reg__, r_arg1H
1622
 __muluha3_loop1:
1623
         sbrs	r_arg2H,0
1624
 	rjmp	__muluha3_skip1
1625
@@ -490,7 +494,12 @@ __muluha3_loop1:
1626
 __muluha3_skip1:
1627
 	lsl	r_arg1L		; shift multiplicand
1628
 	rol	r_arg1H
1629
+#if defined (__AVR_TINY__)
1630
+        subi    r_arg1L, lo8(0)
1631
+        sbci    r_arg1L, hi8(0)
1632
+#else
1633
         sbiw    r_arg1L,0
1634
+#endif
1635
         breq    __muluha3_loop1_done ; exit multiplicand = 0
1636
         lsr     r_arg2H
1637
         brne    __muluha3_loop1 ; exit multiplier = 0
1638
@@ -500,7 +509,12 @@ __muluha3_loop1_done:
1639
 __muluha3_loop2:
1640
 	lsr	r_arg1H		; shift multiplicand
1641
 	ror	r_arg1L
1642
+#if defined (__AVR_TINY__)
1643
+        subi    r_arg1L, lo8(0)
1644
+        sbci    r_arg1L, hi8(0)
1645
+#else
1646
         sbiw    r_arg1L,0
1647
+#endif
1648
         breq    __muluha3_exit  ; exit if multiplicand = 0
1649
         sbrs    r_arg2L,7
1650
         rjmp    __muluha3_skip2
1651
@@ -556,53 +570,53 @@ __mulsa3:
1652
         clr     r_resHL
1653
         clr     r_resHH        
1654
         mul     r_arg1H, r_arg2L
1655
-        mov     r_resL, r1
1656
+        mov     r_resL, __zero_reg__
1657
         mul     r_arg1L, r_arg2H
1658
-        add     r_resL, r1
1659
+        add     r_resL, __zero_reg__
1660
         adc     r_resH, r_clr
1661
         mul     r_arg1L, r_arg2HL
1662
-        add     r_resL, r0
1663
-        adc     r_resH, r1
1664
+        add     r_resL, __tmp_reg__
1665
+        adc     r_resH, __zero_reg__
1666
         adc     r_resHL, r_clr
1667
         mul     r_arg1H, r_arg2H
1668
-        add     r_resL, r0
1669
-        adc     r_resH, r1
1670
+        add     r_resL, __tmp_reg__
1671
+        adc     r_resH, __zero_reg__
1672
         adc     r_resHL, r_clr
1673
         mul     r_arg1HL, r_arg2L
1674
-        add     r_resL, r0
1675
-        adc     r_resH, r1
1676
+        add     r_resL, __tmp_reg__
1677
+        adc     r_resH, __zero_reg__
1678
         adc     r_resHL, r_clr
1679
         mulsu   r_arg2HH, r_arg1L
1680
         sbc     r_resHH, r_clr
1681
-        add     r_resH, r0
1682
-        adc     r_resHL, r1
1683
+        add     r_resH, __tmp_reg__
1684
+        adc     r_resHL, __zero_reg__
1685
         adc     r_resHH, r_clr
1686
         mul     r_arg1H, r_arg2HL
1687
-        add     r_resH, r0
1688
-        adc     r_resHL, r1
1689
+        add     r_resH, __tmp_reg__
1690
+        adc     r_resHL, __zero_reg__
1691
         adc     r_resHH, r_clr
1692
         mul     r_arg1HL, r_arg2H
1693
-        add     r_resH, r0
1694
-        adc     r_resHL, r1
1695
+        add     r_resH, __tmp_reg__
1696
+        adc     r_resHL, __zero_reg__
1697
         adc     r_resHH, r_clr
1698
         mulsu   r_arg1HH, r_arg2L
1699
         sbc     r_resHH, r_clr        
1700
-        add     r_resH, r0
1701
-        adc     r_resHL, r1
1702
+        add     r_resH, __tmp_reg__
1703
+        adc     r_resHL, __zero_reg__
1704
         adc     r_resHH, r_clr
1705
         mulsu   r_arg2HH, r_arg1H
1706
-        add     r_resHL, r0
1707
-        adc     r_resHH, r1
1708
+        add     r_resHL, __tmp_reg__
1709
+        adc     r_resHH, __zero_reg__
1710
         mul     r_arg1HL, r_arg2HL
1711
-        add     r_resHL, r0
1712
-        adc     r_resHH, r1
1713
+        add     r_resHL, __tmp_reg__
1714
+        adc     r_resHH, __zero_reg__
1715
         mulsu   r_arg1HH, r_arg2H
1716
-        add     r_resHL, r0
1717
-        adc     r_resHH, r1
1718
+        add     r_resHL, __tmp_reg__
1719
+        adc     r_resHH, __zero_reg__
1720
         mulsu   r_arg2HH, r_arg1HL
1721
-        add     r_resHH, r0
1722
+        add     r_resHH, __tmp_reg__
1723
         mulsu   r_arg1HH, r_arg2HL
1724
-        add     r_resHH, r0
1725
+        add     r_resHH, __tmp_reg__
1726
         clr     __zero_reg__
1727
         ret
1728
 .endfunc
1729
@@ -617,51 +631,51 @@ __mulusa3:
1730
         clr     r_resHL
1731
         clr     r_resHH        
1732
         mul     r_arg1H, r_arg2L
1733
-        mov     r_resL, r1
1734
+        mov     r_resL, __zero_reg__
1735
         mul     r_arg1L, r_arg2H
1736
-        add     r_resL, r1
1737
+        add     r_resL, __zero_reg__
1738
         adc     r_resH, r_clr
1739
         mul     r_arg1L, r_arg2HL
1740
-        add     r_resL, r0
1741
-        adc     r_resH, r1
1742
+        add     r_resL, __tmp_reg__
1743
+        adc     r_resH, __zero_reg__
1744
         adc     r_resHL, r_clr
1745
         mul     r_arg1H, r_arg2H
1746
-        add     r_resL, r0
1747
-        adc     r_resH, r1
1748
+        add     r_resL, __tmp_reg__
1749
+        adc     r_resH, __zero_reg__
1750
         adc     r_resHL, r_clr
1751
         mul     r_arg1HL, r_arg2L
1752
-        add     r_resL, r0
1753
-        adc     r_resH, r1
1754
+        add     r_resL, __tmp_reg__
1755
+        adc     r_resH, __zero_reg__
1756
         adc     r_resHL, r_clr
1757
         mul     r_arg1L, r_arg2HH
1758
-        add     r_resH, r0
1759
-        adc     r_resHL, r1
1760
+        add     r_resH, __tmp_reg__
1761
+        adc     r_resHL, __zero_reg__
1762
         adc     r_resHH, r_clr
1763
         mul     r_arg1H, r_arg2HL
1764
-        add     r_resH, r0
1765
-        adc     r_resHL, r1
1766
+        add     r_resH, __tmp_reg__
1767
+        adc     r_resHL, __zero_reg__
1768
         adc     r_resHH, r_clr
1769
         mul     r_arg1HL, r_arg2H
1770
-        add     r_resH, r0
1771
-        adc     r_resHL, r1
1772
+        add     r_resH, __tmp_reg__
1773
+        adc     r_resHL, __zero_reg__
1774
         adc     r_resHH, r_clr
1775
         mul     r_arg1HH, r_arg2L
1776
-        add     r_resH, r0
1777
-        adc     r_resHL, r1
1778
+        add     r_resH, __tmp_reg__
1779
+        adc     r_resHL, __zero_reg__
1780
         adc     r_resHH, r_clr
1781
         mul     r_arg1H, r_arg2HH
1782
-        add     r_resHL, r0
1783
-        adc     r_resHH, r1
1784
+        add     r_resHL, __tmp_reg__
1785
+        adc     r_resHH, __zero_reg__
1786
         mul     r_arg1HL, r_arg2HL
1787
-        add     r_resHL, r0
1788
-        adc     r_resHH, r1
1789
+        add     r_resHL, __tmp_reg__
1790
+        adc     r_resHH, __zero_reg__
1791
         mul     r_arg1HH, r_arg2H
1792
-        add     r_resHL, r0
1793
-        adc     r_resHH, r1
1794
+        add     r_resHL, __tmp_reg__
1795
+        adc     r_resHH, __zero_reg__
1796
         mul     r_arg1HL, r_arg2HH
1797
-        add     r_resHH, r0
1798
+        add     r_resHH, __tmp_reg__
1799
         mul     r_arg1HH, r_arg2HL
1800
-        add     r_resHH, r0
1801
+        add     r_resHH, __tmp_reg__
1802
         clr     __zero_reg__
1803
         ret
1804
 .endfunc
1805
@@ -680,13 +694,20 @@ __mulusa3:
1806
 #define	r_arg2HL r26
1807
 #define	r_arg2HH r27		/* multiplicand High */
1808
 
1809
+#if defined (__AVR_TINY__)
1810
+#define r_resL	 r28    	/* result Low */
1811
+#define r_resH   r29
1812
+#define r_resHL	 r30
1813
+#define r_resHH  r31	        /* result High */
1814
+#else
1815
 #define r_resL	 r14     	/* result Low */
1816
 #define r_resH   r15
1817
 #define r_resHL	 r16
1818
 #define r_resHH  r17	        /* result High */
1819
+#endif
1820
 
1821
-#define r_scratchL  r0     	/* scratch Low */
1822
-#define r_scratchH  r1
1823
+#define r_scratchL  __tmp_reg__     	/* scratch Low */
1824
+#define r_scratchH  __zero_reg__
1825
 #define r_scratchHL r22
1826
 #define r_scratchHH r23	        /* scratch High */
1827
 
1828
@@ -758,7 +779,12 @@ __mulusa3_skip1:
1829
 	rol	r_arg1HH
1830
         lsr     r_arg2HH
1831
         ror     r_arg2HL
1832
+#if defined (__AVR_TINY__)
1833
+        subi    r_arg2HL, lo8(0)
1834
+        sbci    r_arg2HL, hi8(0)
1835
+#else
1836
         sbiw    r_arg2HL,0
1837
+#endif
1838
         brne    __mulusa3_loop1 ; exit multiplier = 0
1839
 __mulusa3_loop1_done:
1840
         mov_l   r_arg1L, r_scratchL     ; restore multiplicand
1841
@@ -779,7 +805,12 @@ __mulusa3_loop2:
1842
 __mulusa3_skip2:
1843
         lsl     r_arg2L
1844
         rol     r_arg2H
1845
+#if defined (__AVR_TINY__)
1846
+        subi    r_arg2L, lo8(0)
1847
+        sbci    r_arg2L, hi8(0)
1848
+#else
1849
         sbiw    r_arg2L,0
1850
+#endif
1851
         brne    __mulusa3_loop2 ; exit if multiplier = 0
1852
 __mulusa3_exit:
1853
         clr     __zero_reg__    ; got clobbered
1854
@@ -791,9 +822,7 @@ __mulusa3_exit:
1855
 #undef r_scratchH
1856
 #undef r_scratchHL
1857
 #undef r_scratchHH
1858
-        
1859
 #endif
1860
-
1861
 #undef	r_arg1L
1862
 #undef	r_arg1H
1863
 #undef	r_arg1HL
1864
@@ -821,8 +850,8 @@ __mulusa3_exit:
1865
 	.global	__divqq3
1866
 	.func	__divqq3
1867
 __divqq3:
1868
-        mov     r0, r_divd
1869
-        eor     r0, r_div
1870
+        mov     __tmp_reg__, r_divd
1871
+        eor     __tmp_reg__, r_div
1872
         sbrc    r_div, 7
1873
         neg     r_div          
1874
         sbrc    r_divd, 7
1875
@@ -831,7 +860,7 @@ __divqq3:
1876
         breq    __divqq3_minus1  ; if equal return -1
1877
         rcall   __udivuqq3
1878
         lsr     r_quo
1879
-        sbrc    r0, 7   ; negate result if needed
1880
+        sbrc    __tmp_reg__, 7   ; negate result if needed
1881
         neg     r_quo
1882
         ret
1883
 __divqq3_minus1:
1884
@@ -886,8 +915,8 @@ __udivuqq3_cont:
1885
 	.global	__divhq3
1886
 	.func	__divhq3
1887
 __divhq3:
1888
-        mov     r0, r_divdH
1889
-        eor     r0, r_divH
1890
+        mov     __tmp_reg__, r_divdH
1891
+        eor     __tmp_reg__, r_divH
1892
         sbrs    r_divH, 7
1893
         rjmp    __divhq3_divpos
1894
         com     r_divH
1895
@@ -906,7 +935,7 @@ __divhq3_divdpos:
1896
         rcall   __udivuhq3
1897
         lsr     r_quoH
1898
         ror     r_quoL
1899
-        sbrs    r0, 7   ; negate result if needed
1900
+        sbrs    __tmp_reg__, 7   ; negate result if needed
1901
         ret
1902
         com     r_quoH
1903
         neg     r_quoL
1904
@@ -958,8 +987,8 @@ __udivuhq3_cont:
1905
 	.global	__divha3
1906
 	.func	__divha3
1907
 __divha3:
1908
-        mov     r0, r_divdH
1909
-        eor     r0, r_divH
1910
+        mov     __tmp_reg__, r_divdH
1911
+        eor     __tmp_reg__, r_divH
1912
         sbrs    r_divH, 7
1913
         rjmp    __divha3_divpos
1914
         com     r_divH
1915
@@ -973,7 +1002,7 @@ __divha3_divpos:        
1916
         sbci    r_divdH,-1
1917
 __divha3_divdpos:
1918
         rcall   __udivuha3
1919
-        sbrs    r0, 7   ; negate result if needed
1920
+        sbrs    __tmp_reg__, 7   ; negate result if needed
1921
         ret
1922
         com     r_quoH
1923
         neg     r_quoL
1924
@@ -1027,8 +1056,8 @@ __udivuha3:
1925
 	.global	__divsa3
1926
 	.func	__divsa3
1927
 __divsa3:
1928
-        mov     r0, r27
1929
-        eor     r0, r_divHH        
1930
+        mov     __tmp_reg__, r27
1931
+        eor     __tmp_reg__, r_divHH        
1932
         sbrs    r_divHH, 7
1933
         rjmp    __divsa3_divpos
1934
         com     r_divHH
1935
@@ -1050,7 +1079,7 @@ __divsa3_divpos:
1936
         sbci    r_arg1HH,-1        
1937
 __divsa3_arg1pos:
1938
         rcall   __udivusa3        
1939
-        sbrs    r0, 7   ; negate result if needed
1940
+        sbrs    __tmp_reg__, 7   ; negate result if needed
1941
         ret
1942
         com     r_quoHH
1943
         com     r_quoHL
1944
diff -Naurp gcc/config/avr/libgcc.S gcc/config/avr/libgcc.S
1945
--- gcc/config/avr/libgcc.S	2011-01-19 13:03:59.000000000 -0600
1946
+++ gcc/config/avr/libgcc.S	2011-01-19 13:11:23.000000000 -0600
1947
@@ -22,8 +22,13 @@ a copy of the GCC Runtime Library Except
1948
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
1949
 <http://www.gnu.org/licenses/>.  */
1950
 
1951
+#if defined (__AVR_TINY__)
1952
+#define __zero_reg__ r17
1953
+#define __tmp_reg__ r16
1954
+#else
1955
 #define __zero_reg__ r1
1956
 #define __tmp_reg__ r0
1957
+#endif
1958
 #define __SREG__ 0x3f
1959
 #define __SP_H__ 0x3e
1960
 #define __SP_L__ 0x3d
1961
@@ -140,7 +145,12 @@ __mulhi3_skip1:	
1962
 
1963
 	lsr	r_arg1H		; gets LSB of multiplier
1964
 	ror	r_arg1L
1965
+#if defined (__AVR_TINY__)
1966
+    subi    r_arg1L, lo8(0)
1967
+    sbci    r_arg1L, hi8(0)
1968
+#else
1969
 	sbiw	r_arg1L,0
1970
+#endif
1971
 	brne	__mulhi3_loop	; exit if multiplier = 0
1972
 __mulhi3_exit:
1973
 	mov	r_arg1H,r_resH	; result to return register
1974
@@ -304,7 +314,12 @@ __mulsi3_skip1:
1975
 	ror	r_arg1H
1976
 	ror	r_arg1L
1977
 	brne	__mulsi3_loop
1978
+#if defined (__AVR_TINY__)
1979
+    subi    r_arg1HL, lo8(0)
1980
+    sbci    r_arg1HL, hi8(0)
1981
+#else
1982
 	sbiw	r_arg1HL,0
1983
+#endif
1984
 	cpc	r_arg1H,r_arg1L
1985
 	brne	__mulsi3_loop		; exit if multiplier = 0
1986
 __mulsi3_exit:
1987
@@ -610,6 +625,7 @@ __divmodsi4_neg1:
1988
 /**********************************
1989
  * This is a prologue subroutine
1990
  **********************************/
1991
+#if !defined (__AVR_TINY__)
1992
 #if defined (L_prologue)
1993
 
1994
 	.global	__prologue_saves__
1995
@@ -663,7 +679,6 @@ __prologue_saves__:
1996
  * This is an epilogue subroutine
1997
  */
1998
 #if defined (L_epilogue)
1999
-
2000
 	.global	__epilogue_restores__
2001
 	.func	__epilogue_restores__
2002
 __epilogue_restores__:
2003
@@ -704,6 +719,7 @@ __epilogue_restores__:
2004
 	ret
2005
 .endfunc
2006
 #endif /* defined (L_epilogue) */
2007
+#endif /* !defined (__AVR_TINY__) */
2008
 
2009
 #ifdef L_exit
2010
 	.section .fini9,"ax",@progbits
2011
@@ -730,6 +746,7 @@ _cleanup:
2012
 .endfunc
2013
 #endif /* defined (L_cleanup) */
2014
 
2015
+#if !defined(__AVR_TINY__)
2016
 #ifdef L_tablejump
2017
 	.global __tablejump2__
2018
 	.func	__tablejump2__
2019
@@ -762,7 +779,9 @@ __tablejump__:
2020
 #endif
2021
 	.endfunc
2022
 #endif /* defined (L_tablejump) */
2023
+#endif
2024
 
2025
+#if !defined(__AVR_TINY__)
2026
 #ifdef L_copy_data
2027
 	.section .init4,"ax",@progbits
2028
 	.global __do_copy_data
2029
@@ -824,6 +843,7 @@ __do_copy_data:
2030
 	brne	.L__do_copy_data_loop
2031
 #endif /* !defined(__AVR_HAVE_ELPMX__) && !defined(__AVR_HAVE_ELPM__) */
2032
 #endif /* L_copy_data */
2033
+#endif
2034
 
2035
 /* __do_clear_bss is only necessary if there is anything in .bss section.  */
2036
 
2037
@@ -864,7 +884,12 @@ __do_global_ctors:
2038
 	ldi	r20, hh8(__ctors_end)
2039
 	rjmp	.L__do_global_ctors_start
2040
 .L__do_global_ctors_loop:
2041
+#if defined (__AVR_TINY__)
2042
+	subi    r28, lo8(2)
2043
+	sbci    r29, hi8(2)
2044
+#else
2045
 	sbiw	r28, 2
2046
+#endif
2047
 	sbc     r20, __zero_reg__
2048
 	mov_h	r31, r29
2049
 	mov_l	r30, r28
2050
@@ -882,7 +907,12 @@ __do_global_ctors:
2051
 	ldi	r29, hi8(__ctors_end)
2052
 	rjmp	.L__do_global_ctors_start
2053
 .L__do_global_ctors_loop:
2054
+#if defined (__AVR_TINY__)
2055
+    subi    r28, lo8(2)
2056
+    sbci    r29, hi8(2)
2057
+#else
2058
 	sbiw	r28, 2
2059
+#endif
2060
 	mov_h	r31, r29
2061
 	mov_l	r30, r28
2062
 	XCALL	__tablejump__
2063
@@ -905,7 +935,12 @@ __do_global_dtors:
2064
 	ldi	r20, hh8(__dtors_start)
2065
 	rjmp	.L__do_global_dtors_start
2066
 .L__do_global_dtors_loop:
2067
+#if defined (__AVR_TINY__)
2068
+    subi    r28, lo8(2)
2069
+    sbci    r29, hi8(2)
2070
+#else
2071
 	sbiw	r28, 2
2072
+#endif
2073
 	sbc     r20, __zero_reg__
2074
 	mov_h	r31, r29
2075
 	mov_l	r30, r28
2076
@@ -926,7 +961,12 @@ __do_global_dtors:
2077
 	mov_h	r31, r29
2078
 	mov_l	r30, r28
2079
 	XCALL	__tablejump__
2080
+#if defined (__AVR_TINY__)
2081
+	subi    r28, lo8(-2)
2082
+	sbci    r29, hi8(-2)
2083
+#else
2084
 	adiw	r28, 2
2085
+#endif
2086
 .L__do_global_dtors_start:
2087
 	cpi	r28, lo8(__dtors_end)
2088
 	cpc	r29, r17
2089
@@ -934,6 +974,7 @@ __do_global_dtors:
2090
 #endif /* defined(__AVR_HAVE_RAMPZ__) */
2091
 #endif /* L_dtors */
2092
 
2093
+#if !defined (__AVR_TINY__)
2094
 #ifdef L_tablejump_elpm
2095
 	.global __tablejump_elpm__
2096
 	.func	__tablejump_elpm__
2097
@@ -963,5 +1004,6 @@ __tablejump_elpm__:
2098
 #endif /* defined (__AVR_HAVE_ELPM__) */
2099
 	.endfunc
2100
 #endif /* defined (L_tablejump_elpm) */
2101
+#endif /* !defined (__AVR_TINY__) */
2102
 
2103
 #include "libgcc-fixed.S"
2104
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
2105
--- gcc/config/avr/t-avr	2011-01-19 13:03:59.000000000 -0600
2106
+++ gcc/config/avr/t-avr	2011-01-19 13:11:23.000000000 -0600
2107
@@ -107,8 +107,8 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(sr
2108
 
2109
 FPBIT = fp-bit.c
2110
 
2111
-MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7
2112
-MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7
2113
+MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny10
2114
+MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny10
2115
 
2116
 # The many avr2 matches are not listed here - this is the default.
2117
 MULTILIB_MATCHES = \
2118
@@ -242,7 +242,13 @@ MULTILIB_MATCHES = \
2119
 	mmcu?avrxmega6=mmcu?atxmega256a3b \
2120
 	mmcu?avrxmega6=mmcu?atxmega256d3 \
2121
 	mmcu?avrxmega7=mmcu?atxmega128a1 \
2122
-	mmcu?avrxmega7=mmcu?atxmega128a1u
2123
+	mmcu?avrxmega7=mmcu?atxmega128a1u \
2124
+	mmcu?avrtiny10=mmcu?attiny4 \
2125
+	mmcu?avrtiny10=mmcu?attiny5 \
2126
+	mmcu?avrtiny10=mmcu?attiny9 \
2127
+	mmcu?avrtiny10=mmcu?attiny10 \
2128
+	mmcu?avrtiny10=mmcu?attiny20 \
2129
+	mmcu?avrtiny10=mmcu?attiny40 
2130
 
2131
 MULTILIB_EXCEPTIONS =
2132
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-303-gcc-4.5.1-osmain (-52 lines)
Lines 1-52 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-01-19 13:45:00.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-01-19 13:45:47.000000000 -0600
4
@@ -784,7 +784,8 @@ expand_prologue (void)
5
 		}
6
 	      else if ((!AVR_XMEGA && TARGET_NO_INTERRUPTS)
7
 		       || (!AVR_XMEGA && cfun->machine->is_signal)
8
-		       || (!AVR_XMEGA && cfun->machine->is_OS_main))
9
+		       || (!AVR_XMEGA && cfun->machine->is_OS_main)
10
+		       || (AVR_XMEGA && cfun->machine->is_nmi))
11
 		{
12
 		  insn = 
13
 		    emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx, 
14
@@ -963,7 +964,8 @@ expand_epilogue (void)
15
 		  emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
16
 		}
17
 	      else if ((!AVR_XMEGA && TARGET_NO_INTERRUPTS) 
18
-		       || (!AVR_XMEGA && cfun->machine->is_signal))
19
+		       || (!AVR_XMEGA && cfun->machine->is_signal)
20
+		       || (AVR_XMEGA && cfun->machine->is_nmi))
21
 		{
22
 		  emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx, 
23
 						     frame_pointer_rtx));
24
diff -Naurp gcc/function.c gcc/function.c
25
--- gcc/function.c	2010-02-26 09:58:57.000000000 -0600
26
+++ gcc/function.c	2011-01-19 13:45:48.000000000 -0600
27
@@ -4980,6 +4980,14 @@ contains (const_rtx insn, htab_t hash)
28
 }
29
 
30
 int
31
+prologue_contains (const_rtx insn)
32
+{
33
+  if (contains (insn, prologue_insn_hash))
34
+    return 1;
35
+  return 0;
36
+}
37
+
38
+int
39
 prologue_epilogue_contains (const_rtx insn)
40
 {
41
   if (contains (insn, prologue_insn_hash))
42
diff -Naurp gcc/rtl.h gcc/rtl.h
43
--- gcc/rtl.h	2010-03-16 05:50:42.000000000 -0500
44
+++ gcc/rtl.h	2011-01-19 13:45:48.000000000 -0600
45
@@ -2296,6 +2296,7 @@ extern void print_inline_rtx (FILE *, co
46
 
47
 /* In function.c */
48
 extern void reposition_prologue_and_epilogue_notes (void);
49
+extern int prologue_contains (const_rtx);
50
 extern int prologue_epilogue_contains (const_rtx);
51
 extern int sibcall_epilogue_contains (const_rtx);
52
 extern void mark_temp_addr_taken (rtx);
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-304-gcc-4.5.1-builtins-v6 (-585 lines)
Lines 1-585 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-01-19 13:48:07.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-01-19 13:49:37.000000000 -0600
4
@@ -30,6 +30,7 @@
5
 #include "insn-config.h"
6
 #include "conditions.h"
7
 #include "insn-attr.h"
8
+#include "insn-codes.h"
9
 #include "flags.h"
10
 #include "reload.h"
11
 #include "tree.h"
12
@@ -39,7 +40,9 @@
13
 #include "obstack.h"
14
 #include "function.h"
15
 #include "recog.h"
16
+#include "optabs.h"
17
 #include "ggc.h"
18
+#include "langhooks.h"
19
 #include "tm_p.h"
20
 #include "target.h"
21
 #include "target-def.h"
22
@@ -87,6 +90,8 @@ static bool avr_rtx_costs (rtx, int, int
23
 static int avr_address_cost (rtx, bool);
24
 static bool avr_return_in_memory (const_tree, const_tree);
25
 static struct machine_function * avr_init_machine_status (void);
26
+static void avr_init_builtins (void);
27
+static rtx avr_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
28
 static rtx avr_builtin_setjmp_frame_value (void);
29
 static bool avr_hard_regno_scratch_ok (unsigned int);
30
 static unsigned int avr_case_values_threshold (void);
31
@@ -197,6 +202,13 @@ static const struct attribute_spec avr_a
32
 #undef TARGET_SCALAR_MODE_SUPPORTED_P
33
 #define TARGET_SCALAR_MODE_SUPPORTED_P avr_scalar_mode_supported_p
34
 
35
+#undef TARGET_INIT_BUILTINS
36
+#define TARGET_INIT_BUILTINS avr_init_builtins
37
+ 
38
+#undef TARGET_EXPAND_BUILTIN
39
+#define TARGET_EXPAND_BUILTIN avr_expand_builtin
40
+
41
+
42
  /* Implement TARGET_SCALAR_MODE_SUPPORTED_P.  */
43
  static bool
44
  avr_scalar_mode_supported_p (enum machine_mode mode)
45
@@ -7286,4 +7298,237 @@ unsigned int avr_case_values_threshold (
46
   return (!AVR_HAVE_JMP_CALL || TARGET_CALL_PROLOGUES) ? 8 : 17;
47
 }
48
 
49
+/* Codes for all the AVR builtins.  */
50
+
51
+enum avr_builtins
52
+{
53
+  AVR_BUILTIN_SEI,
54
+  AVR_BUILTIN_CLI,
55
+  AVR_BUILTIN_WDR,
56
+  AVR_BUILTIN_SLEEP,
57
+  AVR_BUILTIN_SWAP,
58
+  AVR_BUILTIN_FMUL,
59
+  AVR_BUILTIN_FMULS,
60
+  AVR_BUILTIN_FMULSU,
61
+  AVR_BUILTIN_DELAY_CYCLES
62
+};
63
+
64
+#define def_builtin(NAME, TYPE, CODE)					\
65
+do {									\
66
+  add_builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD,		\
67
+		       NULL, NULL_TREE);				\
68
+} while (0)
69
+
70
+/* Set up all builtin functions for this target.  */
71
+
72
+static void
73
+avr_init_builtins (void)
74
+{
75
+  tree void_ftype_void
76
+    = build_function_type (void_type_node, void_list_node);
77
+  tree uchar_ftype_uchar
78
+    = build_function_type_list (unsigned_char_type_node, 
79
+                                unsigned_char_type_node,
80
+				NULL_TREE);
81
+  tree uint_ftype_uchar_uchar
82
+    = build_function_type_list (unsigned_type_node, 
83
+                                unsigned_char_type_node,
84
+				unsigned_char_type_node, 
85
+				NULL_TREE);
86
+  tree int_ftype_char_char
87
+    = build_function_type_list (integer_type_node, 
88
+                                char_type_node,
89
+				char_type_node, 
90
+				NULL_TREE);
91
+  tree int_ftype_char_uchar
92
+    = build_function_type_list (integer_type_node, 
93
+                                char_type_node,
94
+				unsigned_char_type_node, 
95
+				NULL_TREE);
96
+  tree void_ftype_ulong
97
+    = build_function_type_list (void_type_node, 
98
+                                long_unsigned_type_node,
99
+				NULL_TREE);
100
+
101
+  def_builtin ("__builtin_avr_sei", void_ftype_void, AVR_BUILTIN_SEI);
102
+  def_builtin ("__builtin_avr_cli", void_ftype_void, AVR_BUILTIN_CLI);
103
+  def_builtin ("__builtin_avr_wdr", void_ftype_void, AVR_BUILTIN_WDR);
104
+  def_builtin ("__builtin_avr_sleep", void_ftype_void, AVR_BUILTIN_SLEEP);
105
+
106
+  if (AVR_HAVE_MUL)
107
+    {
108
+      def_builtin ("__builtin_avr_fmul", uint_ftype_uchar_uchar, 
109
+                   AVR_BUILTIN_FMUL);
110
+      def_builtin ("__builtin_avr_fmuls", int_ftype_char_char, 
111
+                   AVR_BUILTIN_FMULS);
112
+      def_builtin ("__builtin_avr_fmulsu", int_ftype_char_uchar, 
113
+                   AVR_BUILTIN_FMULSU);
114
+    }
115
+
116
+  def_builtin ("__builtin_avr_swap", uchar_ftype_uchar, AVR_BUILTIN_SWAP);
117
+  def_builtin ("__builtin_avr_delay_cycles", void_ftype_ulong, 
118
+               AVR_BUILTIN_DELAY_CYCLES);
119
+}
120
+
121
+struct builtin_description
122
+{
123
+  const enum insn_code icode;
124
+  const char *const name;
125
+  const enum avr_builtins code;
126
+};
127
+
128
+static const struct builtin_description bdesc_1arg[] =
129
+{
130
+  { CODE_FOR_swap, "__builtin_avr_swap", AVR_BUILTIN_SWAP }
131
+};
132
+
133
+static const struct builtin_description bdesc_2arg[] =
134
+{
135
+  { CODE_FOR_fmul, "__builtin_avr_fmul", AVR_BUILTIN_FMUL },
136
+  { CODE_FOR_fmuls, "__builtin_avr_fmuls", AVR_BUILTIN_FMULS },
137
+  { CODE_FOR_fmulsu, "__builtin_avr_fmulsu", AVR_BUILTIN_FMULSU }
138
+};
139
+
140
+/* Subroutine of avr_expand_builtin to take care of unop insns.  */
141
+
142
+static rtx
143
+avr_expand_unop_builtin (enum insn_code icode, tree exp,
144
+			  rtx target)
145
+{
146
+  rtx pat;
147
+  tree arg0 = CALL_EXPR_ARG (exp, 0);
148
+  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
149
+  enum machine_mode op0mode = GET_MODE (op0);
150
+  enum machine_mode tmode = insn_data[icode].operand[0].mode;
151
+  enum machine_mode mode0 = insn_data[icode].operand[1].mode;
152
+
153
+  if (! target
154
+      || GET_MODE (target) != tmode
155
+      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
156
+    target = gen_reg_rtx (tmode);
157
+
158
+  if (op0mode == SImode && mode0 == HImode)
159
+    {
160
+      op0mode = HImode;
161
+      op0 = gen_lowpart (HImode, op0);
162
+    }
163
+  gcc_assert (op0mode == mode0 || op0mode == VOIDmode);
164
+
165
+  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
166
+    op0 = copy_to_mode_reg (mode0, op0);
167
+
168
+  pat = GEN_FCN (icode) (target, op0);
169
+  if (! pat)
170
+    return 0;
171
+  emit_insn (pat);
172
+  return target;
173
+}
174
+
175
+/* Subroutine of avr_expand_builtin to take care of binop insns.  */
176
+
177
+static rtx
178
+avr_expand_binop_builtin (enum insn_code icode, tree exp, rtx target)
179
+{
180
+  rtx pat;
181
+  tree arg0 = CALL_EXPR_ARG (exp, 0);
182
+  tree arg1 = CALL_EXPR_ARG (exp, 1);
183
+  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
184
+  rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
185
+  enum machine_mode op0mode = GET_MODE (op0);
186
+  enum machine_mode op1mode = GET_MODE (op1);
187
+  enum machine_mode tmode = insn_data[icode].operand[0].mode;
188
+  enum machine_mode mode0 = insn_data[icode].operand[1].mode;
189
+  enum machine_mode mode1 = insn_data[icode].operand[2].mode;
190
+
191
+  if (! target
192
+      || GET_MODE (target) != tmode
193
+      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
194
+    target = gen_reg_rtx (tmode);
195
+
196
+  if ((op0mode == SImode || op0mode == VOIDmode) && mode0 == HImode)
197
+    {
198
+      op0mode = HImode;
199
+      op0 = gen_lowpart (HImode, op0);
200
+    }
201
+  if ((op1mode == SImode || op1mode == VOIDmode) && mode1 == HImode)
202
+    {
203
+      op1mode = HImode;
204
+      op1 = gen_lowpart (HImode, op1);
205
+    }
206
+  /* In case the insn wants input operands in modes different from
207
+     the result, abort.  */
208
+  gcc_assert ((op0mode == mode0 || op0mode == VOIDmode)
209
+	      && (op1mode == mode1 || op1mode == VOIDmode));
210
+
211
+  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
212
+    op0 = copy_to_mode_reg (mode0, op0);
213
+  if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
214
+    op1 = copy_to_mode_reg (mode1, op1);
215
+
216
+  pat = GEN_FCN (icode) (target, op0, op1);
217
+  if (! pat)
218
+    return 0;
219
+
220
+  emit_insn (pat);
221
+  return target;
222
+}
223
+
224
+/* Expand an expression EXP that calls a built-in function,
225
+   with result going to TARGET if that's convenient
226
+   (and in mode MODE if that's convenient).
227
+   SUBTARGET may be used as the target for computing one of EXP's operands.
228
+   IGNORE is nonzero if the value is to be ignored.  */
229
+
230
+static rtx
231
+avr_expand_builtin (tree exp, rtx target,
232
+		     rtx subtarget ATTRIBUTE_UNUSED,
233
+		     enum machine_mode mode ATTRIBUTE_UNUSED,
234
+		     int ignore ATTRIBUTE_UNUSED)
235
+{
236
+  size_t i;
237
+  const struct builtin_description *d;
238
+  tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
239
+  unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
240
+  rtx pat;
241
+  tree arg0;
242
+  rtx op0;
243
+
244
+  switch (fcode)
245
+    {
246
+    case AVR_BUILTIN_SEI:
247
+      emit_insn (gen_enable_interrupt ());
248
+      return 0;
249
+    case AVR_BUILTIN_CLI:
250
+      emit_insn (gen_disable_interrupt ());
251
+      return 0;
252
+    case AVR_BUILTIN_WDR:
253
+      emit_insn (gen_wdr ());
254
+      return 0;
255
+    case AVR_BUILTIN_SLEEP:
256
+      emit_insn (gen_sleep ());
257
+      return 0;
258
+    case AVR_BUILTIN_DELAY_CYCLES:
259
+      {
260
+        arg0 = CALL_EXPR_ARG (exp, 0);
261
+        op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
262
+
263
+        if (!CONSTANT_P (op0))
264
+          error ("__builtin_avr_delay_cycles expects an integer constant.");
265
+
266
+        emit_insn (gen_delay_cycles (op0));
267
+        return 0;
268
+      }
269
+    }
270
+
271
+  for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
272
+    if (d->code == fcode)
273
+      return avr_expand_unop_builtin (d->icode, exp, target);
274
+
275
+  for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
276
+    if (d->code == fcode)
277
+      return avr_expand_binop_builtin (d->icode, exp, target);
278
+
279
+  gcc_unreachable ();
280
+}
281
+
282
 #include "gt-avr.h"
283
diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
284
--- gcc/config/avr/avr.md	2011-01-19 13:45:00.000000000 -0600
285
+++ gcc/config/avr/avr.md	2011-01-19 13:49:37.000000000 -0600
286
@@ -51,14 +51,29 @@
287
    
288
    (UNSPEC_STRLEN	0)
289
    (UNSPEC_INDEX_JMP	1)
290
-   (UNSPEC_SEI		2)
291
-   (UNSPEC_CLI		3)
292
+   (UNSPEC_SWAP               2)
293
+   (UNSPEC_FMUL               3)
294
+   (UNSPEC_FMULS      4)
295
+   (UNSPEC_FMULSU     5)
296
+
297
 
298
    (UNSPECV_PROLOGUE_SAVES	0)
299
    (UNSPECV_EPILOGUE_RESTORES	1)
300
    (UNSPECV_WRITE_SP_IRQ_ON	2)
301
    (UNSPECV_WRITE_SP_IRQ_OFF	3)
302
-   (UNSPECV_GOTO_RECEIVER	4)])
303
+   (UNSPECV_GOTO_RECEIVER	4)
304
+   (UNSPECV_SEI                       5)
305
+   (UNSPECV_CLI                       6)
306
+   (UNSPECV_NOP                       7)
307
+   (UNSPECV_NOP2              8)
308
+   (UNSPECV_SLEEP             9)
309
+   (UNSPECV_WDR                       10)
310
+
311
+   (UNSPECV_DELAY_CYCLES      100)
312
+   (UNSPECV_DELAY_CYCLES_1    101)
313
+   (UNSPECV_DELAY_CYCLES_2    102)
314
+   (UNSPECV_DELAY_CYCLES_3    103)
315
+   (UNSPECV_DELAY_CYCLES_4    104)])
316
 
317
 (include "predicates.md")
318
 (include "constraints.md")
319
@@ -2813,13 +2828,6 @@
320
 					(const_int 1))
321
 			  (const_int 3)])])
322
 
323
-(define_insn "nop"
324
-  [(const_int 0)]
325
-  ""
326
-  "nop"
327
-  [(set_attr "cc" "none")
328
-   (set_attr "length" "1")])
329
-
330
 ; indirect jump
331
 
332
 (define_expand "indirect_jump"
333
@@ -3221,7 +3229,7 @@
334
 
335
 ;; Enable Interrupts
336
 (define_insn "enable_interrupt"
337
-  [(unspec [(const_int 0)] UNSPEC_SEI)]
338
+  [(unspec_volatile [(const_int 0)] UNSPECV_SEI)]
339
   ""
340
   "sei"
341
   [(set_attr "length" "1")
342
@@ -3230,7 +3238,7 @@
343
 
344
 ;; Disable Interrupts
345
 (define_insn "disable_interrupt"
346
-  [(unspec [(const_int 0)] UNSPEC_CLI)]
347
+  [(unspec_volatile [(const_int 0)] UNSPECV_CLI)]
348
   ""
349
   "cli"
350
   [(set_attr "length" "1")
351
@@ -3330,3 +3338,219 @@
352
     expand_epilogue (); 
353
     DONE;
354
   }")
355
+
356
+;;delay_cycles_delay_cycles_delay_cycles_delay_cycles_delay_cycles_delay
357
+;; delay_cycles
358
+
359
+(define_expand "delay_cycles"
360
+  [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "i")]
361
+                    UNSPECV_DELAY_CYCLES)]
362
+  ""
363
+  "
364
+  rtx loop_reg;
365
+  unsigned int cycles = INTVAL (operands[0]);
366
+  if (IN_RANGE(cycles, 83886082, 0xFFFFFFFF))
367
+    {
368
+      unsigned int loop_count = ((cycles - 9) / 6) + 1;
369
+      unsigned int cycles_used = (((loop_count - 1) * 6) + 9);
370
+      emit_insn (gen_delay_cycles_4 (gen_int_mode (loop_count, SImode)));
371
+      cycles -= cycles_used;
372
+    }
373
+  if (IN_RANGE(cycles, 262145, 83886081))
374
+    {
375
+      unsigned int loop_count = ((cycles - 7) / 5) + 1;
376
+      if (loop_count > 0xFFFFFF)
377
+        loop_count = 0xFFFFFF;
378
+      unsigned int cycles_used = (((loop_count - 1) * 5) + 7);
379
+      emit_insn (gen_delay_cycles_3 (gen_int_mode (loop_count, SImode)));
380
+      cycles -= cycles_used;
381
+    }
382
+  if (IN_RANGE(cycles, 768, 262144))
383
+    {
384
+      unsigned int loop_count = ((cycles - 5) / 4) + 1;
385
+      if (loop_count > 0xFFFF)
386
+        loop_count = 0xFFFF;
387
+      unsigned int cycles_used = (((loop_count - 1) * 4) + 5);
388
+      emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode)));
389
+      cycles -= cycles_used;
390
+    }
391
+  if (IN_RANGE(cycles, 6, 767))
392
+    {
393
+      unsigned int loop_count = (cycles/ 3);
394
+      if (loop_count > 255) 
395
+        loop_count = 255;
396
+      unsigned int cycles_used = (loop_count * 3);
397
+      emit_insn (gen_delay_cycles_1 (gen_int_mode (loop_count, QImode)));
398
+      cycles -= cycles_used;
399
+    }
400
+  while (cycles >= 2)
401
+    {
402
+      emit_insn (gen_nop2 ());
403
+      cycles -= 2;
404
+    }
405
+  if (cycles == 1)
406
+    {
407
+      emit_insn (gen_nop ());
408
+      cycles--;
409
+    }
410
+  DONE;
411
+  ")
412
+
413
+(define_insn "delay_cycles_1"
414
+[(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_1)
415
+  (match_operand:QI 0 "immediate_operand" "")
416
+  (clobber (match_scratch:QI 1 "=&d"))]
417
+  ""
418
+  " ldi %1,lo8(%0)
419
+    1:dec %1
420
+    brne 1b"
421
+  [(set_attr "length" "3")
422
+   (set_attr "cc" "clobber")]) 
423
+
424
+(define_insn "delay_cycles_2"
425
+  [(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_2)
426
+   (match_operand:HI 0 "immediate_operand" "")
427
+   (clobber (match_scratch:HI 1 "=&w"))]
428
+  ""
429
+  " ldi %A1,lo8(%0)
430
+    ldi %B1,hi8(%0)
431
+    1:sbiw %A1,1
432
+    brne 1b"
433
+  [(set_attr "length" "4")
434
+   (set_attr "cc" "clobber")])
435
+
436
+(define_insn "delay_cycles_3"
437
+  [(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_3)
438
+   (match_operand:SI 0 "immediate_operand" "")
439
+   (clobber (match_scratch:SI 1 "=&d"))]
440
+  ""
441
+  " ldi %A1,lo8(%0)
442
+    ldi %B1,hi8(%0)
443
+    ldi %C1,hlo8(%0)
444
+    1:subi %A1,1
445
+    sbci %B1,0
446
+    sbci %C1,0
447
+    brne 1b"
448
+  [(set_attr "length" "7")
449
+   (set_attr "cc" "clobber")])
450
+
451
+(define_insn "delay_cycles_4"
452
+  [(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_4)
453
+   (match_operand:SI 0 "immediate_operand" "")
454
+   (clobber (match_scratch:SI 1 "=&d"))]
455
+  ""
456
+  " ldi %A1,lo8(%0)
457
+    ldi %B1,hi8(%0)
458
+    ldi %C1,hlo8(%0)
459
+    ldi %D1,hhi8(%0)
460
+    1:subi %A1,1
461
+    sbci %B1,0
462
+    sbci %C1,0
463
+    sbci %D1,0
464
+    brne 1b"
465
+  [(set_attr "length" "9")
466
+   (set_attr "cc" "clobber")])
467
+
468
+;; CPU instructions
469
+
470
+;; NOP
471
+(define_insn "nop"
472
+  [(unspec_volatile [(const_int 0)] UNSPECV_NOP)]
473
+  ""
474
+  "nop"
475
+  [(set_attr "length" "1")
476
+  (set_attr "cc" "none")])
477
+
478
+;; NOP2
479
+(define_insn "nop2"
480
+  [(unspec_volatile [(const_int 0)] UNSPECV_NOP2)]
481
+  ""
482
+  "rjmp ."
483
+  [(set_attr "length" "1")
484
+  (set_attr "cc" "none")])
485
+
486
+;; SEI, Enable Interrupts
487
+;(define_insn "sei"
488
+;  [(unspec_volatile [(const_int 0)] UNSPECV_SEI)]
489
+;  ""
490
+;  "sei"
491
+;  [(set_attr "length" "1")
492
+;  (set_attr "cc" "none")
493
+;  ])
494
+
495
+;; CLI, Disable Interrupts
496
+;(define_insn "cli"
497
+;  [(unspec_volatile [(const_int 0)] UNSPECV_CLI)]
498
+;  ""
499
+;  "cli"
500
+;  [(set_attr "length" "1")
501
+;  (set_attr "cc" "none")
502
+;  ])
503
+
504
+;; SLEEP
505
+(define_insn "sleep"
506
+  [(unspec_volatile [(const_int 0)] UNSPECV_SLEEP)]
507
+  ""
508
+  "sleep"
509
+  [(set_attr "length" "1")
510
+  (set_attr "cc" "none")
511
+  ])
512
+ 
513
+;; WDR
514
+(define_insn "wdr"
515
+  [(unspec_volatile [(const_int 0)] UNSPECV_WDR)]
516
+  ""
517
+  "wdr"
518
+  [(set_attr "length" "1")
519
+  (set_attr "cc" "none")
520
+  ])
521
+  
522
+;; SWAP
523
+(define_insn "swap"
524
+  [(set (match_operand:QI 0 "register_operand" "=r")
525
+	(unspec:QI [(match_operand:QI 1 "register_operand" "0")]
526
+		   UNSPEC_SWAP))]
527
+  ""
528
+  "swap %0"
529
+  [(set_attr "length" "1")
530
+   (set_attr "cc" "none")])
531
+
532
+;; FMUL
533
+(define_insn "fmul"
534
+  [(set (match_operand:HI 0 "a_register_operand" "=r")
535
+	(unspec:HI [(match_operand:QI 1 "a_register_operand" "r")
536
+		    (match_operand:QI 2 "a_register_operand" "r")]
537
+		    UNSPEC_FMUL))]
538
+  "AVR_HAVE_MUL"
539
+  "fmul %1,%2
540
+	movw %0,r0
541
+	clr r1"
542
+  [(set_attr "length" "3")
543
+   (set_attr "cc" "clobber")])
544
+
545
+;; FMULS
546
+(define_insn "fmuls"
547
+  [(set (match_operand:HI 0 "a_register_operand" "=r")
548
+	(unspec:HI [(match_operand:QI 1 "a_register_operand" "r")
549
+		    (match_operand:QI 2 "a_register_operand" "r")]
550
+		    UNSPEC_FMULS))]
551
+  "AVR_HAVE_MUL"
552
+  "fmuls %1,%2
553
+	movw %0,r0
554
+	clr r1"
555
+  [(set_attr "length" "3")
556
+   (set_attr "cc" "clobber")])
557
+
558
+;; FMULSU
559
+(define_insn "fmulsu"
560
+  [(set (match_operand:HI 0 "a_register_operand" "=r")
561
+	(unspec:HI [(match_operand:QI 1 "a_register_operand" "r")
562
+		    (match_operand:QI 2 "a_register_operand" "r")]
563
+		    UNSPEC_FMULSU))]
564
+  "AVR_HAVE_MUL"
565
+  "fmulsu %1,%2
566
+	movw %0,r0
567
+	clr r1"
568
+  [(set_attr "length" "3")
569
+   (set_attr "cc" "clobber")])
570
+
571
diff -Naurp gcc/config/avr/predicates.md gcc/config/avr/predicates.md
572
--- gcc/config/avr/predicates.md	2011-01-19 13:03:59.000000000 -0600
573
+++ gcc/config/avr/predicates.md	2011-01-19 13:49:37.000000000 -0600
574
@@ -27,6 +27,11 @@
575
   (and (match_code "reg")
576
        (match_test "REGNO (op) >= 16 && REGNO (op) <= 31")))
577
 
578
+;; Registers from r16 to 24.
579
+(define_predicate "a_register_operand"
580
+  (and (match_code "reg")
581
+       (match_test "REGNO (op) >= 16 && REGNO (op) <= 24")))
582
+
583
 (define_predicate "even_register_operand"
584
   (and (match_code "reg")
585
        (and (match_test "REGNO (op) <= 31")
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-305-gcc-4.5.1-avrtiny10-non-fixedpoint (-49 lines)
Lines 1-49 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-02-07 16:17:20.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-02-07 16:12:53.000000000 -0600
4
@@ -202,6 +202,9 @@ static const struct attribute_spec avr_a
5
 #undef TARGET_SCALAR_MODE_SUPPORTED_P
6
 #define TARGET_SCALAR_MODE_SUPPORTED_P avr_scalar_mode_supported_p
7
 
8
+#undef TARGET_FIXED_POINT_SUPPORTED_P
9
+#define TARGET_FIXED_POINT_SUPPORTED_P avr_fixed_point_supported_p
10
+
11
 #undef TARGET_INIT_BUILTINS
12
 #define TARGET_INIT_BUILTINS avr_init_builtins
13
  
14
@@ -219,6 +222,17 @@ static const struct attribute_spec avr_a
15
    return default_scalar_mode_supported_p (mode);
16
  }
17
  
18
+ /* Implement TARGET_FIXED_POINT_SUPPORTED_P.  */
19
+ static bool
20
+ avr_fixed_point_supported_p ()
21
+ {
22
+    if (AVR_TINY)
23
+       return false;
24
+ 
25
+   return default_fixed_point_supported_p ();
26
+ }
27
+ 
28
+ 
29
 struct gcc_target targetm = TARGET_INITIALIZER;
30
 
31
 void
32
diff -Naurp gcc/config/fixed-bit.c gcc/config/fixed-bit.c
33
--- gcc/config/fixed-bit.c	2009-04-09 10:00:19.000000000 -0500
34
+++ gcc/config/fixed-bit.c	2011-02-07 16:12:53.000000000 -0600
35
@@ -41,7 +41,7 @@ see the files COPYING3 and COPYING.RUNTI
36
    Floating-point: SF, DF
37
    Ex: If we define FROM_QQ and TO_SI, the conversion from QQ to SI is
38
    generated.  */
39
-
40
+#if !defined (__AVR_TINY__)
41
 #include "tconfig.h"
42
 #include "tsystem.h"
43
 #include "coretypes.h"
44
@@ -1213,4 +1213,4 @@ SATFRACT (FROM_FLOAT_C_TYPE a)
45
   return c;
46
 }
47
 #endif /* defined(SATFRACT) && FROM_TYPE == 3 && TO_TYPE == 4  */
48
-
49
+#endif /* __AVR_TINY__ */
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-306-gcc-4.5.1-option-list-devices (-49 lines)
Lines 1-49 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-02-11 14:56:08.000000000 -0600
3
+++ gcc/config/avr/avr.c	2011-02-11 14:54:05.000000000 -0600
4
@@ -211,6 +211,8 @@ static const struct attribute_spec avr_a
5
 #undef TARGET_EXPAND_BUILTIN
6
 #define TARGET_EXPAND_BUILTIN avr_expand_builtin
7
 
8
+#undef TARGET_HELP
9
+#define TARGET_HELP avr_target_help
10
 
11
  /* Implement TARGET_SCALAR_MODE_SUPPORTED_P.  */
12
  static bool
13
@@ -232,7 +234,24 @@ static const struct attribute_spec avr_a
14
    return default_fixed_point_supported_p ();
15
  }
16
  
17
- 
18
+/* Implement TARGET_HELP.  */
19
+void
20
+avr_target_help (void)
21
+{
22
+   if (avr_list_supported_parts)
23
+      {
24
+        const struct mcu_type_s *list_part;
25
+        fprintf (stdout, "List of parts supported by avr-gcc:\n");
26
+        for (list_part = &avr_mcu_types[0]; (list_part + 1)->name; list_part++)
27
+          {
28
+            if (!list_part->macro)
29
+               list_part++;
30
+            fprintf (stdout, "%-20s%s\n", list_part->name, list_part->macro);
31
+          }
32
+         fprintf (stdout, "\n");
33
+      }
34
+}
35
+
36
 struct gcc_target targetm = TARGET_INITIALIZER;
37
 
38
 void
39
diff -Naurp gcc/config/avr/avr.opt gcc/config/avr/avr.opt
40
--- gcc/config/avr/avr.opt	2009-10-08 13:28:48.000000000 -0500
41
+++ gcc/config/avr/avr.opt	2011-02-11 14:53:20.000000000 -0600
42
@@ -58,3 +58,7 @@ Relax branches
43
 mpmem-wrap-around
44
 Target Report
45
 Make the linker relaxation machine assume that a program counter wrap-around occures.
46
+
47
+mlist-devices
48
+Target RejectNegative Var(avr_list_supported_parts)
49
+Print the list of parts supported while printing --target-help
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-400-gcc-4.5.1-new-devices (-328 lines)
Lines 1-328 Link Here
1
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-02-07 14:19:27.000000000 -0600
3
+++ gcc/config/avr/avr-devices.c	2011-02-07 14:21:41.000000000 -0600
4
@@ -75,15 +75,23 @@ const struct mcu_type_s avr_mcu_types[] 
5
   { "attiny13",             ARCH_AVR25, "__AVR_ATtiny13__",         1, 0x0060, "tn13" },
6
   { "attiny13a",            ARCH_AVR25, "__AVR_ATtiny13A__",        1, 0x0060, "tn13a" },
7
   { "attiny2313",           ARCH_AVR25, "__AVR_ATtiny2313__",       1, 0x0060, "tn2313" },
8
+  { "attiny2313a",          ARCH_AVR25, "__AVR_ATtiny2313A__",      1, 0x0060, "tn2313a" },
9
   { "attiny24",             ARCH_AVR25, "__AVR_ATtiny24__",         1, 0x0060, "tn24" },
10
+  { "attiny24a",            ARCH_AVR25, "__AVR_ATtiny24A__",        1, 0x0060, "tn24a" },
11
+  { "attiny4313",           ARCH_AVR25, "__AVR_ATtiny4313__",       0, 0x0060, "tn4313" },
12
   { "attiny44",             ARCH_AVR25, "__AVR_ATtiny44__",         0, 0x0060, "tn44" },
13
+  { "attiny44a",            ARCH_AVR25, "__AVR_ATtiny44A__",        0, 0x0060, "tn44a" },
14
   { "attiny84",             ARCH_AVR25, "__AVR_ATtiny84__",         0, 0x0060, "tn84" },
15
+  { "attiny84a",            ARCH_AVR25, "__AVR_ATtiny84A__",        0, 0x0060, "tn84a" },
16
   { "attiny25",             ARCH_AVR25, "__AVR_ATtiny25__",         1, 0x0060, "tn25" },
17
   { "attiny45",             ARCH_AVR25, "__AVR_ATtiny45__",         0, 0x0060, "tn45" },
18
   { "attiny85",             ARCH_AVR25, "__AVR_ATtiny85__",         0, 0x0060, "tn85" },
19
   { "attiny261",            ARCH_AVR25, "__AVR_ATtiny261__",        1, 0x0060, "tn261" },
20
+  { "attiny261a",           ARCH_AVR25, "__AVR_ATtiny261A__",       1, 0x0060, "tn261a" },
21
   { "attiny461",            ARCH_AVR25, "__AVR_ATtiny461__",        0, 0x0060, "tn461" },
22
+  { "attiny461a",           ARCH_AVR25, "__AVR_ATtiny461A__",       0, 0x0060, "tn461a" },
23
   { "attiny861",            ARCH_AVR25, "__AVR_ATtiny861__",        0, 0x0060, "tn861" },
24
+  { "attiny861a",           ARCH_AVR25, "__AVR_ATtiny861A__",       0, 0x0060, "tn861a" },
25
   { "attiny43u",            ARCH_AVR25, "__AVR_ATtiny43U__",        0, 0x0060, "tn43u" },
26
   { "attiny87",             ARCH_AVR25, "__AVR_ATtiny87__",         0, 0x0100, "tn87" },
27
   { "attiny48",             ARCH_AVR25, "__AVR_ATtiny48__",         0, 0x0100, "tn48" },
28
@@ -105,21 +113,19 @@ const struct mcu_type_s avr_mcu_types[] 
29
   { "atmega16u2",           ARCH_AVR35, "__AVR_ATmega16U2__",       0, 0x0100, "m16u2" },
30
   { "atmega32u2",           ARCH_AVR35, "__AVR_ATmega32U2__",       0, 0x0100, "m32u2" },
31
   { "attiny167",            ARCH_AVR35, "__AVR_ATtiny167__",        0, 0x0100, "tn167" },
32
-  { "attiny327",            ARCH_AVR35, "__AVR_ATtiny327__",        0, 0x0100, "tn327" },
33
     /* Enhanced, <= 8K.  */
34
   { "avr4",                 ARCH_AVR4, NULL,                        0, 0x0060, "m8" },
35
   { "atmega8",              ARCH_AVR4, "__AVR_ATmega8__",           0, 0x0060, "m8" },
36
   { "atmega48",             ARCH_AVR4, "__AVR_ATmega48__",          0, 0x0100, "m48" },
37
+  { "atmega48a",            ARCH_AVR4, "__AVR_ATmega48A__",         0, 0x0100, "m48a" },
38
   { "atmega48p",            ARCH_AVR4, "__AVR_ATmega48P__",         0, 0x0100, "m48p" },
39
   { "atmega88",             ARCH_AVR4, "__AVR_ATmega88__",          0, 0x0100, "m88" },
40
+  { "atmega88a",            ARCH_AVR4, "__AVR_ATmega88A__",         0, 0x0100, "m88a" },
41
   { "atmega88p",            ARCH_AVR4, "__AVR_ATmega88P__",         0, 0x0100, "m88p" },
42
+  { "atmega88pa",           ARCH_AVR4, "__AVR_ATmega88PA__",        0, 0x0100, "m88pa" },
43
   { "atmega8515",           ARCH_AVR4, "__AVR_ATmega8515__",        0, 0x0060, "m8515" },
44
   { "atmega8535",           ARCH_AVR4, "__AVR_ATmega8535__",        0, 0x0060, "m8535" },
45
-  { "atmega8c1",            ARCH_AVR4, "__AVR_ATmega8C1__",         0, 0x0100, "m8c1" },
46
-  { "atmega8m1",            ARCH_AVR4, "__AVR_ATmega8M1__",         0, 0x0100, "m8m1" },
47
   { "atmega8hva",           ARCH_AVR4, "__AVR_ATmega8HVA__",        0, 0x0100, "m8hva" },
48
-  { "atmega4hvd",           ARCH_AVR4, "__AVR_ATmega4HVD__",        0, 0x0100, "m4hvd" },
49
-  { "atmega8hvd",           ARCH_AVR4, "__AVR_ATmega8HVD__",        0, 0x0100, "m8hvd" },
50
   { "at90pwm1",             ARCH_AVR4, "__AVR_AT90PWM1__",          0, 0x0100, "90pwm1" },
51
   { "at90pwm2",             ARCH_AVR4, "__AVR_AT90PWM2__",          0, 0x0100, "90pwm2" },
52
   { "at90pwm2b",            ARCH_AVR4, "__AVR_AT90PWM2B__",         0, 0x0100, "90pwm2b" },
53
@@ -128,41 +134,78 @@ const struct mcu_type_s avr_mcu_types[] 
54
   { "at90pwm81",            ARCH_AVR4, "__AVR_AT90PWM81__",         0, 0x0100, "90pwm81" },
55
     /* Enhanced, > 8K, <= 64K.  */
56
   { "avr5",                 ARCH_AVR5, NULL,                        0, 0x0060, "m16" },
57
+  { "at90pwm161",           ARCH_AVR5, "__AVR_AT90PWM161__",        1, 0x0100, "90pwm161" },
58
   { "atmega16",             ARCH_AVR5, "__AVR_ATmega16__",          0, 0x0060, "m16" },
59
+  { "atmega16a",            ARCH_AVR5, "__AVR_ATmega16A__",         0, 0x0060, "m16a" },
60
   { "atmega161",            ARCH_AVR5, "__AVR_ATmega161__",         0, 0x0060, "m161" },
61
   { "atmega162",            ARCH_AVR5, "__AVR_ATmega162__",         0, 0x0100, "m162" },
62
   { "atmega163",            ARCH_AVR5, "__AVR_ATmega163__",         0, 0x0060, "m163" },
63
+  { "atmega164a",           ARCH_AVR5, "__AVR_ATmega164A__",        0, 0x0060, "m164a" },
64
   { "atmega164p",           ARCH_AVR5, "__AVR_ATmega164P__",        0, 0x0100, "m164p" },
65
   { "atmega165",            ARCH_AVR5, "__AVR_ATmega165__",         0, 0x0100, "m165" },
66
+  { "atmega165a",           ARCH_AVR5, "__AVR_ATmega165A__",        0, 0x0100, "m165a" },
67
   { "atmega165p",           ARCH_AVR5, "__AVR_ATmega165P__",        0, 0x0100, "m165p" },
68
   { "atmega168",            ARCH_AVR5, "__AVR_ATmega168__",         0, 0x0100, "m168" },
69
+  { "atmega168a",           ARCH_AVR5, "__AVR_ATmega168A__",        0, 0x0100, "m168a" },
70
   { "atmega168p",           ARCH_AVR5, "__AVR_ATmega168P__",        0, 0x0100, "m168p" },
71
   { "atmega169",            ARCH_AVR5, "__AVR_ATmega169__",         0, 0x0100, "m169" },
72
+  { "atmega169a",           ARCH_AVR5, "__AVR_ATmega169A__",        0, 0x0100, "m169a" },
73
   { "atmega169p",           ARCH_AVR5, "__AVR_ATmega169P__",        0, 0x0100, "m169p" },
74
+  { "atmega169pa",          ARCH_AVR5, "__AVR_ATmega169PA__",       0, 0x0100, "m169pa" },
75
+  { "atmega16hva",          ARCH_AVR5, "__AVR_ATmega16HVA__",       0, 0x0100, "m16hva" },
76
+  { "atmega16hva2",         ARCH_AVR5, "__AVR_ATmega16HVA2__",      0, 0x0100, "m16hva2" },
77
+  { "atmega16hvb",          ARCH_AVR5, "__AVR_ATmega16HVB__",       0, 0x0100, "m16hvb" },
78
+  { "atmega16hvbrevb",      ARCH_AVR5, "__AVR_ATmega16HVBREVB__",   1, 0x0100, "m16hvbrevb" },
79
+  { "atmega16m1",           ARCH_AVR5, "__AVR_ATmega16M1__",        0, 0x0100, "m16m1" },
80
+  { "atmega16u4",           ARCH_AVR5, "__AVR_ATmega16U4__",        0, 0x0100, "m16u4" },
81
   { "atmega32",             ARCH_AVR5, "__AVR_ATmega32__",          0, 0x0060, "m32" },
82
   { "atmega323",            ARCH_AVR5, "__AVR_ATmega323__",         0, 0x0060, "m323" },
83
+  { "atmega324a",           ARCH_AVR5, "__AVR_ATmega324A__",        0, 0x0060, "m324a" },
84
   { "atmega324p",           ARCH_AVR5, "__AVR_ATmega324P__",        0, 0x0100, "m324p" },
85
+  { "atmega324pa",          ARCH_AVR5, "__AVR_ATmega324PA__",       0, 0x0100, "m324pa" },
86
   { "atmega325",            ARCH_AVR5, "__AVR_ATmega325__",         0, 0x0100, "m325" },
87
+  { "atmega325a",           ARCH_AVR5, "__AVR_ATmega325A__",        0, 0x0100, "m325a" },
88
   { "atmega325p",           ARCH_AVR5, "__AVR_ATmega325P__",        0, 0x0100, "m325p" },
89
   { "atmega3250",           ARCH_AVR5, "__AVR_ATmega3250__",        0, 0x0100, "m3250" },
90
+  { "atmega3250a",          ARCH_AVR5, "__AVR_ATmega3250A__",       0, 0x0100, "m3250a" },
91
   { "atmega3250p",          ARCH_AVR5, "__AVR_ATmega3250P__",       0, 0x0100, "m3250p" },
92
+  { "atmega328",            ARCH_AVR5, "__AVR_ATmega328__",         0, 0x0100, "m328" },
93
   { "atmega328p",           ARCH_AVR5, "__AVR_ATmega328P__",        0, 0x0100, "m328p" },
94
   { "atmega329",            ARCH_AVR5, "__AVR_ATmega329__",         0, 0x0100, "m329" },
95
+  { "atmega329a",           ARCH_AVR5, "__AVR_ATmega329A__",        0, 0x0100, "m329a" },
96
   { "atmega329p",           ARCH_AVR5, "__AVR_ATmega329P__",        0, 0x0100, "m329p" },
97
+  { "atmega329pa",          ARCH_AVR5, "__AVR_ATmega329PA__",       0, 0x0100, "m329pa" },
98
   { "atmega3290",           ARCH_AVR5, "__AVR_ATmega3290__",        0, 0x0100, "m3290" },
99
+  { "atmega3290a",          ARCH_AVR5, "__AVR_ATmega3290A__",       0, 0x0100, "m3290a" },
100
   { "atmega3290p",          ARCH_AVR5, "__AVR_ATmega3290P__",       0, 0x0100, "m3290p" },
101
+  { "atmega32c1",           ARCH_AVR5, "__AVR_ATmega32C1__",        0, 0x0100, "m32c1" },
102
+  { "atmega32m1",           ARCH_AVR5, "__AVR_ATmega32M1__",        0, 0x0100, "m32m1" },
103
+  { "atmega32u4",           ARCH_AVR5, "__AVR_ATmega32U4__",        0, 0x0100, "m32u4" },
104
+  { "atmega32u6",           ARCH_AVR5, "__AVR_ATmega32U6__",        0, 0x0100, "m32u6" },
105
   { "atmega406",            ARCH_AVR5, "__AVR_ATmega406__",         0, 0x0100, "m406" },
106
   { "atmega64",             ARCH_AVR5, "__AVR_ATmega64__",          0, 0x0100, "m64" },
107
   { "atmega640",            ARCH_AVR5, "__AVR_ATmega640__",         0, 0x0200, "m640" },
108
   { "atmega644",            ARCH_AVR5, "__AVR_ATmega644__",         0, 0x0100, "m644" },
109
+  { "atmega644a",           ARCH_AVR5, "__AVR_ATmega644A__",        0, 0x0100, "m644a" },
110
   { "atmega644p",           ARCH_AVR5, "__AVR_ATmega644P__",        0, 0x0100, "m644p" },
111
+  { "atmega644pa",          ARCH_AVR5, "__AVR_ATmega644PA__",       0, 0x0100, "m644pa" },
112
+  { "atmega645a",           ARCH_AVR5, "__AVR_ATmega645A__",        0, 0x0100, "m645a" },
113
+  { "atmega645p",           ARCH_AVR5, "__AVR_ATmega645P__",        0, 0x0100, "m645p" },
114
   { "atmega645",            ARCH_AVR5, "__AVR_ATmega645__",         0, 0x0100, "m645" },
115
   { "atmega6450",           ARCH_AVR5, "__AVR_ATmega6450__",        0, 0x0100, "m6450" },
116
+  { "atmega6450a",          ARCH_AVR5, "__AVR_ATmega6450A__",       0, 0x0100, "m6450a" },
117
+  { "atmega6450p",          ARCH_AVR5, "__AVR_ATmega6450P__",       0, 0x0100, "m6450p" },
118
   { "atmega649",            ARCH_AVR5, "__AVR_ATmega649__",         0, 0x0100, "m649" },
119
+  { "atmega649a",           ARCH_AVR5, "__AVR_ATmega649A__",        0, 0x0100, "m649a" },
120
+  { "atmega649p",           ARCH_AVR5, "__AVR_ATmega649P__",        0, 0x0100, "m649p" },
121
   { "atmega6490",           ARCH_AVR5, "__AVR_ATmega6490__",        0, 0x0100, "m6490" },
122
-  { "atmega16hva",          ARCH_AVR5, "__AVR_ATmega16HVA__",       0, 0x0100, "m16hva" },
123
-  { "atmega16hvb",          ARCH_AVR5, "__AVR_ATmega16HVB__",       0, 0x0100, "m16hvb" },
124
-  { "atmega32hvb",          ARCH_AVR5, "__AVR_ATmega32HVB__",       0, 0x0100, "m23hvb" },
125
+  { "atmega6490a",          ARCH_AVR5, "__AVR_ATmega6490A__",       0, 0x0100, "m6490a" },
126
+  { "atmega6490p",          ARCH_AVR5, "__AVR_ATmega6490P__",       0, 0x0100, "m6490p" },
127
+  { "atmega64c1",           ARCH_AVR5, "__AVR_ATmega64C1__",        0, 0x0100, "m64c1" },
128
+  { "atmega64m1",           ARCH_AVR5, "__AVR_ATmega64M1__",        0, 0x0100, "m64m1" },
129
+  { "atmega64hve",          ARCH_AVR5, "__AVR_ATmega64HVE__",       0, 0x0100, "m64hve" },
130
+  { "atmega32hvb",          ARCH_AVR5, "__AVR_ATmega32HVB__",       0, 0x0100, "m32hvb" },
131
+  { "atmega32hvbrevb",      ARCH_AVR5, "__AVR_ATmega32HVBREVB__",   1, 0x0100, "m32hvbrevb" },
132
   { "at90can32",            ARCH_AVR5, "__AVR_AT90CAN32__",         0, 0x0100, "can32" },
133
   { "at90can64",            ARCH_AVR5, "__AVR_AT90CAN64__",         0, 0x0100, "can64" },
134
   { "at90pwm216",           ARCH_AVR5, "__AVR_AT90PWM216__",        0, 0x0100, "90pwm216" },
135
@@ -180,6 +223,7 @@ const struct mcu_type_s avr_mcu_types[] 
136
   { "at90usb646",           ARCH_AVR5, "__AVR_AT90USB646__",        0, 0x0100, "usb646" },
137
   { "at90usb647",           ARCH_AVR5, "__AVR_AT90USB647__",        0, 0x0100, "usb647" },
138
   { "at94k",                ARCH_AVR5, "__AVR_AT94K__",             0, 0x0060, "at94k" },
139
+  { "m3000",                ARCH_AVR5, "__AVR_M3000__",             0, 0x1000, "m3000" },
140
     /* Enhanced, == 128K.  */
141
   { "avr51",                ARCH_AVR51, NULL,                       0, 0x0100, "m128" },
142
   { "atmega128",            ARCH_AVR51, "__AVR_ATmega128__",        0, 0x0100, "m128" },
143
@@ -190,9 +234,6 @@ const struct mcu_type_s avr_mcu_types[] 
144
   { "at90can128",           ARCH_AVR51, "__AVR_AT90CAN128__",       0, 0x0100, "can128" },
145
   { "at90usb1286",          ARCH_AVR51, "__AVR_AT90USB1286__",      0, 0x0100, "usb1286" },
146
   { "at90usb1287",          ARCH_AVR51, "__AVR_AT90USB1287__",      0, 0x0100, "usb1286" },
147
-  { "m3000f",               ARCH_AVR51, "__AVR_M3000F__",           0, 0x1000, "m3000f" },
148
-  { "m3000s",               ARCH_AVR51, "__AVR_M3000S__",           0, 0x1000, "m3000f" },
149
-  { "m3001b",               ARCH_AVR51, "__AVR_M3001B__",           0, 0x1000, "m3000f" },
150
     /* 3-Byte PC.  */
151
   { "avr6",                 ARCH_AVR6, NULL,                        0, 0x0200, "m2561" },
152
   { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200, "m2561" },
153
@@ -220,11 +261,13 @@ const struct mcu_type_s avr_mcu_types[] 
154
     /* Xmega, > 128K, <= 256K FLASH, <= 64K RAM.  */
155
   { "avrxmega6",    ARCH_AVRXMEGA6, NULL,                           0, 0x2000, "x128a3" },
156
   { "atxmega128a3", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3__",         0, 0x2000, "x128a3" },
157
+  { "atxmega128b1", ARCH_AVRXMEGA6, "__AVR_ATxmega128B1__",         0, 0x2000, "x128b1" },
158
   { "atxmega128d3", ARCH_AVRXMEGA6, "__AVR_ATxmega128D3__",         0, 0x2000, "x128d3" },
159
   { "atxmega192a3", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3__",         0, 0x2000, "x192a3" },
160
   { "atxmega192d3", ARCH_AVRXMEGA6, "__AVR_ATxmega192D3__",         0, 0x2000, "x192d3" },
161
   { "atxmega256a3", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3__",         0, 0x2000, "x256a3" },
162
   { "atxmega256a3b",ARCH_AVRXMEGA6, "__AVR_ATxmega256A3B__",        0, 0x2000, "x256a3b" },
163
+  { "atxmega256a3bu", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3BU__",     0, 0x2000, "x256a3bu" },
164
   { "atxmega256d3", ARCH_AVRXMEGA6, "__AVR_ATxmega256D3__",         0, 0x2000, "x256d3" },
165
     /* Xmega, > 128K, <= 256K FLASH, > 64K RAM.  */
166
   { "avrxmega7",    ARCH_AVRXMEGA7, NULL,                           0, 0x2000, "x128a1" },
167
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
168
--- gcc/config/avr/t-avr	2011-02-07 14:19:27.000000000 -0600
169
+++ gcc/config/avr/t-avr	2011-02-07 14:23:58.000000000 -0600
170
@@ -116,16 +116,28 @@ MULTILIB_MATCHES = \
171
 	mmcu?avr25=mmcu?attiny13 \
172
 	mmcu?avr25=mmcu?attiny13a \
173
 	mmcu?avr25=mmcu?attiny2313 \
174
+	mmcu?avr25=mmcu?attiny2313a \
175
 	mmcu?avr25=mmcu?attiny24 \
176
+	mmcu?avr25=mmcu?attiny24a \
177
 	mmcu?avr25=mmcu?attiny44 \
178
+	mmcu?avr25=mmcu?attiny44a \
179
+	mmcu?avr25=mmcu?attiny45 \
180
 	mmcu?avr25=mmcu?attiny84 \
181
+	mmcu?avr25=mmcu?attiny84a \
182
 	mmcu?avr25=mmcu?attiny25 \
183
 	mmcu?avr25=mmcu?attiny45 \
184
 	mmcu?avr25=mmcu?attiny85 \
185
 	mmcu?avr25=mmcu?attiny261 \
186
+	mmcu?avr25=mmcu?attiny261a \
187
+	mmcu?avr25=mmcu?attiny4313 \
188
 	mmcu?avr25=mmcu?attiny461 \
189
+	mmcu?avr25=mmcu?attiny461a \
190
 	mmcu?avr25=mmcu?attiny861 \
191
 	mmcu?avr25=mmcu?attiny43u \
192
+	mmcu?avr25=mmcu?attiny84 \
193
+	mmcu?avr25=mmcu?attiny85 \
194
+	mmcu?avr25=mmcu?attiny861 \
195
+	mmcu?avr25=mmcu?attiny861a \
196
 	mmcu?avr25=mmcu?attiny87 \
197
 	mmcu?avr25=mmcu?attiny48 \
198
 	mmcu?avr25=mmcu?attiny88 \
199
@@ -140,65 +152,90 @@ MULTILIB_MATCHES = \
200
 	mmcu?avr35=mmcu?atmega16u2 \
201
 	mmcu?avr35=mmcu?atmega32u2 \
202
 	mmcu?avr35=mmcu?attiny167 \
203
-	mmcu?avr35=mmcu?attiny327 \
204
 	mmcu?avr4=mmcu?atmega48 \
205
+	mmcu?avr4=mmcu?atmega48a \
206
 	mmcu?avr4=mmcu?atmega48p \
207
 	mmcu?avr4=mmcu?atmega8 \
208
 	mmcu?avr4=mmcu?atmega8515 \
209
 	mmcu?avr4=mmcu?atmega8535 \
210
 	mmcu?avr4=mmcu?atmega88 \
211
+	mmcu?avr4=mmcu?atmega88a \
212
 	mmcu?avr4=mmcu?atmega88p \
213
+	mmcu?avr4=mmcu?atmega88pa \
214
 	mmcu?avr4=mmcu?atmega8hva \
215
-	mmcu?avr4=mmcu?atmega4hvd \
216
-	mmcu?avr4=mmcu?atmega8hvd \
217
-	mmcu?avr4=mmcu?atmega8c1 \
218
-	mmcu?avr4=mmcu?atmega8m1 \
219
 	mmcu?avr4=mmcu?at90pwm1 \
220
 	mmcu?avr4=mmcu?at90pwm2 \
221
 	mmcu?avr4=mmcu?at90pwm2b \
222
 	mmcu?avr4=mmcu?at90pwm3 \
223
 	mmcu?avr4=mmcu?at90pwm3b \
224
 	mmcu?avr4=mmcu?at90pwm81 \
225
+	mmcu?avr5=mmcu?at90pwm161 \
226
 	mmcu?avr5=mmcu?atmega16 \
227
+	mmcu?avr5=mmcu?atmega16a \
228
 	mmcu?avr5=mmcu?atmega161 \
229
 	mmcu?avr5=mmcu?atmega162 \
230
 	mmcu?avr5=mmcu?atmega163 \
231
+	mmcu?avr5=mmcu?atmega164a \
232
 	mmcu?avr5=mmcu?atmega164p \
233
 	mmcu?avr5=mmcu?atmega165 \
234
+	mmcu?avr5=mmcu?atmega165a \
235
 	mmcu?avr5=mmcu?atmega165p \
236
 	mmcu?avr5=mmcu?atmega168 \
237
+	mmcu?avr5=mmcu?atmega168a \
238
 	mmcu?avr5=mmcu?atmega168p \
239
 	mmcu?avr5=mmcu?atmega169 \
240
+	mmcu?avr5=mmcu?atmega169a \
241
 	mmcu?avr5=mmcu?atmega169p \
242
+	mmcu?avr5=mmcu?atmega169pa \
243
 	mmcu?avr5=mmcu?atmega32 \
244
 	mmcu?avr5=mmcu?atmega323 \
245
+	mmcu?avr5=mmcu?atmega324a \
246
 	mmcu?avr5=mmcu?atmega324p \
247
+	mmcu?avr5=mmcu?atmega324pa \
248
 	mmcu?avr5=mmcu?atmega325 \
249
+	mmcu?avr5=mmcu?atmega325a \
250
 	mmcu?avr5=mmcu?atmega325p \
251
 	mmcu?avr5=mmcu?atmega3250 \
252
+	mmcu?avr5=mmcu?atmega3250a \
253
 	mmcu?avr5=mmcu?atmega3250p \
254
+	mmcu?avr5=mmcu?atmega328 \
255
 	mmcu?avr5=mmcu?atmega328p \
256
 	mmcu?avr5=mmcu?atmega329 \
257
+	mmcu?avr5=mmcu?atmega329a \
258
 	mmcu?avr5=mmcu?atmega329p \
259
+	mmcu?avr5=mmcu?atmega329pa \
260
 	mmcu?avr5=mmcu?atmega3290 \
261
+	mmcu?avr5=mmcu?atmega3290a \
262
 	mmcu?avr5=mmcu?atmega3290p \
263
 	mmcu?avr5=mmcu?atmega406 \
264
 	mmcu?avr5=mmcu?atmega64  \
265
 	mmcu?avr5=mmcu?atmega640 \
266
 	mmcu?avr5=mmcu?atmega644 \
267
+	mmcu?avr5=mmcu?atmega644a \
268
 	mmcu?avr5=mmcu?atmega644p \
269
+	mmcu?avr5=mmcu?atmega644pa \
270
 	mmcu?avr5=mmcu?atmega645 \
271
+	mmcu?avr5=mmcu?atmega645a \
272
+	mmcu?avr5=mmcu?atmega645p \
273
 	mmcu?avr5=mmcu?atmega6450 \
274
+	mmcu?avr5=mmcu?atmega6450a \
275
+	mmcu?avr5=mmcu?atmega6450p \
276
 	mmcu?avr5=mmcu?atmega649 \
277
+	mmcu?avr5=mmcu?atmega649a \
278
+	mmcu?avr5=mmcu?atmega649p \
279
 	mmcu?avr5=mmcu?atmega6490 \
280
+	mmcu?avr5=mmcu?atmega6490a \
281
+	mmcu?avr5=mmcu?atmega6490p \
282
 	mmcu?avr5=mmcu?atmega16hva \
283
+	mmcu?avr5=mmcu?atmega16hva2 \
284
 	mmcu?avr5=mmcu?atmega16hvb \
285
+	mmcu?avr5=mmcu?atmega16hvbrevb \
286
 	mmcu?avr5=mmcu?atmega32hvb \
287
+	mmcu?avr5=mmcu?atmega32hvbrevb \
288
 	mmcu?avr5=mmcu?at90can32 \
289
 	mmcu?avr5=mmcu?at90can64 \
290
 	mmcu?avr5=mmcu?at90pwm216 \
291
 	mmcu?avr5=mmcu?at90pwm316 \
292
-	mmcu?avr5=mmcu?atmega16c1 \
293
 	mmcu?avr5=mmcu?atmega32c1 \
294
 	mmcu?avr5=mmcu?atmega64c1 \
295
 	mmcu?avr5=mmcu?atmega16m1 \
296
@@ -207,6 +244,7 @@ MULTILIB_MATCHES = \
297
 	mmcu?avr5=mmcu?atmega16u4 \
298
 	mmcu?avr5=mmcu?atmega32u4 \
299
 	mmcu?avr5=mmcu?atmega32u6 \
300
+	mmcu?avr5=mmcu?atmega64hve \
301
 	mmcu?avr5=mmcu?at90scr100 \
302
 	mmcu?avr5=mmcu?at90usb646 \
303
 	mmcu?avr5=mmcu?at90usb647 \
304
@@ -219,9 +257,7 @@ MULTILIB_MATCHES = \
305
 	mmcu?avr51=mmcu?at90can128 \
306
 	mmcu?avr51=mmcu?at90usb1286 \
307
 	mmcu?avr51=mmcu?at90usb1287 \
308
-	mmcu?avr51=mmcu?m3000f \
309
-	mmcu?avr51=mmcu?m3000s \
310
-	mmcu?avr51=mmcu?m3001b \
311
+	mmcu?avr51=mmcu?m3000 \
312
  	mmcu?avr6=mmcu?atmega2560 \
313
 	mmcu?avr6=mmcu?atmega2561 \
314
 	mmcu?avrxmega2=mmcu?atxmega16a4 \
315
@@ -235,11 +271,13 @@ MULTILIB_MATCHES = \
316
 	mmcu?avrxmega5=mmcu?atxmega64a1 \
317
 	mmcu?avrxmega5=mmcu?atxmega64a1u \
318
 	mmcu?avrxmega6=mmcu?atxmega128a3 \
319
+	mmcu?avrxmega6=mmcu?atxmega128b1 \
320
 	mmcu?avrxmega6=mmcu?atxmega128d3 \
321
 	mmcu?avrxmega6=mmcu?atxmega192a3 \
322
 	mmcu?avrxmega6=mmcu?atxmega192d3 \
323
 	mmcu?avrxmega6=mmcu?atxmega256a3 \
324
 	mmcu?avrxmega6=mmcu?atxmega256a3b \
325
+	mmcu?avrxmega6=mmcu?atxmega256a3bu \
326
 	mmcu?avrxmega6=mmcu?atxmega256d3 \
327
 	mmcu?avrxmega7=mmcu?atxmega128a1 \
328
 	mmcu?avrxmega7=mmcu?atxmega128a1u \
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-401-gcc-4.5.1-atmega32_5_50_90_pa (-46 lines)
Lines 1-46 Link Here
1
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-02-17 12:04:53.000000000 -0600
3
+++ gcc/config/avr/avr-devices.c	2011-02-16 15:14:00.000000000 -0600
4
@@ -166,9 +166,11 @@ const struct mcu_type_s avr_mcu_types[] 
5
   { "atmega325",            ARCH_AVR5, "__AVR_ATmega325__",         0, 0x0100, "m325" },
6
   { "atmega325a",           ARCH_AVR5, "__AVR_ATmega325A__",        0, 0x0100, "m325a" },
7
   { "atmega325p",           ARCH_AVR5, "__AVR_ATmega325P__",        0, 0x0100, "m325p" },
8
+  { "atmega325pa",          ARCH_AVR5, "__AVR_ATmega325PA__",       0, 0x0100, "m325pa" },
9
   { "atmega3250",           ARCH_AVR5, "__AVR_ATmega3250__",        0, 0x0100, "m3250" },
10
   { "atmega3250a",          ARCH_AVR5, "__AVR_ATmega3250A__",       0, 0x0100, "m3250a" },
11
   { "atmega3250p",          ARCH_AVR5, "__AVR_ATmega3250P__",       0, 0x0100, "m3250p" },
12
+  { "atmega3250pa",         ARCH_AVR5, "__AVR_ATmega3250PA__",      0, 0x0100, "m3250pa" },
13
   { "atmega328",            ARCH_AVR5, "__AVR_ATmega328__",         0, 0x0100, "m328" },
14
   { "atmega328p",           ARCH_AVR5, "__AVR_ATmega328P__",        0, 0x0100, "m328p" },
15
   { "atmega329",            ARCH_AVR5, "__AVR_ATmega329__",         0, 0x0100, "m329" },
16
@@ -178,6 +180,7 @@ const struct mcu_type_s avr_mcu_types[] 
17
   { "atmega3290",           ARCH_AVR5, "__AVR_ATmega3290__",        0, 0x0100, "m3290" },
18
   { "atmega3290a",          ARCH_AVR5, "__AVR_ATmega3290A__",       0, 0x0100, "m3290a" },
19
   { "atmega3290p",          ARCH_AVR5, "__AVR_ATmega3290P__",       0, 0x0100, "m3290p" },
20
+  { "atmega3290pa",         ARCH_AVR5, "__AVR_ATmega3290PA__",      0, 0x0100, "m3290pa" },
21
   { "atmega32c1",           ARCH_AVR5, "__AVR_ATmega32C1__",        0, 0x0100, "m32c1" },
22
   { "atmega32m1",           ARCH_AVR5, "__AVR_ATmega32M1__",        0, 0x0100, "m32m1" },
23
   { "atmega32u4",           ARCH_AVR5, "__AVR_ATmega32U4__",        0, 0x0100, "m32u4" },
24
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
25
--- gcc/config/avr/t-avr	2011-02-17 12:04:53.000000000 -0600
26
+++ gcc/config/avr/t-avr	2011-02-16 15:15:18.000000000 -0600
27
@@ -195,9 +195,11 @@ MULTILIB_MATCHES = \
28
 	mmcu?avr5=mmcu?atmega325 \
29
 	mmcu?avr5=mmcu?atmega325a \
30
 	mmcu?avr5=mmcu?atmega325p \
31
+	mmcu?avr5=mmcu?atmega325pa \
32
 	mmcu?avr5=mmcu?atmega3250 \
33
 	mmcu?avr5=mmcu?atmega3250a \
34
 	mmcu?avr5=mmcu?atmega3250p \
35
+	mmcu?avr5=mmcu?atmega3250pa \
36
 	mmcu?avr5=mmcu?atmega328 \
37
 	mmcu?avr5=mmcu?atmega328p \
38
 	mmcu?avr5=mmcu?atmega329 \
39
@@ -207,6 +209,7 @@ MULTILIB_MATCHES = \
40
 	mmcu?avr5=mmcu?atmega3290 \
41
 	mmcu?avr5=mmcu?atmega3290a \
42
 	mmcu?avr5=mmcu?atmega3290p \
43
+	mmcu?avr5=mmcu?atmega3290pa \
44
 	mmcu?avr5=mmcu?atmega406 \
45
 	mmcu?avr5=mmcu?atmega64  \
46
 	mmcu?avr5=mmcu?atmega640 \
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-402-gcc-4.5.1-attiny1634 (-22 lines)
Lines 1-22 Link Here
1
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-05-13 17:35:31.000000000 -0500
3
+++ gcc/config/avr/avr-devices.c	2011-05-13 17:43:10.000000000 -0500
4
@@ -113,6 +113,7 @@ const struct mcu_type_s avr_mcu_types[] 
5
   { "atmega16u2",           ARCH_AVR35, "__AVR_ATmega16U2__",       0, 0x0100, "m16u2" },
6
   { "atmega32u2",           ARCH_AVR35, "__AVR_ATmega32U2__",       0, 0x0100, "m32u2" },
7
   { "attiny167",            ARCH_AVR35, "__AVR_ATtiny167__",        0, 0x0100, "tn167" },
8
+  { "attiny1634",           ARCH_AVR35, "__AVR_ATtiny1634__",       0, 0x0100, "tn1634" },
9
     /* Enhanced, <= 8K.  */
10
   { "avr4",                 ARCH_AVR4, NULL,                        0, 0x0060, "m8" },
11
   { "atmega8",              ARCH_AVR4, "__AVR_ATmega8__",           0, 0x0060, "m8" },
12
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
13
--- gcc/config/avr/t-avr	2011-05-13 17:35:31.000000000 -0500
14
+++ gcc/config/avr/t-avr	2011-05-13 17:37:41.000000000 -0500
15
@@ -152,6 +152,7 @@ MULTILIB_MATCHES = \
16
 	mmcu?avr35=mmcu?atmega16u2 \
17
 	mmcu?avr35=mmcu?atmega32u2 \
18
 	mmcu?avr35=mmcu?attiny167 \
19
+	mmcu?avr35=mmcu?attiny1634 \
20
 	mmcu?avr4=mmcu?atmega48 \
21
 	mmcu?avr4=mmcu?atmega48a \
22
 	mmcu?avr4=mmcu?atmega48p \
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-403-gcc-4.5.1-atmega48pa (-22 lines)
Lines 1-22 Link Here
1
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-06-20 12:23:54.000000000 +0530
3
+++ gcc/config/avr/avr-devices.c	2011-06-20 12:11:26.000000000 +0530
4
@@ -119,6 +119,7 @@ const struct mcu_type_s avr_mcu_types[] 
5
   { "atmega8",              ARCH_AVR4, "__AVR_ATmega8__",           0, 0x0060, "m8" },
6
   { "atmega48",             ARCH_AVR4, "__AVR_ATmega48__",          0, 0x0100, "m48" },
7
   { "atmega48a",            ARCH_AVR4, "__AVR_ATmega48A__",         0, 0x0100, "m48a" },
8
+  { "atmega48pa",           ARCH_AVR4, "__AVR_ATmega48PA__",        0, 0x0100, "m48pa" },
9
   { "atmega48p",            ARCH_AVR4, "__AVR_ATmega48P__",         0, 0x0100, "m48p" },
10
   { "atmega88",             ARCH_AVR4, "__AVR_ATmega88__",          0, 0x0100, "m88" },
11
   { "atmega88a",            ARCH_AVR4, "__AVR_ATmega88A__",         0, 0x0100, "m88a" },
12
diff -Naurp gcc/config/avr/t-avr gcc/config/avr/t-avr
13
--- gcc/config/avr/t-avr	2011-06-20 12:23:54.000000000 +0530
14
+++ gcc/config/avr/t-avr	2011-06-20 12:11:26.000000000 +0530
15
@@ -155,6 +155,7 @@ MULTILIB_MATCHES = \
16
 	mmcu?avr35=mmcu?attiny1634 \
17
 	mmcu?avr4=mmcu?atmega48 \
18
 	mmcu?avr4=mmcu?atmega48a \
19
+	mmcu?avr4=mmcu?atmega48pa \
20
 	mmcu?avr4=mmcu?atmega48p \
21
 	mmcu?avr4=mmcu?atmega8 \
22
 	mmcu?avr4=mmcu?atmega8515 \
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-500-gcc-4.5.1-bug13473 (-14 lines)
Lines 1-14 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-06-09 14:30:33.000000000 -0500
3
+++ gcc/config/avr/avr.c	2011-06-09 15:33:10.000000000 -0500
4
@@ -3350,8 +3350,8 @@ out_movhi_mr_r (rtx insn, rtx op[], int 
5
 		    AS2 (out,%m0-%2,%A1));
6
 	}
7
       if (AVR_XMEGA)
8
-        return *l = 4, (AS2 (sts,%A0,%A1) CR_TAB
9
-			AS2 (sts,%B0,%B1));
10
+        return *l = 4, (AS2 (sts,%m0,%A1) CR_TAB
11
+			AS2 (sts,%m0+1,%B1));
12
       else
13
       return *l = 4, (AS2 (sts,%m0+1,%B1) CR_TAB
14
 		      AS2 (sts,%m0,%A1));
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-501-gcc-4.5.1-bug13579 (-17 lines)
Lines 1-17 Link Here
1
--- gcc/ipa-pure-const.c	2010-04-02 14:54:46.000000000 -0500
2
+++ gcc/ipa-pure-const.c	2011-02-24 16:10:26.000000000 -0600
3
@@ -416,6 +416,14 @@ check_stmt (gimple_stmt_iterator *gsip, 
4
       print_gimple_stmt (dump_file, stmt, 0, 0);
5
     }
6
 
7
+  if (gimple_has_volatile_ops (stmt))
8
+    {
9
+      local->pure_const_state = IPA_NEITHER;
10
+      if (dump_file)
11
+	fprintf (dump_file, "    Volatile stmt is not const/pure\n");
12
+    }
13
+
14
+
15
   /* Look for loads and stores.  */
16
   walk_stmt_load_store_ops (stmt, local, check_load, check_store);
17
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-502-gcc-4.5.1-bug-18145-v4 (-178 lines)
Lines 1-178 Link Here
1
diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2
--- gcc/config/avr/avr.c	2011-06-09 15:41:06.000000000 -0500
3
+++ gcc/config/avr/avr.c	2011-06-09 15:46:03.000000000 -0500
4
@@ -81,6 +81,12 @@ static rtx avr_function_value (const_tre
5
 static void avr_insert_attributes (tree, tree *);
6
 static void avr_asm_init_sections (void);
7
 static unsigned int avr_section_type_flags (tree, const char *, int);
8
+static void avr_asm_named_section (const char *name, unsigned int flags, tree decl);
9
+/* Track if code will use .bss and/or .data */
10
+static int avr_need_clear_bss_p = 0;
11
+static int avr_need_copy_data_p = 0;
12
+static void avr_output_data_section_asm_op (const void*);
13
+static void avr_output_bss_section_asm_op (const void*);
14
 
15
 static void avr_reorg (void);
16
 static void avr_asm_out_ctor (rtx, int);
17
@@ -6102,6 +6108,54 @@ avr_output_progmem_section_asm_op (const
18
   fprintf (asm_out_file, "\t.p2align 1\n");
19
 }
20
 
21
+/* ASM_OUTPUT_COMMON */
22
+/* Track need of __do_clear_bss */
23
+
24
+void
25
+avr_asm_output_common (FILE *stream, const char *name,
26
+                       unsigned HOST_WIDE_INT size,
27
+                       unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
28
+{
29
+    avr_need_clear_bss_p = 1;
30
+    fputs ("\t.comm ", stream);
31
+    assemble_name (stream, name);
32
+    fprintf (stream, ",%lu,1\n", (unsigned long) size);  
33
+}
34
+
35
+/* ASM_OUTPUT_LOCAL */
36
+/* Track need of __do_clear_bss */
37
+
38
+void
39
+avr_asm_output_local (FILE *stream, const char *name,
40
+                      unsigned HOST_WIDE_INT size,
41
+                      unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
42
+{                                                    
43
+    avr_need_clear_bss_p = 1;                           
44
+    fputs ("\t.lcomm ", stream);                      
45
+    assemble_name (stream, name);                   
46
+    fprintf (stream, ",%d\n", (int) size);           
47
+}
48
+
49
+/* Unnamed section callback to track need of __do_copy_data */
50
+
51
+static void
52
+avr_output_data_section_asm_op (const void *data)
53
+{
54
+    avr_need_copy_data_p = 1;
55
+    /* Dispatch to default */
56
+    output_section_asm_op (data);
57
+}
58
+
59
+/* Unnamed section callback to track need of __do_clear_bss */
60
+
61
+static void
62
+avr_output_bss_section_asm_op (const void *data)
63
+{
64
+    avr_need_clear_bss_p = 1;
65
+    /* Dispatch to default */
66
+    output_section_asm_op (data);
67
+}
68
+
69
 /* Implement TARGET_ASM_INIT_SECTIONS.  */
70
 
71
 static void
72
@@ -6111,6 +6165,27 @@ avr_asm_init_sections (void)
73
 					 avr_output_progmem_section_asm_op,
74
 					 NULL);
75
   readonly_data_section = data_section;
76
+
77
+  data_section->unnamed.callback = avr_output_data_section_asm_op;
78
+  bss_section->unnamed.callback = avr_output_bss_section_asm_op;
79
+}
80
+
81
+/* TARGET_ASM_NAMED_SECTION */
82
+/* Track need of __do_clear_bss, __do_copy_data for named sections */
83
+
84
+static void
85
+avr_asm_named_section (const char *name, unsigned int flags, tree decl)
86
+{
87
+    if (!avr_need_copy_data_p)
88
+        avr_need_copy_data_p =
89
+            (0 == strncmp (name, ".data", 5)
90
+             || 0 == strncmp (name, ".rodata", 7)
91
+             || 0 == strncmp (name, ".gnu.linkonce.", 14));
92
+    
93
+    if (!avr_need_clear_bss_p)
94
+        avr_need_clear_bss_p = (0 == strncmp (name, ".bss", 4));
95
+    
96
+    default_elf_asm_named_section (name, flags, decl);
97
 }
98
 
99
 static unsigned int
100
@@ -6152,12 +6227,6 @@ avr_file_start (void)
101
   AVR_TINY ? fputs ("__tmp_reg__ = 16\n" 
102
 		            "__zero_reg__ = 17\n", asm_out_file) : fputs ("__tmp_reg__ = 0\n" 
103
          "__zero_reg__ = 1\n", asm_out_file);
104
-
105
-  /* FIXME: output these only if there is anything in the .data / .bss
106
-     sections - some code size could be saved by not linking in the
107
-     initialization code from libgcc if one or both sections are empty.  */
108
-  fputs ("\t.global __do_copy_data\n", asm_out_file);
109
-  fputs ("\t.global __do_clear_bss\n", asm_out_file);
110
 }
111
 
112
 /* Outputs to the stdio stream FILE some
113
@@ -6166,6 +6235,16 @@ avr_file_start (void)
114
 static void
115
 avr_file_end (void)
116
 {
117
+    /* Output these only if there is anything in the
118
+       .data* / .rodata* / .gnu.linkonce.* resp. .bss*
119
+       input section(s) - some code size can be saved by not
120
+       linking in the initialization code from libgcc if resp.
121
+       sections are empty. */
122
+    if (avr_need_copy_data_p)
123
+        fputs (".global __do_copy_data\n", asm_out_file);
124
+    
125
+    if (avr_need_clear_bss_p)
126
+        fputs (".global __do_clear_bss\n", asm_out_file);
127
 }
128
 
129
 /* Choose the order in which to allocate hard registers for
130
diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
131
--- gcc/config/avr/avr.h	2011-06-09 14:30:33.000000000 -0500
132
+++ gcc/config/avr/avr.h	2011-06-09 15:46:03.000000000 -0500
133
@@ -562,7 +562,7 @@ do {									    \
134
 #define ASM_APP_OFF "/* #NOAPP */\n"
135
 
136
 /* Switch into a generic section.  */
137
-#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
138
+#define TARGET_ASM_NAMED_SECTION avr_asm_named_section
139
 #define TARGET_ASM_INIT_SECTIONS avr_asm_init_sections
140
 
141
 #define ASM_OUTPUT_ASCII(FILE, P, SIZE)	 gas_output_ascii (FILE,P,SIZE)
142
@@ -570,21 +570,13 @@ do {									    \
143
 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == '\n' || ((C) == '$'))
144
 
145
 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)			   \
146
-do {									   \
147
-     fputs ("\t.comm ", (STREAM));					   \
148
-     assemble_name ((STREAM), (NAME));					   \
149
-     fprintf ((STREAM), ",%lu,1\n", (unsigned long)(SIZE));		   \
150
-} while (0)
151
+        avr_asm_output_common (STREAM, NAME, SIZE, ROUNDED)
152
 
153
 #define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED)			\
154
   asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
155
 
156
 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED)			\
157
-do {									\
158
-     fputs ("\t.lcomm ", (STREAM));					\
159
-     assemble_name ((STREAM), (NAME));					\
160
-     fprintf ((STREAM), ",%d\n", (int)(SIZE));				\
161
-} while (0)
162
+        avr_asm_output_local (STREAM, NAME, SIZE, ROUNDED)
163
 
164
 #undef TYPE_ASM_OP
165
 #undef SIZE_ASM_OP
166
diff -Naurp gcc/config/avr/avr-protos.h gcc/config/avr/avr-protos.h
167
--- gcc/config/avr/avr-protos.h	2011-06-09 14:30:33.000000000 -0500
168
+++ gcc/config/avr/avr-protos.h	2011-06-09 15:46:03.000000000 -0500
169
@@ -35,6 +35,9 @@ extern int avr_simple_epilogue (void);
170
 extern void gas_output_limited_string (FILE *file, const char *str);
171
 extern void gas_output_ascii (FILE *file, const char *str, size_t length);
172
 extern int avr_hard_regno_rename_ok (unsigned int, unsigned int);
173
+extern void avr_asm_output_common (FILE *stream, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded);
174
+extern void avr_asm_output_local (FILE *stream, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded);
175
+  
176
 extern rtx avr_return_addr_rtx (int count, const_rtx tem);
177
 
178
 #ifdef TREE_CODE
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-503-gcc-4.5.1-avrtiny10-bug-12510 (-43 lines)
Lines 1-43 Link Here
1
diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
2
--- gcc/config/avr/avr.h	2011-06-09 15:53:13.000000000 -0500
3
+++ gcc/config/avr/avr.h	2011-06-09 15:55:45.000000000 -0500
4
@@ -136,7 +136,7 @@ extern GTY(()) section *progmem_section;
5
 #define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
6
 #define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
7
 
8
-#define AVR_IO_OFFSET (AVR_XMEGA ? 0 : 0x20)
9
+#define AVR_IO_OFFSET ((AVR_XMEGA || AVR_TINY) ? 0 : 0x20)
10
 #define AVR_RAMPD_ADDR (AVR_XMEGA ? 0x38 : 0)
11
 #define AVR_RAMPX_ADDR (AVR_XMEGA ? 0x39 : 0)
12
 #define AVR_RAMPY_ADDR (AVR_XMEGA ? 0x3A : 0)
13
diff -Naurp gcc/config/avr/predicates.md gcc/config/avr/predicates.md
14
--- gcc/config/avr/predicates.md	2011-06-09 14:30:33.000000000 -0500
15
+++ gcc/config/avr/predicates.md	2011-06-09 15:55:45.000000000 -0500
16
@@ -50,21 +50,24 @@
17
 ;; Return true if OP is a valid address for lower half of I/O space.
18
 (define_predicate "low_io_address_operand"
19
   (and (match_code "const_int")
20
-       (if_then_else (match_test "AVR_XMEGA") 
21
+       (if_then_else (ior (match_test "AVR_XMEGA")
22
+				          (match_test "AVR_TINY")) 
23
                      (match_test "IN_RANGE((INTVAL (op)), 0x00, 0x1F)")
24
 	             (match_test "IN_RANGE((INTVAL (op)), 0x20, 0x3F)"))))
25
 
26
 ;; Return true if OP is a valid address for high half of I/O space.
27
 (define_predicate "high_io_address_operand"
28
   (and (match_code "const_int")
29
-       (if_then_else (match_test "AVR_XMEGA") 
30
+       (if_then_else (ior (match_test "AVR_XMEGA")
31
+				          (match_test "AVR_TINY")) 
32
                      (match_test "IN_RANGE((INTVAL (op)), 0x20, 0x3F)")
33
 	             (match_test "IN_RANGE((INTVAL (op)), 0x40, 0x5F)"))))
34
 
35
 ;; Return true if OP is a valid address of I/O space.
36
 (define_predicate "io_address_operand"
37
   (and (match_code "const_int")
38
-       (if_then_else (match_test "AVR_XMEGA") 
39
+       (if_then_else (ior (match_test "AVR_XMEGA")
40
+				          (match_test "AVR_TINY")) 
41
        		(match_test "IN_RANGE((INTVAL (op)), 0x0, (0x40 - GET_MODE_SIZE(mode)))")
42
        		(match_test "IN_RANGE((INTVAL (op)), 0x20, (0x60 - GET_MODE_SIZE(mode)))"))))
43
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-504-gcc-4.5.1-bug12915 (-14 lines)
Lines 1-14 Link Here
1
diff -rupw  gcc/config/avr/avr.md  gcc/config/avr/avr.md
2
---  gcc/config/avr/avr.md	2011-02-23 15:54:14.000000000 -0600
3
+++  gcc/config/avr/avr.md	2011-02-23 15:55:22.000000000 -0600
4
@@ -1082,8 +1082,8 @@
5
    (set_attr "cc" "clobber")])
6
 
7
 (define_expand "<any_extend:u>mulhisi3"
8
-  [(set (reg:HI 18) (match_operand:SI 1 "register_operand" ""))
9
-   (set (reg:HI 20) (match_operand:SI 2 "register_operand" ""))
10
+  [(set (reg:HI 18) (match_operand:HI 1 "register_operand" ""))
11
+   (set (reg:HI 20) (match_operand:HI 2 "register_operand" ""))
12
    (set (reg:SI 22)
13
 	(mult:SI (any_extend:SI (reg:HI 18))
14
 		 (any_extend:SI (reg:HI 20))))
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-505-gcc-4.5.1-bug13932 (-12 lines)
Lines 1-12 Link Here
1
diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-06-09 15:23:57.000000000 -0500
3
+++ gcc/config/avr/avr-devices.c	2011-06-09 16:01:44.000000000 -0500
4
@@ -244,7 +244,7 @@ const struct mcu_type_s avr_mcu_types[] 
5
      /* Enhanced, ==256K + 3-Byte PC +
6
         { MOVW/LPMX, JMP/CALL, MUL, ELPM, ELPMX }.  */
7
   { "avr6",                 ARCH_AVR6, NULL,                        0, 0x0200, "m2561" },
8
-  { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200, "m2561" },
9
+  { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200, "m2560" },
10
   { "atmega2561",           ARCH_AVR6, "__AVR_ATmega2561__",        0, 0x0200, "m2561" },
11
     /* Enhanced, == 256K.  */
12
     /* Xmega, <= 8K FLASH.  */
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-506-gcc-4.5.1-bug13789 (-40 lines)
Lines 1-40 Link Here
1
diff -rup gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
2
--- gcc/config/avr/avr-devices.c	2011-04-27 12:24:24.000000000 -0500
3
+++ gcc/config/avr/avr-devices.c	2011-04-27 17:19:33.000000000 -0500
4
@@ -37,14 +37,14 @@ const struct base_arch_s avr_arch_types[
5
   { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=5",   "avr5" },
6
   { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, "__AVR_ARCH__=51",  "avr51" },
7
   { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, "__AVR_ARCH__=6",   "avr6" },
8
+  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, "__AVR_ARCH__=100",  "avrtiny10" },
9
   { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=101", "avrxmega1" },
10
   { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=102", "avrxmega2" },
11
   { 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0x2000, "__AVR_ARCH__=103", "avrxmega3" },
12
   { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, "__AVR_ARCH__=104", "avrxmega4" },
13
   { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, "__AVR_ARCH__=105", "avrxmega5" },
14
   { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, "__AVR_ARCH__=106", "avrxmega6" },  
15
-  { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, "__AVR_ARCH__=107", "avrxmega7" },
16
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, "__AVR_ARCH__=201", "avrtiny10" }
17
+  { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, "__AVR_ARCH__=107", "avrxmega7" }
18
 };
19
 
20
 /* List of all known AVR MCU types - if updated, it has to be kept
21
diff -rup gcc/config/avr/avr.h gcc/config/avr/avr.h
22
--- gcc/config/avr/avr.h	2011-04-27 12:24:06.000000000 -0500
23
+++ gcc/config/avr/avr.h	2011-04-27 17:49:01.000000000 -0500
24
@@ -79,14 +79,14 @@ enum avr_arch
25
   ARCH_AVR5,
26
   ARCH_AVR51,
27
   ARCH_AVR6,
28
+  ARCH_AVRTINY10,
29
   ARCH_AVRXMEGA1,
30
   ARCH_AVRXMEGA2,
31
   ARCH_AVRXMEGA3,
32
   ARCH_AVRXMEGA4,
33
   ARCH_AVRXMEGA5,
34
   ARCH_AVRXMEGA6,
35
-  ARCH_AVRXMEGA7,
36
-  ARCH_AVRTINY10
37
+  ARCH_AVRXMEGA7
38
 };
39
 
40
 struct mcu_type_s {
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-599-gcc-4.5.1-bug46779 (-102 lines)
Lines 1-102 Link Here
1
--- gcc/config/avr/avr.c.orig	2011-09-30 16:19:47.000000000 +0200
2
+++ gcc/config/avr/avr.c	2011-09-30 16:23:26.000000000 +0200
3
@@ -1155,8 +1155,7 @@
4
 		 true_regnum (XEXP (x, 0)));
5
       debug_rtx (x);
6
     }
7
-  if (!strict && GET_CODE (x) == SUBREG)
8
-	x = SUBREG_REG (x);
9
+  
10
   if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x)
11
                     : REG_OK_FOR_BASE_NOSTRICT_P (x)))
12
     r = POINTER_REGS;
13
@@ -7135,26 +7134,30 @@
14
 int
15
 avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
16
 {
17
-  /* Disallow QImode in stack pointer regs.  */
18
-  if ((regno == REG_SP || regno == (REG_SP + 1)) && mode == QImode)
19
-    return 0;
20
-
21
-  /* The only thing that can go into registers r28:r29 is a Pmode.  */
22
-  if (regno == REG_Y && mode == Pmode)
23
-    return 1;
24
-
25
-  /* Otherwise disallow all regno/mode combinations that span r28:r29.  */
26
-  if (regno <= (REG_Y + 1) && (regno + GET_MODE_SIZE (mode)) >= (REG_Y + 1))
27
-    return 0;
28
-
29
-  if (mode == QImode)
30
+  /* NOTE: 8-bit values must not be disallowed for R28 or R29.
31
+        Disallowing QI et al. in these regs might lead to code like
32
+            (set (subreg:QI (reg:HI 28) n) ...)
33
+        which will result in wrong code because reload does not
34
+        handle SUBREGs of hard regsisters like this.
35
+        This could be fixed in reload.  However, it appears
36
+        that fixing reload is not wanted by reload people.  */
37
+  
38
+  /* Any GENERAL_REGS register can hold 8-bit values.  */
39
+  
40
+  if (GET_MODE_SIZE (mode) == 1)
41
     return 1;
42
 
43
-  /* Modes larger than QImode occupy consecutive registers.  */
44
-  if (regno + GET_MODE_SIZE (mode) > FIRST_PSEUDO_REGISTER)
45
+  /* FIXME: Ideally, the following test is not needed.
46
+        However, it turned out that it can reduce the number
47
+        of spill fails.  AVR and it's poor endowment with
48
+        address registers is extreme stress test for reload.  */
49
+  
50
+  if (GET_MODE_SIZE (mode) >= 4
51
+      && regno >= REG_X)
52
     return 0;
53
 
54
-  /* All modes larger than QImode should start in an even register.  */
55
+  /* All modes larger than 8 bits should start in an even register.  */
56
+  
57
   return !(regno & 1);
58
 }
59
 
60
@@ -7281,13 +7284,23 @@
61
       && !df_regs_ever_live_p (regno))
62
     return false;
63
 
64
+  /* Don't allow hard registers that might be part of the frame pointer.
65
+     Some places in the compiler just test for [HARD_]FRAME_POINTER_REGNUM
66
+     and don't care for a frame pointer that spans more than one register.  */
67
+
68
+  if ((!reload_completed || frame_pointer_needed)
69
+      && (regno == REG_Y || regno == REG_Y + 1))
70
+    {
71
+      return false;
72
+    }
73
+
74
   return true;
75
 }
76
 
77
 /* Return nonzero if register OLD_REG can be renamed to register NEW_REG.  */
78
 
79
 int
80
-avr_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
81
+avr_hard_regno_rename_ok (unsigned int old_reg,
82
 			  unsigned int new_reg)
83
 {
84
   /* Interrupt functions can only use registers that have already been
85
@@ -7298,6 +7311,17 @@
86
       && !df_regs_ever_live_p (new_reg))
87
     return 0;
88
 
89
+  /* Don't allow hard registers that might be part of the frame pointer.
90
+     Some places in the compiler just test for [HARD_]FRAME_POINTER_REGNUM
91
+     and don't care for a frame pointer that spans more than one register.  */
92
+
93
+  if ((!reload_completed || frame_pointer_needed)
94
+      && (old_reg == REG_Y || old_reg == REG_Y + 1
95
+          || new_reg == REG_Y || new_reg == REG_Y + 1))
96
+    {
97
+      return 0;
98
+    }
99
+  
100
   return 1;
101
 }
102
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-Makefile.in (+188 lines)
Line 0 Link Here
1
--- Makefile.in.orig	2014-06-13 16:32:16.000000000 +0200
2
+++ Makefile.in	2014-08-08 20:04:46.000000000 +0200
3
@@ -173,7 +173,7 @@
4
 
5
 # This is the list of directories to built for the host system.
6
 SUBDIRS = @configdirs@
7
-TARGET_CONFIGDIRS = @target_configdirs@
8
+TARGET_CONFIGDIRS =  libgcc
9
 # This is set by the configure script to the arguments to use when configuring
10
 # directories built for the host system.
11
 HOST_CONFIGARGS = @host_configargs@
12
@@ -938,8 +938,6 @@
13
     maybe-configure-target-libgcc \
14
     maybe-configure-target-libbacktrace \
15
     maybe-configure-target-libquadmath \
16
-    maybe-configure-target-libgfortran \
17
-    maybe-configure-target-libobjc \
18
     maybe-configure-target-libgo \
19
     maybe-configure-target-libtermcap \
20
     maybe-configure-target-winsup \
21
@@ -1099,8 +1097,6 @@
22
 @endif target-libgcc-no-bootstrap
23
 all-target: maybe-all-target-libbacktrace
24
 all-target: maybe-all-target-libquadmath
25
-all-target: maybe-all-target-libgfortran
26
-all-target: maybe-all-target-libobjc
27
 all-target: maybe-all-target-libgo
28
 all-target: maybe-all-target-libtermcap
29
 all-target: maybe-all-target-winsup
30
@@ -1190,8 +1186,6 @@
31
 info-target: maybe-info-target-libgcc
32
 info-target: maybe-info-target-libbacktrace
33
 info-target: maybe-info-target-libquadmath
34
-info-target: maybe-info-target-libgfortran
35
-info-target: maybe-info-target-libobjc
36
 info-target: maybe-info-target-libgo
37
 info-target: maybe-info-target-libtermcap
38
 info-target: maybe-info-target-winsup
39
@@ -1274,8 +1268,6 @@
40
 dvi-target: maybe-dvi-target-libgcc
41
 dvi-target: maybe-dvi-target-libbacktrace
42
 dvi-target: maybe-dvi-target-libquadmath
43
-dvi-target: maybe-dvi-target-libgfortran
44
-dvi-target: maybe-dvi-target-libobjc
45
 dvi-target: maybe-dvi-target-libgo
46
 dvi-target: maybe-dvi-target-libtermcap
47
 dvi-target: maybe-dvi-target-winsup
48
@@ -1358,8 +1350,6 @@
49
 pdf-target: maybe-pdf-target-libgcc
50
 pdf-target: maybe-pdf-target-libbacktrace
51
 pdf-target: maybe-pdf-target-libquadmath
52
-pdf-target: maybe-pdf-target-libgfortran
53
-pdf-target: maybe-pdf-target-libobjc
54
 pdf-target: maybe-pdf-target-libgo
55
 pdf-target: maybe-pdf-target-libtermcap
56
 pdf-target: maybe-pdf-target-winsup
57
@@ -1442,8 +1432,6 @@
58
 html-target: maybe-html-target-libgcc
59
 html-target: maybe-html-target-libbacktrace
60
 html-target: maybe-html-target-libquadmath
61
-html-target: maybe-html-target-libgfortran
62
-html-target: maybe-html-target-libobjc
63
 html-target: maybe-html-target-libgo
64
 html-target: maybe-html-target-libtermcap
65
 html-target: maybe-html-target-winsup
66
@@ -1526,8 +1514,6 @@
67
 TAGS-target: maybe-TAGS-target-libgcc
68
 TAGS-target: maybe-TAGS-target-libbacktrace
69
 TAGS-target: maybe-TAGS-target-libquadmath
70
-TAGS-target: maybe-TAGS-target-libgfortran
71
-TAGS-target: maybe-TAGS-target-libobjc
72
 TAGS-target: maybe-TAGS-target-libgo
73
 TAGS-target: maybe-TAGS-target-libtermcap
74
 TAGS-target: maybe-TAGS-target-winsup
75
@@ -1610,8 +1596,6 @@
76
 install-info-target: maybe-install-info-target-libgcc
77
 install-info-target: maybe-install-info-target-libbacktrace
78
 install-info-target: maybe-install-info-target-libquadmath
79
-install-info-target: maybe-install-info-target-libgfortran
80
-install-info-target: maybe-install-info-target-libobjc
81
 install-info-target: maybe-install-info-target-libgo
82
 install-info-target: maybe-install-info-target-libtermcap
83
 install-info-target: maybe-install-info-target-winsup
84
@@ -1694,8 +1678,6 @@
85
 install-pdf-target: maybe-install-pdf-target-libgcc
86
 install-pdf-target: maybe-install-pdf-target-libbacktrace
87
 install-pdf-target: maybe-install-pdf-target-libquadmath
88
-install-pdf-target: maybe-install-pdf-target-libgfortran
89
-install-pdf-target: maybe-install-pdf-target-libobjc
90
 install-pdf-target: maybe-install-pdf-target-libgo
91
 install-pdf-target: maybe-install-pdf-target-libtermcap
92
 install-pdf-target: maybe-install-pdf-target-winsup
93
@@ -1778,8 +1760,6 @@
94
 install-html-target: maybe-install-html-target-libgcc
95
 install-html-target: maybe-install-html-target-libbacktrace
96
 install-html-target: maybe-install-html-target-libquadmath
97
-install-html-target: maybe-install-html-target-libgfortran
98
-install-html-target: maybe-install-html-target-libobjc
99
 install-html-target: maybe-install-html-target-libgo
100
 install-html-target: maybe-install-html-target-libtermcap
101
 install-html-target: maybe-install-html-target-winsup
102
@@ -1862,8 +1842,6 @@
103
 installcheck-target: maybe-installcheck-target-libgcc
104
 installcheck-target: maybe-installcheck-target-libbacktrace
105
 installcheck-target: maybe-installcheck-target-libquadmath
106
-installcheck-target: maybe-installcheck-target-libgfortran
107
-installcheck-target: maybe-installcheck-target-libobjc
108
 installcheck-target: maybe-installcheck-target-libgo
109
 installcheck-target: maybe-installcheck-target-libtermcap
110
 installcheck-target: maybe-installcheck-target-winsup
111
@@ -1946,8 +1924,6 @@
112
 mostlyclean-target: maybe-mostlyclean-target-libgcc
113
 mostlyclean-target: maybe-mostlyclean-target-libbacktrace
114
 mostlyclean-target: maybe-mostlyclean-target-libquadmath
115
-mostlyclean-target: maybe-mostlyclean-target-libgfortran
116
-mostlyclean-target: maybe-mostlyclean-target-libobjc
117
 mostlyclean-target: maybe-mostlyclean-target-libgo
118
 mostlyclean-target: maybe-mostlyclean-target-libtermcap
119
 mostlyclean-target: maybe-mostlyclean-target-winsup
120
@@ -2030,8 +2006,6 @@
121
 clean-target: maybe-clean-target-libgcc
122
 clean-target: maybe-clean-target-libbacktrace
123
 clean-target: maybe-clean-target-libquadmath
124
-clean-target: maybe-clean-target-libgfortran
125
-clean-target: maybe-clean-target-libobjc
126
 clean-target: maybe-clean-target-libgo
127
 clean-target: maybe-clean-target-libtermcap
128
 clean-target: maybe-clean-target-winsup
129
@@ -2114,8 +2088,6 @@
130
 distclean-target: maybe-distclean-target-libgcc
131
 distclean-target: maybe-distclean-target-libbacktrace
132
 distclean-target: maybe-distclean-target-libquadmath
133
-distclean-target: maybe-distclean-target-libgfortran
134
-distclean-target: maybe-distclean-target-libobjc
135
 distclean-target: maybe-distclean-target-libgo
136
 distclean-target: maybe-distclean-target-libtermcap
137
 distclean-target: maybe-distclean-target-winsup
138
@@ -2198,8 +2170,6 @@
139
 maintainer-clean-target: maybe-maintainer-clean-target-libgcc
140
 maintainer-clean-target: maybe-maintainer-clean-target-libbacktrace
141
 maintainer-clean-target: maybe-maintainer-clean-target-libquadmath
142
-maintainer-clean-target: maybe-maintainer-clean-target-libgfortran
143
-maintainer-clean-target: maybe-maintainer-clean-target-libobjc
144
 maintainer-clean-target: maybe-maintainer-clean-target-libgo
145
 maintainer-clean-target: maybe-maintainer-clean-target-libtermcap
146
 maintainer-clean-target: maybe-maintainer-clean-target-winsup
147
@@ -2337,8 +2307,6 @@
148
     maybe-check-target-libgcc \
149
     maybe-check-target-libbacktrace \
150
     maybe-check-target-libquadmath \
151
-    maybe-check-target-libgfortran \
152
-    maybe-check-target-libobjc \
153
     maybe-check-target-libgo \
154
     maybe-check-target-libtermcap \
155
     maybe-check-target-winsup \
156
@@ -2495,8 +2463,6 @@
157
     maybe-install-target-libgcc \
158
     maybe-install-target-libbacktrace \
159
     maybe-install-target-libquadmath \
160
-    maybe-install-target-libgfortran \
161
-    maybe-install-target-libobjc \
162
     maybe-install-target-libgo \
163
     maybe-install-target-libtermcap \
164
     maybe-install-target-winsup \
165
@@ -2599,8 +2565,6 @@
166
     maybe-install-strip-target-libgcc \
167
     maybe-install-strip-target-libbacktrace \
168
     maybe-install-strip-target-libquadmath \
169
-    maybe-install-strip-target-libgfortran \
170
-    maybe-install-strip-target-libobjc \
171
     maybe-install-strip-target-libgo \
172
     maybe-install-strip-target-libtermcap \
173
     maybe-install-strip-target-winsup \
174
@@ -36809,6 +36773,14 @@
175
 TARGET-target-libgcc=all
176
 maybe-all-target-libgcc: all-target-libgcc
177
 all-target-libgcc: configure-target-libgcc
178
+	cp ${HOST_SUBDIR}/gcc/libgcc.mvars gcc/
179
+	cp ${HOST_SUBDIR}/gcc/tconfig.h libgcc/
180
+	cp ${HOST_SUBDIR}/gcc/auto-host.h libgcc/
181
+	cp ${HOST_SUBDIR}/gcc/tm.h libgcc/
182
+	cp ${HOST_SUBDIR}/gcc/options.h libgcc/
183
+	cp ${HOST_SUBDIR}/gcc/insn-constants.h libgcc/
184
+	cp ${HOST_SUBDIR}/gcc/insn-modes.h libgcc/
185
+	cp ${HOST_SUBDIR}/gcc/gcov-iov.h libgcc/
186
 	@r=`${PWD_COMMAND}`; export r; \
187
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
188
 	$(NORMAL_TARGET_EXPORTS)  \
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-gcc-config-avr-driver-avr.c (-38 lines)
Lines 1-38 Link Here
1
--- gcc/config/avr/driver-avr.c.orig	2013-03-14 16:26:36.000000000 +0100
2
+++ gcc/config/avr/driver-avr.c	2013-03-14 16:28:52.000000000 +0100
3
@@ -55,7 +55,7 @@
4
 avr_device_to_arch (int argc, const char **argv)
5
 {
6
   if (0 == argc)
7
-    return;
8
+    return NULL;
9
 
10
   avr_set_current_device (argv[0]);
11
 
12
@@ -71,7 +71,7 @@
13
   char data_section_start_str[16];
14
 
15
   if (0 == argc)
16
-    return;  
17
+    return NULL;  
18
 
19
   avr_set_current_device (argv[0]);
20
   
21
@@ -93,7 +93,7 @@
22
 avr_device_to_startfiles (int argc, const char **argv)
23
 {
24
   if (0 == argc)
25
-    return;
26
+    return NULL;
27
 
28
   avr_set_current_device (argv[0]);
29
 
30
@@ -106,7 +106,7 @@
31
 avr_device_to_devicelib (int argc, const char **argv)
32
 {
33
   if (0 == argc)
34
-    return;
35
+    return NULL;
36
 
37
   avr_set_current_device (argv[0]);
38
 
(-)/usr/home/pi/myp/devel/avr-gcc/files/patch-plugins (-18 lines)
Lines 1-18 Link Here
1
--- gcc/configure.orig
2
+++ gcc/configure
3
@@ -25460,13 +25460,13 @@
4
 $as_echo_n "checking for exported symbols... " >&6; }
5
   echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
6
   ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1
7
-  if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
8
+  if $ac_cv_prog_OBJDUMP -T conftest | grep foobar > /dev/null; then
9
     : # No need to use a flag
10
   else
11
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -rdynamic" >&5
12
 $as_echo_n "checking for -rdynamic... " >&6; }
13
     ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1
14
-    if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
15
+    if $ac_cv_prog_OBJDUMP -T conftest | grep foobar > /dev/null; then
16
       plugin_rdynamic=yes
17
       pluginlibs="-rdynamic"
18
     else
(-)/usr/home/pi/myp/devel/avr-gcc/pkg-plist (-213 / +322 lines)
Lines 1-190 Link Here
1
avr/bin/c++
2
avr/bin/g++
3
avr/bin/gcc
4
bin/avr-c++
1
bin/avr-c++
5
bin/avr-cpp
2
bin/avr-cpp
6
bin/avr-g++
3
bin/avr-g++
7
bin/avr-gcc
4
bin/avr-gcc
8
bin/avr-gcc-4.5.1
5
bin/avr-gcc-4.10.0
9
bin/avr-gccbug
6
bin/avr-gcc-ar
10
lib/gcc/avr/4.5.1/avr25/libgcc.a
7
bin/avr-gcc-nm
11
lib/gcc/avr/4.5.1/avr25/libgcov.a
8
bin/avr-gcc-ranlib
12
lib/gcc/avr/4.5.1/avr3/libgcc.a
9
lib/gcc/avr/4.10.0/avr25/libgcc.a
13
lib/gcc/avr/4.5.1/avr3/libgcov.a
10
lib/gcc/avr/4.10.0/avr25/libgcov.a
14
lib/gcc/avr/4.5.1/avr31/libgcc.a
11
lib/gcc/avr/4.10.0/avr25/tiny-stack/libgcc.a
15
lib/gcc/avr/4.5.1/avr31/libgcov.a
12
lib/gcc/avr/4.10.0/avr25/tiny-stack/libgcov.a
16
lib/gcc/avr/4.5.1/avr35/libgcc.a
13
lib/gcc/avr/4.10.0/avr3/libgcc.a
17
lib/gcc/avr/4.5.1/avr35/libgcov.a
14
lib/gcc/avr/4.10.0/avr3/libgcov.a
18
lib/gcc/avr/4.5.1/avr4/libgcc.a
15
lib/gcc/avr/4.10.0/avr31/libgcc.a
19
lib/gcc/avr/4.5.1/avr4/libgcov.a
16
lib/gcc/avr/4.10.0/avr31/libgcov.a
20
lib/gcc/avr/4.5.1/avr5/libgcc.a
17
lib/gcc/avr/4.10.0/avr35/libgcc.a
21
lib/gcc/avr/4.5.1/avr5/libgcov.a
18
lib/gcc/avr/4.10.0/avr35/libgcov.a
22
lib/gcc/avr/4.5.1/avr51/libgcc.a
19
lib/gcc/avr/4.10.0/avr4/libgcc.a
23
lib/gcc/avr/4.5.1/avr51/libgcov.a
20
lib/gcc/avr/4.10.0/avr4/libgcov.a
24
lib/gcc/avr/4.5.1/avr6/libgcc.a
21
lib/gcc/avr/4.10.0/avr5/libgcc.a
25
lib/gcc/avr/4.5.1/avr6/libgcov.a
22
lib/gcc/avr/4.10.0/avr5/libgcov.a
26
lib/gcc/avr/4.5.1/avrxmega2/libgcc.a
23
lib/gcc/avr/4.10.0/avr51/libgcc.a
27
lib/gcc/avr/4.5.1/avrxmega2/libgcov.a
24
lib/gcc/avr/4.10.0/avr51/libgcov.a
28
lib/gcc/avr/4.5.1/avrxmega4/libgcc.a
25
lib/gcc/avr/4.10.0/avr6/libgcc.a
29
lib/gcc/avr/4.5.1/avrxmega4/libgcov.a
26
lib/gcc/avr/4.10.0/avr6/libgcov.a
30
lib/gcc/avr/4.5.1/avrxmega5/libgcc.a
27
lib/gcc/avr/4.10.0/avrxmega2/libgcc.a
31
lib/gcc/avr/4.5.1/avrxmega5/libgcov.a
28
lib/gcc/avr/4.10.0/avrxmega2/libgcov.a
32
lib/gcc/avr/4.5.1/avrxmega6/libgcc.a
29
lib/gcc/avr/4.10.0/avrxmega4/libgcc.a
33
lib/gcc/avr/4.5.1/avrxmega6/libgcov.a
30
lib/gcc/avr/4.10.0/avrxmega4/libgcov.a
34
lib/gcc/avr/4.5.1/avrxmega7/libgcc.a
31
lib/gcc/avr/4.10.0/avrxmega5/libgcc.a
35
lib/gcc/avr/4.5.1/avrxmega7/libgcov.a
32
lib/gcc/avr/4.10.0/avrxmega5/libgcov.a
36
lib/gcc/avr/4.5.1/avrtiny10/libgcc.a
33
lib/gcc/avr/4.10.0/avrxmega6/libgcc.a
37
lib/gcc/avr/4.5.1/avrtiny10/libgcov.a
34
lib/gcc/avr/4.10.0/avrxmega6/libgcov.a
38
lib/gcc/avr/4.5.1/include-fixed/README
35
lib/gcc/avr/4.10.0/avrxmega7/libgcc.a
39
lib/gcc/avr/4.5.1/include-fixed/limits.h
36
lib/gcc/avr/4.10.0/avrxmega7/libgcov.a
40
lib/gcc/avr/4.5.1/include-fixed/syslimits.h
37
lib/gcc/avr/4.10.0/include-fixed/README
41
lib/gcc/avr/4.5.1/include/float.h
38
lib/gcc/avr/4.10.0/include-fixed/limits.h
42
lib/gcc/avr/4.5.1/include/iso646.h
39
lib/gcc/avr/4.10.0/include-fixed/syslimits.h
43
lib/gcc/avr/4.5.1/include/stdarg.h
40
lib/gcc/avr/4.10.0/include/float.h
44
lib/gcc/avr/4.5.1/include/stdbool.h
41
lib/gcc/avr/4.10.0/include/iso646.h
45
lib/gcc/avr/4.5.1/include/stddef.h
42
lib/gcc/avr/4.10.0/include/stdalign.h
46
lib/gcc/avr/4.5.1/include/stdfix.h
43
lib/gcc/avr/4.10.0/include/stdarg.h
47
lib/gcc/avr/4.5.1/include/stdint-gcc.h
44
lib/gcc/avr/4.10.0/include/stdatomic.h
48
lib/gcc/avr/4.5.1/include/stdint.h
45
lib/gcc/avr/4.10.0/include/stdbool.h
49
lib/gcc/avr/4.5.1/include/tgmath.h
46
lib/gcc/avr/4.10.0/include/stddef.h
50
lib/gcc/avr/4.5.1/include/unwind.h
47
lib/gcc/avr/4.10.0/include/stdfix-gcc.h
51
lib/gcc/avr/4.5.1/include/varargs.h
48
lib/gcc/avr/4.10.0/include/stdfix.h
52
lib/gcc/avr/4.5.1/install-tools/fixinc_list
49
lib/gcc/avr/4.10.0/include/stdint-gcc.h
53
lib/gcc/avr/4.5.1/install-tools/gsyslimits.h
50
lib/gcc/avr/4.10.0/include/stdint.h
54
lib/gcc/avr/4.5.1/install-tools/include/README
51
lib/gcc/avr/4.10.0/include/stdnoreturn.h
55
lib/gcc/avr/4.5.1/install-tools/include/limits.h
52
lib/gcc/avr/4.10.0/include/unwind.h
56
lib/gcc/avr/4.5.1/install-tools/macro_list
53
lib/gcc/avr/4.10.0/include/varargs.h
57
lib/gcc/avr/4.5.1/install-tools/mkheaders.conf
54
lib/gcc/avr/4.10.0/install-tools/fixinc_list
58
lib/gcc/avr/4.5.1/libgcc.a
55
lib/gcc/avr/4.10.0/install-tools/gsyslimits.h
59
lib/gcc/avr/4.5.1/libgcov.a
56
lib/gcc/avr/4.10.0/install-tools/include/README
60
lib/gcc/avr/4.5.1/plugin/include/cp/cp-tree.h
57
lib/gcc/avr/4.10.0/install-tools/include/limits.h
61
lib/gcc/avr/4.5.1/plugin/include/cp/cxx-pretty-print.h
58
lib/gcc/avr/4.10.0/install-tools/macro_list
62
lib/gcc/avr/4.5.1/plugin/include/cp/name-lookup.h
59
lib/gcc/avr/4.10.0/install-tools/mkheaders.conf
63
lib/gcc/avr/4.5.1/plugin/include/cp/cp-tree.def
60
lib/gcc/avr/4.10.0/libgcc.a
64
lib/gcc/avr/4.5.1/plugin/include/ansidecl.h
61
lib/gcc/avr/4.10.0/libgcov.a
65
lib/gcc/avr/4.5.1/plugin/include/filenames.h
62
lib/gcc/avr/4.10.0/plugin/gtype.state
66
lib/gcc/avr/4.5.1/plugin/include/hashtab.h
63
lib/gcc/avr/4.10.0/plugin/include/ada/gcc-interface/ada-tree.def
67
lib/gcc/avr/4.5.1/plugin/include/libiberty.h
64
lib/gcc/avr/4.10.0/plugin/include/alias.h
68
lib/gcc/avr/4.5.1/plugin/include/md5.h
65
lib/gcc/avr/4.10.0/plugin/include/all-tree.def
69
lib/gcc/avr/4.5.1/plugin/include/obstack.h
66
lib/gcc/avr/4.10.0/plugin/include/alloc-pool.h
70
lib/gcc/avr/4.5.1/plugin/include/partition.h
67
lib/gcc/avr/4.10.0/plugin/include/ansidecl.h
71
lib/gcc/avr/4.5.1/plugin/include/safe-ctype.h
68
lib/gcc/avr/4.10.0/plugin/include/attribs.h
72
lib/gcc/avr/4.5.1/plugin/include/splay-tree.h
69
lib/gcc/avr/4.10.0/plugin/include/auto-host.h
73
lib/gcc/avr/4.5.1/plugin/include/cpplib.h
70
lib/gcc/avr/4.10.0/plugin/include/b-header-vars
74
lib/gcc/avr/4.5.1/plugin/include/line-map.h
71
lib/gcc/avr/4.10.0/plugin/include/basic-block.h
75
lib/gcc/avr/4.5.1/plugin/include/symtab.h
72
lib/gcc/avr/4.10.0/plugin/include/bitmap.h
76
lib/gcc/avr/4.5.1/plugin/include/config/avr/avr-protos.h
73
lib/gcc/avr/4.10.0/plugin/include/builtins.def
77
lib/gcc/avr/4.5.1/plugin/include/config/avr/avr.h
74
lib/gcc/avr/4.10.0/plugin/include/bversion.h
78
lib/gcc/avr/4.5.1/plugin/include/config/dbxelf.h
75
lib/gcc/avr/4.10.0/plugin/include/c-family/c-common.def
79
lib/gcc/avr/4.5.1/plugin/include/config/newlib-stdint.h
76
lib/gcc/avr/4.10.0/plugin/include/c-family/c-common.h
80
lib/gcc/avr/4.5.1/plugin/include/defaults.h
77
lib/gcc/avr/4.10.0/plugin/include/c-family/c-objc.h
81
lib/gcc/avr/4.5.1/plugin/include/alias.h
78
lib/gcc/avr/4.10.0/plugin/include/c-family/c-pragma.h
82
lib/gcc/avr/4.5.1/plugin/include/all-tree.def
79
lib/gcc/avr/4.10.0/plugin/include/c-family/c-pretty-print.h
83
lib/gcc/avr/4.5.1/plugin/include/auto-host.h
80
lib/gcc/avr/4.10.0/plugin/include/c-tree.h
84
lib/gcc/avr/4.5.1/plugin/include/basic-block.h
81
lib/gcc/avr/4.10.0/plugin/include/calls.h
85
lib/gcc/avr/4.5.1/plugin/include/bitmap.h
82
lib/gcc/avr/4.10.0/plugin/include/cfg-flags.def
86
lib/gcc/avr/4.5.1/plugin/include/builtins.def
83
lib/gcc/avr/4.10.0/plugin/include/cfgexpand.h
87
lib/gcc/avr/4.5.1/plugin/include/bversion.h
84
lib/gcc/avr/4.10.0/plugin/include/cfghooks.h
88
lib/gcc/avr/4.5.1/plugin/include/c-common.def
85
lib/gcc/avr/4.10.0/plugin/include/cfgloop.h
89
lib/gcc/avr/4.5.1/plugin/include/c-common.h
86
lib/gcc/avr/4.10.0/plugin/include/cgraph.h
90
lib/gcc/avr/4.5.1/plugin/include/c-pragma.h
87
lib/gcc/avr/4.10.0/plugin/include/cif-code.def
91
lib/gcc/avr/4.5.1/plugin/include/c-pretty-print.h
88
lib/gcc/avr/4.10.0/plugin/include/cilk-builtins.def
92
lib/gcc/avr/4.5.1/plugin/include/cfghooks.h
89
lib/gcc/avr/4.10.0/plugin/include/cilkplus.def
93
lib/gcc/avr/4.5.1/plugin/include/cfgloop.h
90
lib/gcc/avr/4.10.0/plugin/include/config.h
94
lib/gcc/avr/4.5.1/plugin/include/cgraph.h
91
lib/gcc/avr/4.10.0/plugin/include/config/avr/avr-arch.h
95
lib/gcc/avr/4.5.1/plugin/include/cif-code.def
92
lib/gcc/avr/4.10.0/plugin/include/config/avr/avr-protos.h
96
lib/gcc/avr/4.5.1/plugin/include/config.h
93
lib/gcc/avr/4.10.0/plugin/include/config/avr/avr-stdint.h
97
lib/gcc/avr/4.5.1/plugin/include/configargs.h
94
lib/gcc/avr/4.10.0/plugin/include/config/avr/avr.h
98
lib/gcc/avr/4.5.1/plugin/include/coretypes.h
95
lib/gcc/avr/4.10.0/plugin/include/config/avr/avrlibc.h
99
lib/gcc/avr/4.5.1/plugin/include/cppdefault.h
96
lib/gcc/avr/4.10.0/plugin/include/config/avr/elf.h
100
lib/gcc/avr/4.5.1/plugin/include/debug.h
97
lib/gcc/avr/4.10.0/plugin/include/config/dbxelf.h
101
lib/gcc/avr/4.5.1/plugin/include/diagnostic.def
98
lib/gcc/avr/4.10.0/plugin/include/config/elfos.h
102
lib/gcc/avr/4.5.1/plugin/include/diagnostic.h
99
lib/gcc/avr/4.10.0/plugin/include/config/initfini-array.h
103
lib/gcc/avr/4.5.1/plugin/include/double-int.h
100
lib/gcc/avr/4.10.0/plugin/include/configargs.h
104
lib/gcc/avr/4.5.1/plugin/include/emit-rtl.h
101
lib/gcc/avr/4.10.0/plugin/include/context.h
105
lib/gcc/avr/4.5.1/plugin/include/except.h
102
lib/gcc/avr/4.10.0/plugin/include/coretypes.h
106
lib/gcc/avr/4.5.1/plugin/include/fixed-value.h
103
lib/gcc/avr/4.10.0/plugin/include/cp/cp-tree.def
107
lib/gcc/avr/4.5.1/plugin/include/flags.h
104
lib/gcc/avr/4.10.0/plugin/include/cp/cp-tree.h
108
lib/gcc/avr/4.5.1/plugin/include/function.h
105
lib/gcc/avr/4.10.0/plugin/include/cp/cxx-pretty-print.h
109
lib/gcc/avr/4.5.1/plugin/include/gcc-plugin.h
106
lib/gcc/avr/4.10.0/plugin/include/cp/name-lookup.h
110
lib/gcc/avr/4.5.1/plugin/include/genrtl.h
107
lib/gcc/avr/4.10.0/plugin/include/cp/type-utils.h
111
lib/gcc/avr/4.5.1/plugin/include/ggc.h
108
lib/gcc/avr/4.10.0/plugin/include/cppdefault.h
112
lib/gcc/avr/4.5.1/plugin/include/gimple.def
109
lib/gcc/avr/4.10.0/plugin/include/cpplib.h
113
lib/gcc/avr/4.5.1/plugin/include/gimple.h
110
lib/gcc/avr/4.10.0/plugin/include/debug.h
114
lib/gcc/avr/4.5.1/plugin/include/gsstruct.def
111
lib/gcc/avr/4.10.0/plugin/include/defaults.h
115
lib/gcc/avr/4.5.1/plugin/include/gtype-desc.h
112
lib/gcc/avr/4.10.0/plugin/include/df.h
116
lib/gcc/avr/4.5.1/plugin/include/hard-reg-set.h
113
lib/gcc/avr/4.10.0/plugin/include/diagnostic-color.h
117
lib/gcc/avr/4.5.1/plugin/include/highlev-plugin-common.h
114
lib/gcc/avr/4.10.0/plugin/include/diagnostic-core.h
118
lib/gcc/avr/4.5.1/plugin/include/hwint.h
115
lib/gcc/avr/4.10.0/plugin/include/diagnostic.def
119
lib/gcc/avr/4.5.1/plugin/include/incpath.h
116
lib/gcc/avr/4.10.0/plugin/include/diagnostic.h
120
lib/gcc/avr/4.5.1/plugin/include/input.h
117
lib/gcc/avr/4.10.0/plugin/include/double-int.h
121
lib/gcc/avr/4.5.1/plugin/include/insn-constants.h
118
lib/gcc/avr/4.10.0/plugin/include/dumpfile.h
122
lib/gcc/avr/4.5.1/plugin/include/insn-flags.h
119
lib/gcc/avr/4.10.0/plugin/include/emit-rtl.h
123
lib/gcc/avr/4.5.1/plugin/include/insn-modes.h
120
lib/gcc/avr/4.10.0/plugin/include/except.h
124
lib/gcc/avr/4.5.1/plugin/include/insn-notes.def
121
lib/gcc/avr/4.10.0/plugin/include/filenames.h
125
lib/gcc/avr/4.5.1/plugin/include/intl.h
122
lib/gcc/avr/4.10.0/plugin/include/fixed-value.h
126
lib/gcc/avr/4.5.1/plugin/include/ipa-prop.h
123
lib/gcc/avr/4.10.0/plugin/include/flag-types.h
127
lib/gcc/avr/4.5.1/plugin/include/ipa-reference.h
124
lib/gcc/avr/4.10.0/plugin/include/flags.h
128
lib/gcc/avr/4.5.1/plugin/include/ipa-utils.h
125
lib/gcc/avr/4.10.0/plugin/include/fold-const.h
129
lib/gcc/avr/4.5.1/plugin/include/langhooks.h
126
lib/gcc/avr/4.10.0/plugin/include/function.h
130
lib/gcc/avr/4.5.1/plugin/include/machmode.h
127
lib/gcc/avr/4.10.0/plugin/include/gcc-plugin.h
131
lib/gcc/avr/4.5.1/plugin/include/mode-classes.def
128
lib/gcc/avr/4.10.0/plugin/include/gcc-symtab.h
132
lib/gcc/avr/4.5.1/plugin/include/omp-builtins.def
129
lib/gcc/avr/4.10.0/plugin/include/genrtl.h
133
lib/gcc/avr/4.5.1/plugin/include/options.h
130
lib/gcc/avr/4.10.0/plugin/include/ggc.h
134
lib/gcc/avr/4.5.1/plugin/include/opts.h
131
lib/gcc/avr/4.10.0/plugin/include/gimple-builder.h
135
lib/gcc/avr/4.5.1/plugin/include/output.h
132
lib/gcc/avr/4.10.0/plugin/include/gimple-expr.h
136
lib/gcc/avr/4.5.1/plugin/include/params.def
133
lib/gcc/avr/4.10.0/plugin/include/gimple-fold.h
137
lib/gcc/avr/4.5.1/plugin/include/params.h
134
lib/gcc/avr/4.10.0/plugin/include/gimple-iterator.h
138
lib/gcc/avr/4.5.1/plugin/include/plugin-version.h
135
lib/gcc/avr/4.10.0/plugin/include/gimple-low.h
139
lib/gcc/avr/4.5.1/plugin/include/plugin.def
136
lib/gcc/avr/4.10.0/plugin/include/gimple-pretty-print.h
140
lib/gcc/avr/4.5.1/plugin/include/plugin.h
137
lib/gcc/avr/4.10.0/plugin/include/gimple-ssa.h
141
lib/gcc/avr/4.5.1/plugin/include/pointer-set.h
138
lib/gcc/avr/4.10.0/plugin/include/gimple-walk.h
142
lib/gcc/avr/4.5.1/plugin/include/predict.def
139
lib/gcc/avr/4.10.0/plugin/include/gimple.def
143
lib/gcc/avr/4.5.1/plugin/include/predict.h
140
lib/gcc/avr/4.10.0/plugin/include/gimple.h
144
lib/gcc/avr/4.5.1/plugin/include/prefix.h
141
lib/gcc/avr/4.10.0/plugin/include/gimplify-me.h
145
lib/gcc/avr/4.5.1/plugin/include/pretty-print.h
142
lib/gcc/avr/4.10.0/plugin/include/gimplify.h
146
lib/gcc/avr/4.5.1/plugin/include/real.h
143
lib/gcc/avr/4.10.0/plugin/include/gsstruct.def
147
lib/gcc/avr/4.5.1/plugin/include/reg-notes.def
144
lib/gcc/avr/4.10.0/plugin/include/gtm-builtins.def
148
lib/gcc/avr/4.5.1/plugin/include/rtl.def
145
lib/gcc/avr/4.10.0/plugin/include/gtype-desc.h
149
lib/gcc/avr/4.5.1/plugin/include/rtl.h
146
lib/gcc/avr/4.10.0/plugin/include/hard-reg-set.h
150
lib/gcc/avr/4.5.1/plugin/include/sbitmap.h
147
lib/gcc/avr/4.10.0/plugin/include/hash-table.h
151
lib/gcc/avr/4.5.1/plugin/include/statistics.h
148
lib/gcc/avr/4.10.0/plugin/include/hashtab.h
152
lib/gcc/avr/4.5.1/plugin/include/sync-builtins.def
149
lib/gcc/avr/4.10.0/plugin/include/highlev-plugin-common.h
153
lib/gcc/avr/4.5.1/plugin/include/system.h
150
lib/gcc/avr/4.10.0/plugin/include/hwint.h
154
lib/gcc/avr/4.5.1/plugin/include/target.h
151
lib/gcc/avr/4.10.0/plugin/include/incpath.h
155
lib/gcc/avr/4.5.1/plugin/include/timevar.def
152
lib/gcc/avr/4.10.0/plugin/include/input.h
156
lib/gcc/avr/4.5.1/plugin/include/timevar.h
153
lib/gcc/avr/4.10.0/plugin/include/insn-codes.h
157
lib/gcc/avr/4.5.1/plugin/include/tm-preds.h
154
lib/gcc/avr/4.10.0/plugin/include/insn-constants.h
158
lib/gcc/avr/4.5.1/plugin/include/tm.h
155
lib/gcc/avr/4.10.0/plugin/include/insn-flags.h
159
lib/gcc/avr/4.5.1/plugin/include/tm_p.h
156
lib/gcc/avr/4.10.0/plugin/include/insn-modes.h
160
lib/gcc/avr/4.5.1/plugin/include/toplev.h
157
lib/gcc/avr/4.10.0/plugin/include/insn-notes.def
161
lib/gcc/avr/4.5.1/plugin/include/tree-dump.h
158
lib/gcc/avr/4.10.0/plugin/include/internal-fn.def
162
lib/gcc/avr/4.5.1/plugin/include/tree-check.h
159
lib/gcc/avr/4.10.0/plugin/include/internal-fn.h
163
lib/gcc/avr/4.5.1/plugin/include/tree-flow-inline.h
160
lib/gcc/avr/4.10.0/plugin/include/intl.h
164
lib/gcc/avr/4.5.1/plugin/include/tree-flow.h
161
lib/gcc/avr/4.10.0/plugin/include/ipa-prop.h
165
lib/gcc/avr/4.5.1/plugin/include/tree-inline.h
162
lib/gcc/avr/4.10.0/plugin/include/ipa-ref.h
166
lib/gcc/avr/4.5.1/plugin/include/tree-iterator.h
163
lib/gcc/avr/4.10.0/plugin/include/ipa-reference.h
167
lib/gcc/avr/4.5.1/plugin/include/tree-pass.h
164
lib/gcc/avr/4.10.0/plugin/include/ipa-utils.h
168
lib/gcc/avr/4.5.1/plugin/include/tree-ssa-alias.h
165
lib/gcc/avr/4.10.0/plugin/include/is-a.h
169
lib/gcc/avr/4.5.1/plugin/include/tree-ssa-operands.h
166
lib/gcc/avr/4.10.0/plugin/include/java/java-tree.def
170
lib/gcc/avr/4.5.1/plugin/include/tree-ssa-sccvn.h
167
lib/gcc/avr/4.10.0/plugin/include/langhooks.h
171
lib/gcc/avr/4.5.1/plugin/include/tree.def
168
lib/gcc/avr/4.10.0/plugin/include/libiberty.h
172
lib/gcc/avr/4.5.1/plugin/include/tree.h
169
lib/gcc/avr/4.10.0/plugin/include/line-map.h
173
lib/gcc/avr/4.5.1/plugin/include/treestruct.def
170
lib/gcc/avr/4.10.0/plugin/include/%%PERL_ARCH%%mode.h
174
lib/gcc/avr/4.5.1/plugin/include/varray.h
171
lib/gcc/avr/4.10.0/plugin/include/md5.h
175
lib/gcc/avr/4.5.1/plugin/include/vec.h
172
lib/gcc/avr/4.10.0/plugin/include/mode-classes.def
176
lib/gcc/avr/4.5.1/plugin/include/vecprim.h
173
lib/gcc/avr/4.10.0/plugin/include/objc/objc-tree.def
177
lib/gcc/avr/4.5.1/plugin/include/version.h
174
lib/gcc/avr/4.10.0/plugin/include/obstack.h
178
lib/gcc/avr/4.5.1/plugin/include/b-header-vars
175
lib/gcc/avr/4.10.0/plugin/include/omp-builtins.def
179
libexec/gcc/avr/4.5.1/cc1
176
lib/gcc/avr/4.10.0/plugin/include/options.h
180
libexec/gcc/avr/4.5.1/cc1plus
177
lib/gcc/avr/4.10.0/plugin/include/opts.h
181
libexec/gcc/avr/4.5.1/collect2
178
lib/gcc/avr/4.10.0/plugin/include/output.h
182
libexec/gcc/avr/4.5.1/lto-wrapper
179
lib/gcc/avr/4.10.0/plugin/include/params.def
183
libexec/gcc/avr/4.5.1/lto1
180
lib/gcc/avr/4.10.0/plugin/include/params.h
184
libexec/gcc/avr/4.5.1/install-tools/fixinc.sh
181
lib/gcc/avr/4.10.0/plugin/include/pass_manager.h
185
libexec/gcc/avr/4.5.1/install-tools/fixincl
182
lib/gcc/avr/4.10.0/plugin/include/plugin-api.h
186
libexec/gcc/avr/4.5.1/install-tools/mkheaders
183
lib/gcc/avr/4.10.0/plugin/include/plugin-version.h
187
libexec/gcc/avr/4.5.1/install-tools/mkinstalldirs
184
lib/gcc/avr/4.10.0/plugin/include/plugin.def
185
lib/gcc/avr/4.10.0/plugin/include/plugin.h
186
lib/gcc/avr/4.10.0/plugin/include/pointer-set.h
187
lib/gcc/avr/4.10.0/plugin/include/predict.def
188
lib/gcc/avr/4.10.0/plugin/include/predict.h
189
lib/gcc/avr/4.10.0/plugin/include/prefix.h
190
lib/gcc/avr/4.10.0/plugin/include/pretty-print.h
191
lib/gcc/avr/4.10.0/plugin/include/print-rtl.h
192
lib/gcc/avr/4.10.0/plugin/include/print-tree.h
193
lib/gcc/avr/4.10.0/plugin/include/real.h
194
lib/gcc/avr/4.10.0/plugin/include/realmpfr.h
195
lib/gcc/avr/4.10.0/plugin/include/reg-notes.def
196
lib/gcc/avr/4.10.0/plugin/include/regset.h
197
lib/gcc/avr/4.10.0/plugin/include/resource.h
198
lib/gcc/avr/4.10.0/plugin/include/rtl.def
199
lib/gcc/avr/4.10.0/plugin/include/rtl.h
200
lib/gcc/avr/4.10.0/plugin/include/safe-ctype.h
201
lib/gcc/avr/4.10.0/plugin/include/sanitizer.def
202
lib/gcc/avr/4.10.0/plugin/include/sbitmap.h
203
lib/gcc/avr/4.10.0/plugin/include/splay-tree.h
204
lib/gcc/avr/4.10.0/plugin/include/ssa-iterators.h
205
lib/gcc/avr/4.10.0/plugin/include/statistics.h
206
lib/gcc/avr/4.10.0/plugin/include/stmt.h
207
lib/gcc/avr/4.10.0/plugin/include/stor-layout.h
208
lib/gcc/avr/4.10.0/plugin/include/stringpool.h
209
lib/gcc/avr/4.10.0/plugin/include/symtab.h
210
lib/gcc/avr/4.10.0/plugin/include/sync-builtins.def
211
lib/gcc/avr/4.10.0/plugin/include/system.h
212
lib/gcc/avr/4.10.0/plugin/include/target-hooks-macros.h
213
lib/gcc/avr/4.10.0/plugin/include/target.def
214
lib/gcc/avr/4.10.0/plugin/include/target.h
215
lib/gcc/avr/4.10.0/plugin/include/timevar.def
216
lib/gcc/avr/4.10.0/plugin/include/timevar.h
217
lib/gcc/avr/4.10.0/plugin/include/tm-preds.h
218
lib/gcc/avr/4.10.0/plugin/include/tm.h
219
lib/gcc/avr/4.10.0/plugin/include/tm_p.h
220
lib/gcc/avr/4.10.0/plugin/include/toplev.h
221
lib/gcc/avr/4.10.0/plugin/include/tree-cfg.h
222
lib/gcc/avr/4.10.0/plugin/include/tree-cfgcleanup.h
223
lib/gcc/avr/4.10.0/plugin/include/tree-check.h
224
lib/gcc/avr/4.10.0/plugin/include/tree-core.h
225
lib/gcc/avr/4.10.0/plugin/include/tree-dfa.h
226
lib/gcc/avr/4.10.0/plugin/include/tree-dump.h
227
lib/gcc/avr/4.10.0/plugin/include/tree-eh.h
228
lib/gcc/avr/4.10.0/plugin/include/tree-hasher.h
229
lib/gcc/avr/4.10.0/plugin/include/tree-inline.h
230
lib/gcc/avr/4.10.0/plugin/include/tree-into-ssa.h
231
lib/gcc/avr/4.10.0/plugin/include/tree-iterator.h
232
lib/gcc/avr/4.10.0/plugin/include/tree-nested.h
233
lib/gcc/avr/4.10.0/plugin/include/tree-object-size.h
234
lib/gcc/avr/4.10.0/plugin/include/tree-outof-ssa.h
235
lib/gcc/avr/4.10.0/plugin/include/tree-parloops.h
236
lib/gcc/avr/4.10.0/plugin/include/tree-pass.h
237
lib/gcc/avr/4.10.0/plugin/include/tree-phinodes.h
238
lib/gcc/avr/4.10.0/plugin/include/tree-pretty-print.h
239
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-address.h
240
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-alias.h
241
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-coalesce.h
242
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-dom.h
243
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-loop-ivopts.h
244
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-loop-manip.h
245
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-loop-niter.h
246
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-loop.h
247
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-operands.h
248
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-sccvn.h
249
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-ter.h
250
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-threadedge.h
251
lib/gcc/avr/4.10.0/plugin/include/tree-ssa-threadupdate.h
252
lib/gcc/avr/4.10.0/plugin/include/tree-ssa.h
253
lib/gcc/avr/4.10.0/plugin/include/tree-ssanames.h
254
lib/gcc/avr/4.10.0/plugin/include/tree.def
255
lib/gcc/avr/4.10.0/plugin/include/tree.h
256
lib/gcc/avr/4.10.0/plugin/include/treestruct.def
257
lib/gcc/avr/4.10.0/plugin/include/varasm.h
258
lib/gcc/avr/4.10.0/plugin/include/vec.h
259
lib/gcc/avr/4.10.0/plugin/include/version.h
260
lib/gcc/avr/4.10.0/tiny-stack/libgcc.a
261
lib/gcc/avr/4.10.0/tiny-stack/libgcov.a
262
libexec/gcc/avr/4.10.0/cc1
263
libexec/gcc/avr/4.10.0/cc1plus
264
libexec/gcc/avr/4.10.0/collect2
265
libexec/gcc/avr/4.10.0/install-tools/fixinc.sh
266
libexec/gcc/avr/4.10.0/install-tools/fixincl
267
libexec/gcc/avr/4.10.0/install-tools/mkheaders
268
libexec/gcc/avr/4.10.0/install-tools/mkinstalldirs
269
libexec/gcc/avr/4.10.0/liblto_plugin.so
270
libexec/gcc/avr/4.10.0/liblto_plugin.so.0
271
libexec/gcc/avr/4.10.0/liblto_plugin.so.0.0.0
272
libexec/gcc/avr/4.10.0/lto-wrapper
273
libexec/gcc/avr/4.10.0/lto1
274
libexec/gcc/avr/4.10.0/plugin/gengtype
275
man/man1/avr-cpp.1.gz
276
man/man1/avr-g++.1.gz
277
man/man1/avr-gcc.1.gz
278
man/man1/avr-gcov.1.gz
279
man/man1/avr-gfortran.1.gz
280
man/man7/fsf-funding.7.gz
281
man/man7/gfdl.7.gz
282
man/man7/gpl.7.gz
188
share/locale/be/LC_MESSAGES/cpplib.mo
283
share/locale/be/LC_MESSAGES/cpplib.mo
189
share/locale/be/LC_MESSAGES/gcc.mo
284
share/locale/be/LC_MESSAGES/gcc.mo
190
share/locale/ca/LC_MESSAGES/cpplib.mo
285
share/locale/ca/LC_MESSAGES/cpplib.mo
Lines 194-212 Link Here
194
share/locale/de/LC_MESSAGES/gcc.mo
289
share/locale/de/LC_MESSAGES/gcc.mo
195
share/locale/el/LC_MESSAGES/cpplib.mo
290
share/locale/el/LC_MESSAGES/cpplib.mo
196
share/locale/el/LC_MESSAGES/gcc.mo
291
share/locale/el/LC_MESSAGES/gcc.mo
292
share/locale/eo/LC_MESSAGES/cpplib.mo
197
share/locale/es/LC_MESSAGES/cpplib.mo
293
share/locale/es/LC_MESSAGES/cpplib.mo
198
share/locale/es/LC_MESSAGES/gcc.mo
294
share/locale/es/LC_MESSAGES/gcc.mo
199
share/locale/fi/LC_MESSAGES/cpplib.mo
295
share/locale/fi/LC_MESSAGES/cpplib.mo
200
share/locale/fi/LC_MESSAGES/gcc.mo
296
share/locale/fi/LC_MESSAGES/gcc.mo
201
share/locale/fr/LC_MESSAGES/cpplib.mo
297
share/locale/fr/LC_MESSAGES/cpplib.mo
202
share/locale/fr/LC_MESSAGES/gcc.mo
298
share/locale/fr/LC_MESSAGES/gcc.mo
299
share/locale/hr/LC_MESSAGES/gcc.mo
203
share/locale/id/LC_MESSAGES/cpplib.mo
300
share/locale/id/LC_MESSAGES/cpplib.mo
204
share/locale/id/LC_MESSAGES/gcc.mo
301
share/locale/id/LC_MESSAGES/gcc.mo
205
share/locale/ja/LC_MESSAGES/cpplib.mo
302
share/locale/ja/LC_MESSAGES/cpplib.mo
206
share/locale/ja/LC_MESSAGES/gcc.mo
303
share/locale/ja/LC_MESSAGES/gcc.mo
207
share/locale/nl/LC_MESSAGES/cpplib.mo
304
share/locale/nl/LC_MESSAGES/cpplib.mo
208
share/locale/nl/LC_MESSAGES/gcc.mo
305
share/locale/nl/LC_MESSAGES/gcc.mo
306
share/locale/pt_BR/LC_MESSAGES/cpplib.mo
307
share/locale/ru/LC_MESSAGES/cpplib.mo
209
share/locale/ru/LC_MESSAGES/gcc.mo
308
share/locale/ru/LC_MESSAGES/gcc.mo
309
share/locale/sr/LC_MESSAGES/cpplib.mo
210
share/locale/sr/LC_MESSAGES/gcc.mo
310
share/locale/sr/LC_MESSAGES/gcc.mo
211
share/locale/sv/LC_MESSAGES/cpplib.mo
311
share/locale/sv/LC_MESSAGES/cpplib.mo
212
share/locale/sv/LC_MESSAGES/gcc.mo
312
share/locale/sv/LC_MESSAGES/gcc.mo
Lines 214-250 Link Here
214
share/locale/tr/LC_MESSAGES/gcc.mo
314
share/locale/tr/LC_MESSAGES/gcc.mo
215
share/locale/uk/LC_MESSAGES/cpplib.mo
315
share/locale/uk/LC_MESSAGES/cpplib.mo
216
share/locale/vi/LC_MESSAGES/cpplib.mo
316
share/locale/vi/LC_MESSAGES/cpplib.mo
317
share/locale/vi/LC_MESSAGES/gcc.mo
217
share/locale/zh_CN/LC_MESSAGES/cpplib.mo
318
share/locale/zh_CN/LC_MESSAGES/cpplib.mo
218
share/locale/zh_CN/LC_MESSAGES/gcc.mo
319
share/locale/zh_CN/LC_MESSAGES/gcc.mo
219
share/locale/zh_TW/LC_MESSAGES/cpplib.mo
320
share/locale/zh_TW/LC_MESSAGES/cpplib.mo
220
share/locale/zh_TW/LC_MESSAGES/gcc.mo
321
share/locale/zh_TW/LC_MESSAGES/gcc.mo
221
@dirrm lib/gcc/avr/4.5.1/avr25
322
@dirrmtry lib/gcc/avr/4.10.0/avr25/tiny-stack
222
@dirrm lib/gcc/avr/4.5.1/avr3
323
@dirrmtry lib/gcc/avr/4.10.0/avr25
223
@dirrm lib/gcc/avr/4.5.1/avr31
324
@dirrmtry lib/gcc/avr/4.10.0/avr3
224
@dirrm lib/gcc/avr/4.5.1/avr35
325
@dirrmtry lib/gcc/avr/4.10.0/avr31
225
@dirrm lib/gcc/avr/4.5.1/avr4
326
@dirrmtry lib/gcc/avr/4.10.0/avr35
226
@dirrm lib/gcc/avr/4.5.1/avr5
327
@dirrmtry lib/gcc/avr/4.10.0/avr4
227
@dirrm lib/gcc/avr/4.5.1/avr51
328
@dirrmtry lib/gcc/avr/4.10.0/avr5
228
@dirrm lib/gcc/avr/4.5.1/avr6
329
@dirrmtry lib/gcc/avr/4.10.0/avr51
229
@dirrm lib/gcc/avr/4.5.1/avrxmega2
330
@dirrmtry lib/gcc/avr/4.10.0/avr6
230
@dirrm lib/gcc/avr/4.5.1/avrxmega4
331
@dirrmtry lib/gcc/avr/4.10.0/avrxmega2
231
@dirrm lib/gcc/avr/4.5.1/avrxmega5
332
@dirrmtry lib/gcc/avr/4.10.0/avrxmega4
232
@dirrm lib/gcc/avr/4.5.1/avrxmega6
333
@dirrmtry lib/gcc/avr/4.10.0/avrxmega5
233
@dirrm lib/gcc/avr/4.5.1/avrxmega7
334
@dirrmtry lib/gcc/avr/4.10.0/avrxmega6
234
@dirrm lib/gcc/avr/4.5.1/avrtiny10
335
@dirrmtry lib/gcc/avr/4.10.0/avrxmega7
235
@dirrm lib/gcc/avr/4.5.1/include
336
@dirrmtry lib/gcc/avr/4.10.0/finclude
236
@dirrm lib/gcc/avr/4.5.1/include-fixed
337
@dirrmtry lib/gcc/avr/4.10.0/include
237
@dirrm lib/gcc/avr/4.5.1/install-tools/include
338
@dirrmtry lib/gcc/avr/4.10.0/include-fixed
238
@dirrm lib/gcc/avr/4.5.1/install-tools
339
@dirrmtry lib/gcc/avr/4.10.0/install-tools/include
239
@dirrm lib/gcc/avr/4.5.1/plugin/include/config/avr
340
@dirrmtry lib/gcc/avr/4.10.0/install-tools
240
@dirrm lib/gcc/avr/4.5.1/plugin/include/config
341
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/ada/gcc-interface
241
@dirrm lib/gcc/avr/4.5.1/plugin/include/cp
342
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/ada
242
@dirrm lib/gcc/avr/4.5.1/plugin/include
343
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/c-family
243
@dirrm lib/gcc/avr/4.5.1/plugin
344
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/config/avr
244
@dirrm lib/gcc/avr/4.5.1
345
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/config
245
@dirrm lib/gcc/avr
346
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/cp
246
@dirrm lib/gcc
347
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/java
247
@dirrm libexec/gcc/avr/4.5.1/install-tools
348
@dirrmtry lib/gcc/avr/4.10.0/plugin/include/objc
248
@dirrm libexec/gcc/avr/4.5.1
349
@dirrmtry lib/gcc/avr/4.10.0/plugin/include
249
@dirrm libexec/gcc/avr
350
@dirrmtry lib/gcc/avr/4.10.0/plugin
250
@dirrm libexec/gcc
351
@dirrmtry lib/gcc/avr/4.10.0/tiny-stack
352
@dirrmtry lib/gcc/avr/4.10.0
353
@dirrmtry lib/gcc/avr
354
@dirrmtry lib/gcc
355
@dirrmtry libexec/gcc/avr/4.10.0/install-tools
356
@dirrmtry libexec/gcc/avr/4.10.0/plugin
357
@dirrmtry libexec/gcc/avr/4.10.0
358
@dirrmtry libexec/gcc/avr
359
@dirrmtry libexec/gcc

Return to bug 192399