]> git.pld-linux.org Git - packages/crossavr-gcc.git/blob - 513-gcc-avrtc556-tiny-same-base-and-dest.patch
- synchronized patches with official AVR toolchain 3.4.1.830
[packages/crossavr-gcc.git] / 513-gcc-avrtc556-tiny-same-base-and-dest.patch
1 diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2 --- gcc/config/avr/avr.c        2012-07-13 16:06:56.000000000 +0530
3 +++ gcc/config/avr/avr.c        2012-07-13 15:23:01.000000000 +0530
4 @@ -2265,6 +2265,15 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
5            {
6              if (AVR_TINY)
7              {
8 +                if (reg_overlap_mentioned_p (dest, XEXP (x,0))
9 +                    || reg_unused_after (insn, XEXP (x,0)))
10 +                {
11 +
12 +                    *l = 3;
13 +                    return (AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
14 +                            AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
15 +                            AS2 (ld,%0,Y));
16 +                }
17                *l = 5;
18                return (AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
19                        AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
20 @@ -2282,6 +2291,15 @@ out_movqi_r_mr (rtx insn, rtx op[], int 
21            {
22              if (AVR_TINY)
23              {
24 +              if (reg_overlap_mentioned_p (dest, XEXP (x,0))
25 +                  || reg_unused_after (insn, XEXP (x,0)))
26 +                  {
27 +
28 +                    *l = 3;
29 +                    return (AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
30 +                            AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
31 +                            AS2 (ld,%0,Z));
32 +                  }
33                *l = 5;
34                return (AS2 (subi,%A2,lo8(-(%o1))) CR_TAB
35                        AS2 (sbci,%B2,hi8(-(%o1))) CR_TAB
36 @@ -3766,12 +3784,41 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
37          op[2] = XEXP(x, 0);
38          if(REGNO(op[2]) == REG_Y) {
39            if (AVR_TINY) {
40 -            *l = 5;
41 -            return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
42 -                   AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
43 -                   AS2 (st,Y,%1)              CR_TAB
44 -                    AS2 (subi,%A2,lo8(%o0)) CR_TAB
45 -                   AS2 (sbci,%B2,hi8(%o0)));
46 +            if (reg_overlap_mentioned_p (src, XEXP (x, 0)))
47 +            {
48 +              if (reg_unused_after (insn, XEXP (x, 0)))
49 +              {
50 +                *l = 4;
51 +                return (AS2 (mov,__tmp_reg__,%1)         CR_TAB
52 +                                   AS2 (subi,%A2,lo8(-(%o0)))       CR_TAB
53 +                                   AS2 (sbci,%B2,hi8(-(%o0)))       CR_TAB
54 +                                   AS2 (st,Y,__tmp_reg__));
55 +              }
56 +              *l = 6;
57 +              return (AS2 (mov,__tmp_reg__,%1)         CR_TAB
58 +                                 AS2 (subi,%A2,lo8(-(%o0)))       CR_TAB
59 +                                 AS2 (sbci,%B2,hi8(-(%o0)))       CR_TAB
60 +                                 AS2 (st,Y,__tmp_reg__)          CR_TAB
61 +                      AS2 (subi,%A2,lo8(%o0))          CR_TAB
62 +                             AS2 (sbci,%B2,hi8(%o0)));        
63 +            }
64 +            else
65 +            {
66 +              if (reg_unused_after (insn, XEXP (x, 0)))
67 +              {
68 +                *l = 3;
69 +                return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
70 +                               AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
71 +                               AS2 (st,Y,%1));
72 +              }
73 +
74 +              *l = 5;
75 +              return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
76 +                      AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
77 +                      AS2 (st,Y,%1)              CR_TAB
78 +                      AS2 (subi,%A2,lo8(%o0)) CR_TAB
79 +                      AS2 (sbci,%B2,hi8(%o0)));
80 +            }
81            } else {
82              *l = 1;
83              return (AS2 (std,%0,%1));
84 @@ -3779,12 +3826,40 @@ out_movqi_mr_r (rtx insn, rtx op[], int 
85          }
86          if(REGNO(op[2]) == REG_Z) {
87            if (AVR_TINY) {
88 -            *l = 5;
89 -            return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
90 -                   AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
91 -                    AS2 (st,Z,%1)              CR_TAB
92 -                    AS2 (subi,%A2,lo8(%o0)) CR_TAB
93 -                    AS2 (sbci,%B2,hi8(%o0)));
94 +            if (reg_overlap_mentioned_p (src, XEXP (x, 0)))
95 +            {
96 +              if (reg_unused_after (insn, XEXP (x, 0)))
97 +              {
98 +                *l = 4;
99 +                return (AS2 (mov,__tmp_reg__,%1)         CR_TAB
100 +                                   AS2 (subi,%A2,lo8(-(%o0)))       CR_TAB
101 +                                   AS2 (sbci,%B2,hi8(-(%o0)))       CR_TAB
102 +                                   AS2 (st,Z,__tmp_reg__));
103 +              }
104 +              *l = 6;
105 +              return (AS2 (mov,__tmp_reg__,%1)         CR_TAB
106 +                                 AS2 (subi,%A2,lo8(-(%o0)))       CR_TAB
107 +                                 AS2 (sbci,%B2,hi8(-(%o0)))       CR_TAB
108 +                                 AS2 (st,Z,__tmp_reg__)          CR_TAB
109 +                      AS2 (subi,%A2,lo8(%o0))          CR_TAB
110 +                             AS2 (sbci,%B2,hi8(%o0)));        
111 +            }
112 +            else
113 +            {
114 +              if (reg_unused_after (insn, XEXP (x, 0)))
115 +              {
116 +                *l = 3;
117 +                return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
118 +                               AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
119 +                               AS2 (st,Z,%1));
120 +              }
121 +              *l = 5;
122 +              return (AS2 (subi,%A2,lo8(-(%o0))) CR_TAB
123 +                      AS2 (sbci,%B2,hi8(-(%o0))) CR_TAB
124 +                      AS2 (st,Z,%1)              CR_TAB
125 +                      AS2 (subi,%A2,lo8(%o0)) CR_TAB
126 +                      AS2 (sbci,%B2,hi8(%o0)));
127 +            }
128            } else {
129             *l = 1;
130              return (AS2 (std,%0,%1));
This page took 0.057467 seconds and 3 git commands to generate.