mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-17 17:29:24 +02:00
+ better code for type conversation longint/dword to real type
This commit is contained in:
parent
36a555ead1
commit
6ca0a4d19b
@ -647,10 +647,12 @@ implementation
|
|||||||
|
|
||||||
var
|
var
|
||||||
r : preference;
|
r : preference;
|
||||||
|
hregister : tregister;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ for u32bit a solution is to push $0 and to load a comp }
|
{ for u32bit a solution is to push $0 and to load a comp }
|
||||||
{ does this first, it destroys maybe EDI }
|
{ does this first, it destroys maybe EDI }
|
||||||
|
hregister:=R_EDI;
|
||||||
if porddef(p^.left^.resulttype)^.typ=u32bit then
|
if porddef(p^.left^.resulttype)^.typ=u32bit then
|
||||||
push_int(0);
|
push_int(0);
|
||||||
if (p^.left^.location.loc=LOC_REGISTER) or
|
if (p^.left^.location.loc=LOC_REGISTER) or
|
||||||
@ -661,7 +663,8 @@ implementation
|
|||||||
u8bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BL,p^.left^.location.register,R_EDI)));
|
u8bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BL,p^.left^.location.register,R_EDI)));
|
||||||
s16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVSX,S_WL,p^.left^.location.register,R_EDI)));
|
s16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVSX,S_WL,p^.left^.location.register,R_EDI)));
|
||||||
u16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_WL,p^.left^.location.register,R_EDI)));
|
u16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_WL,p^.left^.location.register,R_EDI)));
|
||||||
u32bit,s32bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOV,S_L,p^.left^.location.register,R_EDI)));
|
u32bit,s32bit:
|
||||||
|
hregister:=p^.left^.location.register
|
||||||
end;
|
end;
|
||||||
ungetregister(p^.left^.location.register);
|
ungetregister(p^.left^.location.register);
|
||||||
end
|
end
|
||||||
@ -678,7 +681,7 @@ implementation
|
|||||||
del_reference(p^.left^.location.reference);
|
del_reference(p^.left^.location.reference);
|
||||||
ungetiftemp(p^.left^.location.reference);
|
ungetiftemp(p^.left^.location.reference);
|
||||||
end;
|
end;
|
||||||
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,hregister)));
|
||||||
r:=new_reference(R_ESP,0);
|
r:=new_reference(R_ESP,0);
|
||||||
if porddef(p^.left^.resulttype)^.typ=u32bit then
|
if porddef(p^.left^.resulttype)^.typ=u32bit then
|
||||||
exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)))
|
exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)))
|
||||||
@ -1249,7 +1252,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 1998-09-03 16:24:50 florian
|
Revision 1.16 1998-09-03 17:39:03 florian
|
||||||
|
+ better code for type conversation longint/dword to real type
|
||||||
|
|
||||||
|
Revision 1.15 1998/09/03 16:24:50 florian
|
||||||
* bug of type conversation from dword to real fixed
|
* bug of type conversation from dword to real fixed
|
||||||
* bug fix of Jonas applied
|
* bug fix of Jonas applied
|
||||||
|
|
||||||
|
@ -68,7 +68,8 @@ uses
|
|||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
,linux
|
,linux
|
||||||
{$endif}
|
{$endif}
|
||||||
,dos;
|
,dos
|
||||||
|
,win_targ;
|
||||||
|
|
||||||
{$ifndef linux}
|
{$ifndef linux}
|
||||||
Procedure Shell(command:string);
|
Procedure Shell(command:string);
|
||||||
@ -424,6 +425,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
DoExec(bindbin,s,false,false);
|
DoExec(bindbin,s,false,false);
|
||||||
end;
|
end;
|
||||||
|
if target_info.target=target_Win32 then
|
||||||
|
win_targ.postprocessexecutable;
|
||||||
{Remove ReponseFile}
|
{Remove ReponseFile}
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_extern in aktglobalswitches) then
|
||||||
RemoveFile(LinkResName);
|
RemoveFile(LinkResName);
|
||||||
@ -488,7 +491,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.22 1998-09-01 09:01:00 peter
|
Revision 1.23 1998-09-03 17:39:04 florian
|
||||||
|
+ better code for type conversation longint/dword to real type
|
||||||
|
|
||||||
|
Revision 1.22 1998/09/01 09:01:00 peter
|
||||||
+ glibc2 support
|
+ glibc2 support
|
||||||
|
|
||||||
Revision 1.21 1998/08/31 12:26:26 peter
|
Revision 1.21 1998/08/31 12:26:26 peter
|
||||||
|
@ -183,7 +183,8 @@ unit Ra386dir;
|
|||||||
{$ifdef TESTGLOBALVAR}
|
{$ifdef TESTGLOBALVAR}
|
||||||
getsym(upper(hs),false);
|
getsym(upper(hs),false);
|
||||||
sym:=srsym;
|
sym:=srsym;
|
||||||
if assigned(sym) and (sym^.owner^.symtabletype in [unitsymtable,globalsymtable,staticsymtable]) then
|
if assigned(sym) and (sym^.owner^.symtabletype in [unitsymtable,
|
||||||
|
globalsymtable,staticsymtable]) then
|
||||||
begin
|
begin
|
||||||
if (sym^.typ = varsym) or (sym^.typ = typedconstsym) then
|
if (sym^.typ = varsym) or (sym^.typ = typedconstsym) then
|
||||||
begin
|
begin
|
||||||
@ -261,7 +262,10 @@ unit Ra386dir;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 1998-09-03 17:08:47 pierre
|
Revision 1.7 1998-09-03 17:39:05 florian
|
||||||
|
+ better code for type conversation longint/dword to real type
|
||||||
|
|
||||||
|
Revision 1.6 1998/09/03 17:08:47 pierre
|
||||||
* better lines for stabs
|
* better lines for stabs
|
||||||
(no scroll back to if before else part
|
(no scroll back to if before else part
|
||||||
no return to case line at jump outside case)
|
no return to case line at jump outside case)
|
||||||
|
@ -35,6 +35,9 @@ unit win_targ;
|
|||||||
procedure generatelib;virtual;
|
procedure generatelib;virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ sets some flags of the executable }
|
||||||
|
procedure postprocessexecutable;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -176,10 +179,19 @@ unit win_targ;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure postprocessexecutable;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 1998-08-10 14:50:38 peter
|
Revision 1.7 1998-09-03 17:39:06 florian
|
||||||
|
+ better code for type conversation longint/dword to real type
|
||||||
|
|
||||||
|
Revision 1.6 1998/08/10 14:50:38 peter
|
||||||
+ localswitches, moduleswitches, globalswitches splitting
|
+ localswitches, moduleswitches, globalswitches splitting
|
||||||
|
|
||||||
Revision 1.5 1998/06/10 10:43:18 peter
|
Revision 1.5 1998/06/10 10:43:18 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user