summaryrefslogtreecommitdiff
path: root/compiler/i8086/rgcpu.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-03-10 18:51:42 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-03-10 18:51:42 +0000
commit72a17d9a4ae7ef500db85c4e55d5db17ab32065c (patch)
tree0d917c82b3da2c0626feb1c9f8c9d0e6161b711f /compiler/i8086/rgcpu.pas
parent96e9306dff36fe8b64c42ca6ac542853d8b15feb (diff)
downloadfpc-72a17d9a4ae7ef500db85c4e55d5db17ab32065c.tar.gz
+ trgintcpu.add_cpu_interferences for i8086 so references are properly build
* empty make_simple_ref code path for i8086 git-svn-id: http://svn.freepascal.org/svn/fpc/branches/i8086@23782 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/i8086/rgcpu.pas')
-rw-r--r--compiler/i8086/rgcpu.pas44
1 files changed, 42 insertions, 2 deletions
diff --git a/compiler/i8086/rgcpu.pas b/compiler/i8086/rgcpu.pas
index 8041041d52..378a1d4a85 100644
--- a/compiler/i8086/rgcpu.pas
+++ b/compiler/i8086/rgcpu.pas
@@ -38,11 +38,18 @@ unit rgcpu;
procedure add_constraints(reg:Tregister);override;
end;
+ trgintcpu = class(trgcpu)
+ procedure add_cpu_interferences(p : tai);override;
+ end;
+
+
implementation
uses
- systems,
- verbose;
+ systems,
+ verbose,
+ aasmcpu,
+ cgutils;
const
{ This value is used in tsaved. If the array value is equal
@@ -68,4 +75,37 @@ implementation
end;
+ procedure trgintcpu.add_cpu_interferences(p : tai);
+ var
+ href : treference;
+ i : integer;
+ begin
+ if p.typ=ait_instruction then
+ begin
+ for i:=0 to taicpu(p).ops-1 do
+ begin
+ if taicpu(p).oper[i]^.typ=top_ref then
+ begin
+ href:=taicpu(p).oper[i]^.ref^;
+ if (href.base<>NR_NO) and (getsupreg(href.base)>=first_int_imreg) then
+ begin
+ add_edge(getsupreg(href.base),RS_AX);
+ add_edge(getsupreg(href.base),RS_CX);
+ add_edge(getsupreg(href.base),RS_DX);
+ add_edge(getsupreg(href.base),RS_SI);
+ add_edge(getsupreg(href.base),RS_DI);
+ end;
+ if (href.index<>NR_NO) and (getsupreg(href.index)>=first_int_imreg) then
+ begin
+ add_edge(getsupreg(href.index),RS_AX);
+ add_edge(getsupreg(href.index),RS_BX);
+ add_edge(getsupreg(href.index),RS_CX);
+ add_edge(getsupreg(href.index),RS_DX);
+ add_edge(getsupreg(href.index),RS_BP);
+ end;
+ end;
+ end;
+ end;
+ end;
+
end.