~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/compiler/ppcgen/rgcpu.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
         procedure do_spill_written(list:TAsmList;pos:tai;const spilltemp:treference;tempreg:tregister);override;
40
40
       end;
41
41
 
 
42
       trgintcpu = class(trgcpu)
 
43
{$ifdef user0}
 
44
         procedure add_cpu_interferences(p : tai);override;
 
45
{$endif user0}
 
46
       end;
 
47
 
42
48
  implementation
43
49
 
44
50
    uses
51
57
      var
52
58
        tmpref : treference;
53
59
        helplist : TAsmList;
54
 
        l : tasmlabel;
55
60
        hreg : tregister;
 
61
        ins : Taicpu;
56
62
      begin
57
63
        if (spilltemp.offset<low(smallint)) or
58
64
           (spilltemp.offset>high(smallint)) then
63
69
              internalerror(200704201);
64
70
 
65
71
            if getregtype(tempreg)=R_INTREGISTER then
66
 
              hreg:=getregisterinline(helplist,R_SUBWHOLE)
 
72
              begin
 
73
                hreg:=getregisterinline(helplist,R_SUBWHOLE);
 
74
                {Done by add_cpu_interferences now.
 
75
                add_edge(getsupreg(hreg),RS_R0);}
 
76
              end
67
77
            else
68
78
              hreg:=cg.getintregister(helplist,OS_ADDR);
 
79
 
69
80
            reference_reset(tmpref);
70
81
            tmpref.offset:=spilltemp.offset;
71
 
            tmpref.refaddr:=addr_hi;
72
 
            helplist.concat(taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref));
 
82
            tmpref.refaddr := addr_higha;
 
83
            ins:=taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref);
 
84
            add_cpu_interferences(ins);
 
85
            helplist.concat(ins);
73
86
            tmpref:=spilltemp;
74
 
            tmpref.refaddr:=addr_lo;
 
87
            tmpref.refaddr := addr_low;
75
88
            tmpref.base:=hreg;
76
 
            helplist.concat(spilling_create_load(tmpref,tempreg));
77
 
 
 
89
            
 
90
            ins:=spilling_create_load(tmpref,tempreg);
 
91
            add_cpu_interferences(ins);
 
92
            
 
93
            
 
94
            helplist.concat(ins);
 
95
            
78
96
            if getregtype(tempreg)=R_INTREGISTER then
79
97
              ungetregisterinline(helplist,hreg);
80
98
 
90
108
      var
91
109
        tmpref : treference;
92
110
        helplist : TAsmList;
93
 
        l : tasmlabel;
94
111
        hreg : tregister;
 
112
        ins : Taicpu;
95
113
      begin
96
114
        if (spilltemp.offset<low(smallint)) or
97
115
           (spilltemp.offset>high(smallint)) then
102
120
              internalerror(200704201);
103
121
 
104
122
            if getregtype(tempreg)=R_INTREGISTER then
105
 
              hreg:=getregisterinline(helplist,R_SUBWHOLE)
 
123
              begin
 
124
                hreg:=getregisterinline(helplist,R_SUBWHOLE);
 
125
                {Done by add_cpu_interferences now.
 
126
                add_edge(getsupreg(hreg),RS_R0);}
 
127
              end
106
128
            else
107
129
              hreg:=cg.getintregister(helplist,OS_ADDR);
108
130
            reference_reset(tmpref);
109
131
            tmpref.offset:=spilltemp.offset;
110
 
            tmpref.refaddr:=addr_hi;
111
 
            helplist.concat(taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref));
 
132
            tmpref.refaddr := addr_higha;
 
133
            ins:=taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref);
 
134
            add_cpu_interferences(ins);
 
135
            helplist.concat(ins);
112
136
            tmpref:=spilltemp;
113
 
            tmpref.refaddr:=addr_lo;
 
137
            tmpref.refaddr := addr_low;
114
138
            tmpref.base:=hreg;
115
 
            helplist.concat(spilling_create_store(tempreg,tmpref));
 
139
            ins:=spilling_create_store(tempreg,tmpref);
 
140
            add_cpu_interferences(ins);
 
141
            helplist.concat(ins);
116
142
 
117
143
            if getregtype(tempreg)=R_INTREGISTER then
118
144
              ungetregisterinline(helplist,hreg);
124
150
          inherited do_spill_written(list,pos,spilltemp,tempreg);
125
151
      end;
126
152
 
 
153
{$ifdef user0}
 
154
    procedure trgintcpu.add_cpu_interferences(p : tai);
 
155
      var
 
156
        r : tregister;
 
157
      begin
 
158
        if p.typ=ait_instruction then
 
159
          begin
 
160
            case taicpu(p).opcode of
 
161
              A_ADDI, A_ADDIS,
 
162
              A_STB, A_LBZ, A_STBX, A_LBZX, A_STH, A_LHZ, A_STHX, A_LHZX, A_LHA, A_LHAX,
 
163
              A_STW, A_LWZ, A_STWX, A_LWZX,
 
164
              A_STFS, A_LFS, A_STFSX, A_LFSX, A_STFD, A_LFD, A_STFDX, A_LFDX, A_STFIWX,
 
165
              A_STHBRX, A_LHBRX, A_STWBRX, A_LWBRX, A_STWCX_, A_LWARX,
 
166
              A_ECIWX, A_ECOWX,
 
167
              A_LMW, A_STMW,A_LSWI,A_LSWX,A_STSWI,A_STSWX
 
168
{$ifdef cpu64bit}
 
169
              , A_STD, A_STDX,
 
170
              A_LD, A_LDX,
 
171
              A_LWA, A_LWAX,
 
172
              A_STDCX_,A_LDARX
 
173
{$endif cpu64bit}
 
174
                :
 
175
                begin
 
176
                  case taicpu(p).oper[1]^.typ of
 
177
                    top_reg:
 
178
                      add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R0);
 
179
                    top_ref:
 
180
                      if (taicpu(p).oper[1]^.ref^.base <> NR_NO) then
 
181
                        add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);
 
182
                  end;
 
183
                end;
 
184
              A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ, A_DCBF, A_ICBI:
 
185
                begin
 
186
                  case taicpu(p).oper[0]^.typ of
 
187
                    top_reg:
 
188
                      add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R0);
 
189
                    top_ref:
 
190
                      if (taicpu(p).oper[0]^.ref^.base <> NR_NO) then
 
191
                        add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);
 
192
                  end;
 
193
                end;
 
194
            end;
 
195
          end;
 
196
      end;
 
197
{$endif user0}
 
198
 
 
199
 
127
200
end.