mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:29:14 +02:00
* moved the insertion of fwaits for 8087 from the nasm asm writer to ti8086procinfo.postprocess_code
git-svn-id: trunk@30634 -
This commit is contained in:
parent
58c66b4759
commit
a6e39edb8f
@ -32,10 +32,14 @@ unit cpupi;
|
|||||||
|
|
||||||
type
|
type
|
||||||
ti8086procinfo = class(tcgprocinfo)
|
ti8086procinfo = class(tcgprocinfo)
|
||||||
|
private
|
||||||
|
procedure insert_8087_fwaits(list : TAsmList);
|
||||||
|
public
|
||||||
constructor create(aparent:tprocinfo);override;
|
constructor create(aparent:tprocinfo);override;
|
||||||
procedure set_first_temp_offset;override;
|
procedure set_first_temp_offset;override;
|
||||||
function calc_stackframe_size:longint;override;
|
function calc_stackframe_size:longint;override;
|
||||||
procedure generate_parameter_info;override;
|
procedure generate_parameter_info;override;
|
||||||
|
procedure postprocess_code;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -44,8 +48,9 @@ unit cpupi;
|
|||||||
uses
|
uses
|
||||||
cutils,
|
cutils,
|
||||||
systems,globals,globtype,
|
systems,globals,globtype,
|
||||||
|
aasmtai,aasmcpu,
|
||||||
cgobj,tgobj,paramgr,
|
cgobj,tgobj,paramgr,
|
||||||
cpubase,
|
cpubase,cpuinfo,
|
||||||
cgutils,
|
cgutils,
|
||||||
symconst;
|
symconst;
|
||||||
|
|
||||||
@ -95,6 +100,31 @@ unit cpupi;
|
|||||||
para_stack_size := 0;
|
para_stack_size := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure ti8086procinfo.insert_8087_fwaits(list : TAsmList);
|
||||||
|
var
|
||||||
|
curtai: tai;
|
||||||
|
begin
|
||||||
|
curtai:=tai(list.First);
|
||||||
|
while assigned(curtai) do
|
||||||
|
begin
|
||||||
|
if (curtai.typ=ait_instruction)
|
||||||
|
and requires_fwait_on_8087(taicpu(curtai).opcode) then
|
||||||
|
list.InsertBefore(taicpu.op_none(A_FWAIT),curtai);
|
||||||
|
|
||||||
|
curtai:=tai(curtai.Next);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure ti8086procinfo.postprocess_code;
|
||||||
|
begin
|
||||||
|
{ nickysn note: I don't know if the 187 requires FWAIT before
|
||||||
|
every instruction like the 8087, so I'm including it just in case }
|
||||||
|
if current_settings.cputype<=cpu_186 then
|
||||||
|
insert_8087_fwaits(aktproccode);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
cprocinfo:=ti8086procinfo;
|
cprocinfo:=ti8086procinfo;
|
||||||
end.
|
end.
|
||||||
|
@ -909,13 +909,6 @@ interface
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
prefix:='';
|
prefix:='';
|
||||||
{$ifdef i8086}
|
|
||||||
{ nickysn note: I don't know if the 187 requires FWAIT before
|
|
||||||
every instruction like the 8087, so I'm including it just in case }
|
|
||||||
if (current_settings.cputype<=cpu_186) and
|
|
||||||
requires_fwait_on_8087(fixed_opcode) then
|
|
||||||
prefix:='wait '+prefix;
|
|
||||||
{$endif i8086}
|
|
||||||
{$ifndef i8086}
|
{$ifndef i8086}
|
||||||
{ We need to explicitely set
|
{ We need to explicitely set
|
||||||
word prefix to get selectors
|
word prefix to get selectors
|
||||||
|
Loading…
Reference in New Issue
Block a user