63
69
internalerror(200704201);
65
71
if getregtype(tempreg)=R_INTREGISTER then
66
hreg:=getregisterinline(helplist,R_SUBWHOLE)
73
hreg:=getregisterinline(helplist,R_SUBWHOLE);
74
{Done by add_cpu_interferences now.
75
add_edge(getsupreg(hreg),RS_R0);}
68
78
hreg:=cg.getintregister(helplist,OS_ADDR);
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);
74
tmpref.refaddr:=addr_lo;
87
tmpref.refaddr := addr_low;
76
helplist.concat(spilling_create_load(tmpref,tempreg));
90
ins:=spilling_create_load(tmpref,tempreg);
91
add_cpu_interferences(ins);
78
96
if getregtype(tempreg)=R_INTREGISTER then
79
97
ungetregisterinline(helplist,hreg);
102
120
internalerror(200704201);
104
122
if getregtype(tempreg)=R_INTREGISTER then
105
hreg:=getregisterinline(helplist,R_SUBWHOLE)
124
hreg:=getregisterinline(helplist,R_SUBWHOLE);
125
{Done by add_cpu_interferences now.
126
add_edge(getsupreg(hreg),RS_R0);}
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);
117
143
if getregtype(tempreg)=R_INTREGISTER then
118
144
ungetregisterinline(helplist,hreg);
124
150
inherited do_spill_written(list,pos,spilltemp,tempreg);
154
procedure trgintcpu.add_cpu_interferences(p : tai);
158
if p.typ=ait_instruction then
160
case taicpu(p).opcode of
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,
167
A_LMW, A_STMW,A_LSWI,A_LSWX,A_STSWI,A_STSWX
176
case taicpu(p).oper[1]^.typ of
178
add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R0);
180
if (taicpu(p).oper[1]^.ref^.base <> NR_NO) then
181
add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);
184
A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ, A_DCBF, A_ICBI:
186
case taicpu(p).oper[0]^.typ of
188
add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R0);
190
if (taicpu(p).oper[0]^.ref^.base <> NR_NO) then
191
add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);