* fixed a bug in int64/qword handling was a quite ugly one

This commit is contained in:
florian 2000-02-18 21:25:48 +00:00
parent ee7ff843ae
commit 904bfac5b9
3 changed files with 52 additions and 33 deletions

View File

@ -1690,23 +1690,13 @@ implementation
begin
hregister:=p^.location.registerlow;
hregister2:=p^.location.registerhigh;
emit_ref_reg(A_MOV,S_L,
newreference(p^.left^.location.reference),hregister);
hr:=newreference(p^.left^.location.reference);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,
hr,hregister2);
emit_mov_ref_reg64(p^.left^.location.reference,hregister,hregister2);
end
else
begin
hregister:=getregister32;
hregister2:=getregister32;
emit_ref_reg(A_MOV,S_L,
newreference(p^.left^.location.reference),hregister);
hr:=newreference(p^.left^.location.reference);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,
hr,hregister2);
emit_mov_ref_reg64(p^.left^.location.reference,hregister,hregister2);
end;
end;
clear_location(p^.location);
@ -2277,7 +2267,10 @@ implementation
end.
{
$Log$
Revision 1.95 2000-02-18 16:13:28 florian
Revision 1.96 2000-02-18 21:25:48 florian
* fixed a bug in int64/qword handling was a quite ugly one
Revision 1.95 2000/02/18 16:13:28 florian
* optimized ansistring compare with ''
* fixed 852

View File

@ -365,11 +365,8 @@ implementation
del_reference(p^.left^.location.reference);
hregisterlow:=getregister32;
hregisterhigh:=getregister32;
emit_ref_reg(A_MOV,S_L,newreference(p^.left^.location.reference),
hregisterlow);
hr:=newreference(p^.left^.location.reference);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,hr,
emit_mov_ref_reg64(p^.left^.location.reference,
hregisterlow,
hregisterhigh);
end;
end
@ -706,12 +703,9 @@ implementation
del_reference(p^.left^.location.reference);
p^.location.registerlow:=getregister32;
p^.location.registerhigh:=getregister32;
emit_ref_reg(A_MOV,S_L,
newreference(p^.left^.location.reference),p^.location.registerlow);
hr:=newreference(p^.left^.location.reference);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,
hr,p^.location.registerhigh);
emit_mov_ref_reg64(p^.left^.location.reference,
p^.location.registerlow,
p^.location.registerhigh);
end;
end;
{
@ -956,12 +950,9 @@ implementation
del_reference(p^.left^.location.reference);
p^.location.registerlow:=getregister32;
p^.location.registerhigh:=getregister32;
emit_ref_reg(A_MOV,S_L,
newreference(p^.left^.location.reference),p^.location.registerlow);
hr:=newreference(p^.left^.location.reference);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,
hr,p^.location.registerhigh);
emit_mov_ref_reg64(p^.left^.location.reference,
p^.location.registerlow,
p^.location.registerhigh);
emit_reg(A_NOT,S_L,p^.location.registerlow);
emit_reg(A_NOT,S_L,p^.location.registerhigh);
end;
@ -1001,7 +992,10 @@ implementation
end.
{
$Log$
Revision 1.42 2000-02-09 13:22:47 peter
Revision 1.43 2000-02-18 21:25:48 florian
* fixed a bug in int64/qword handling was a quite ugly one
Revision 1.42 2000/02/09 13:22:47 peter
* log truncated
Revision 1.41 2000/01/27 15:46:00 florian
@ -1056,4 +1050,4 @@ end.
* moved bitmask constants to sets
* some other type/const renamings
}
}

View File

@ -68,6 +68,7 @@ unit cgai386;
procedure emit_mov_loc_ref(const t:tlocation;const ref:treference;siz:topsize);
procedure emit_mov_loc_reg(const t:tlocation;reg:tregister);
procedure emit_mov_ref_reg64(r : treference;rl,rh : tregister);
procedure emit_lea_loc_ref(const t:tlocation;const ref:treference;freetemp:boolean);
procedure emit_lea_loc_reg(const t:tlocation;reg:tregister;freetemp:boolean);
procedure emit_push_loc(const t:tlocation);
@ -852,6 +853,34 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
end;
end;
procedure emit_mov_ref_reg64(r : treference;rl,rh : tregister);
var
hr : preference;
begin
{ if we load a 64 bit reference, we must be careful because }
{ we could overwrite the registers of the reference by }
{ accident }
if r.base=rl then
begin
emit_reg_reg(A_MOV,S_L,r.base,
R_EDI);
r.base:=R_EDI;
end
else if r.index=rl then
begin
emit_reg_reg(A_MOV,S_L,r.index,
R_EDI);
r.index:=R_EDI;
end;
emit_ref_reg(A_MOV,S_L,
newreference(r),rl);
hr:=newreference(r);
inc(hr^.offset,4);
emit_ref_reg(A_MOV,S_L,
hr,rh);
end;
{*****************************************************************************
Emit String Functions
@ -3752,7 +3781,10 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
end.
{
$Log$
Revision 1.82 2000-02-18 20:53:14 pierre
Revision 1.83 2000-02-18 21:25:48 florian
* fixed a bug in int64/qword handling was a quite ugly one
Revision 1.82 2000/02/18 20:53:14 pierre
* fixes a stabs problem for functions
+ includes a stabs local var for with statements
the name is with in lowercase followed by an index