mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:29:13 +02:00
* fixed bugs in tx86inlinenode, introduced in r24237
git-svn-id: branches/i8086@24243 -
This commit is contained in:
parent
8ce2f0c56b
commit
3152df6e7f
@ -65,7 +65,7 @@ interface
|
|||||||
{$endif not i8086}
|
{$endif not i8086}
|
||||||
procedure second_popcnt;override;
|
procedure second_popcnt;override;
|
||||||
private
|
private
|
||||||
procedure load_fpu_location;
|
procedure load_fpu_location(lnode: tnode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -198,19 +198,10 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ load the FPU into the an fpu register }
|
{ load the FPU into the an fpu register }
|
||||||
procedure tx86inlinenode.load_fpu_location;
|
procedure tx86inlinenode.load_fpu_location(lnode: tnode);
|
||||||
var
|
|
||||||
lnode: tnode;
|
|
||||||
begin
|
begin
|
||||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||||
location.register:=NR_FPU_RESULT_REG;
|
location.register:=NR_FPU_RESULT_REG;
|
||||||
{$ifdef i8086}
|
|
||||||
if left.nodetype <> callparan then
|
|
||||||
internalerror(2013031501);
|
|
||||||
lnode := tcallparanode(left).left;
|
|
||||||
{$else i8086}
|
|
||||||
lnode := left;
|
|
||||||
{$endif i8086}
|
|
||||||
secondpass(lnode);
|
secondpass(lnode);
|
||||||
case lnode.location.loc of
|
case lnode.location.loc of
|
||||||
LOC_FPUREGISTER:
|
LOC_FPUREGISTER:
|
||||||
@ -239,7 +230,7 @@ implementation
|
|||||||
|
|
||||||
procedure tx86inlinenode.second_arctan_real;
|
procedure tx86inlinenode.second_arctan_real;
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FLD1,S_NO);
|
emit_none(A_FLD1,S_NO);
|
||||||
emit_none(A_FPATAN,S_NO);
|
emit_none(A_FPATAN,S_NO);
|
||||||
end;
|
end;
|
||||||
@ -267,7 +258,7 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FABS,S_NO);
|
emit_none(A_FABS,S_NO);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -294,7 +285,13 @@ implementation
|
|||||||
else
|
else
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
{$ifdef i8086}
|
||||||
|
if left.nodetype <> callparan then
|
||||||
|
internalerror(2013031501);
|
||||||
|
load_fpu_location(tcallparanode(left).left);
|
||||||
|
{$else i8086}
|
||||||
|
load_fpu_location(left);
|
||||||
|
{$endif i8086}
|
||||||
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
||||||
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
||||||
emit_ref(A_FISTP,S_IQ,location.reference);
|
emit_ref(A_FISTP,S_IQ,location.reference);
|
||||||
@ -330,7 +327,13 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if (current_settings.fputype>=fpu_sse3) then
|
if (current_settings.fputype>=fpu_sse3) then
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
{$ifdef i8086}
|
||||||
|
if left.nodetype <> callparan then
|
||||||
|
internalerror(2013031501);
|
||||||
|
load_fpu_location(tcallparanode(left).left);
|
||||||
|
{$else i8086}
|
||||||
|
load_fpu_location(left);
|
||||||
|
{$endif i8086}
|
||||||
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
||||||
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
||||||
emit_ref(A_FISTTP,S_IQ,location.reference);
|
emit_ref(A_FISTTP,S_IQ,location.reference);
|
||||||
@ -343,7 +346,11 @@ implementation
|
|||||||
emit_ref(A_FNSTCW,S_NO,newcw);
|
emit_ref(A_FNSTCW,S_NO,newcw);
|
||||||
emit_ref(A_FNSTCW,S_NO,oldcw);
|
emit_ref(A_FNSTCW,S_NO,oldcw);
|
||||||
emit_const_ref(A_OR,S_W,$0f00,newcw);
|
emit_const_ref(A_OR,S_W,$0f00,newcw);
|
||||||
load_fpu_location;
|
{$ifdef i8086}
|
||||||
|
load_fpu_location(tcallparanode(left).left);
|
||||||
|
{$else i8086}
|
||||||
|
load_fpu_location(left);
|
||||||
|
{$endif i8086}
|
||||||
emit_ref(A_FLDCW,S_NO,newcw);
|
emit_ref(A_FLDCW,S_NO,newcw);
|
||||||
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
location_reset_ref(location,LOC_REFERENCE,OS_S64,0);
|
||||||
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
tg.GetTemp(current_asmdata.CurrAsmList,resultdef.size,resultdef.alignment,tt_normal,location.reference);
|
||||||
@ -370,7 +377,7 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_reg_reg(A_FMUL,S_NO,NR_ST0,NR_ST0);
|
emit_reg_reg(A_FMUL,S_NO,NR_ST0,NR_ST0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -394,14 +401,14 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FSQRT,S_NO);
|
emit_none(A_FSQRT,S_NO);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure tx86inlinenode.second_ln_real;
|
procedure tx86inlinenode.second_ln_real;
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FLDLN2,S_NO);
|
emit_none(A_FLDLN2,S_NO);
|
||||||
emit_none(A_FXCH,S_NO);
|
emit_none(A_FXCH,S_NO);
|
||||||
emit_none(A_FYL2X,S_NO);
|
emit_none(A_FYL2X,S_NO);
|
||||||
@ -409,13 +416,13 @@ implementation
|
|||||||
|
|
||||||
procedure tx86inlinenode.second_cos_real;
|
procedure tx86inlinenode.second_cos_real;
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FCOS,S_NO);
|
emit_none(A_FCOS,S_NO);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure tx86inlinenode.second_sin_real;
|
procedure tx86inlinenode.second_sin_real;
|
||||||
begin
|
begin
|
||||||
load_fpu_location;
|
load_fpu_location(left);
|
||||||
emit_none(A_FSIN,S_NO)
|
emit_none(A_FSIN,S_NO)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user