mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:29:14 +02:00
* changed edi allocation to use getexplicitregister32/ungetregister
(adapted tgeni386 a bit for this) and enabled it by default * fixed very big and stupid bug of mine in cg386mat that broke the include() code (and make cycle :( ) if you compiled without -dnewoptimizations
This commit is contained in:
parent
86ff0db0b5
commit
23d69a5126
@ -1053,26 +1053,24 @@ implementation
|
|||||||
popedx:=true;
|
popedx:=true;
|
||||||
end;
|
end;
|
||||||
{ p^.left^.location can be R_EAX !!! }
|
{ p^.left^.location can be R_EAX !!! }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emitloadord2reg(p^.left^.location,u32bitdef,R_EDI,true);
|
emitloadord2reg(p^.left^.location,u32bitdef,R_EDI,true);
|
||||||
emitloadord2reg(p^.right^.location,u32bitdef,R_EAX,true);
|
emitloadord2reg(p^.right^.location,u32bitdef,R_EAX,true);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if R_EDX in unused then
|
if R_EDX in unused then
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDX)));
|
exprasmlist^.concat(new(pairegalloc,alloc(R_EDX)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_MUL,S_L,R_EDI);
|
emit_reg(A_MUL,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
if R_EDX in unused then
|
||||||
|
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDX)));
|
||||||
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,S_L,R_EAX,p^.location.register);
|
emit_reg_reg(A_MOV,S_L,R_EAX,p^.location.register);
|
||||||
if popedx then
|
if popedx then
|
||||||
emit_reg(A_POP,S_L,R_EDX);
|
emit_reg(A_POP,S_L,R_EDX);
|
||||||
{$ifdef AllocEDI}
|
|
||||||
if R_EDX in unused then
|
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDX)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
if popeax then
|
if popeax then
|
||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
{$IfNDef NoShlMul}
|
{$IfNDef NoShlMul}
|
||||||
@ -1166,31 +1164,31 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
emit_reg(A_NOT,opsize,p^.location.register);
|
emit_reg(A_NOT,opsize,p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,opsize,p^.right^.location.register,R_EDI);
|
emit_reg_reg(A_MOV,opsize,p^.right^.location.register,R_EDI);
|
||||||
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
emit_reg(A_NOT,opsize,p^.location.register);
|
emit_reg(A_NOT,opsize,p^.location.register);
|
||||||
|
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,opsize,
|
emit_ref_reg(A_MOV,opsize,
|
||||||
newreference(p^.right^.location.reference),R_EDI);
|
newreference(p^.right^.location.reference),R_EDI);
|
||||||
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
ungetiftemp(p^.right^.location.reference);
|
ungetiftemp(p^.right^.location.reference);
|
||||||
del_reference(p^.right^.location.reference);
|
del_reference(p^.right^.location.reference);
|
||||||
end;
|
end;
|
||||||
@ -1234,16 +1232,16 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,S_L,p^.right^.location.register,R_EDI);
|
emit_reg_reg(A_MOV,S_L,p^.right^.location.register,R_EDI);
|
||||||
emit_reg(A_NOT,S_L,R_EDI);
|
emit_reg(A_NOT,S_L,R_EDI);
|
||||||
emit_reg_reg(A_AND,S_L,R_EDI,
|
emit_reg_reg(A_AND,S_L,R_EDI,
|
||||||
p^.location.register);
|
p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1255,17 +1253,17 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,newreference(
|
emit_ref_reg(A_MOV,S_L,newreference(
|
||||||
p^.right^.location.reference),R_EDI);
|
p^.right^.location.reference),R_EDI);
|
||||||
emit_reg(A_NOT,S_L,R_EDI);
|
emit_reg(A_NOT,S_L,R_EDI);
|
||||||
emit_reg_reg(A_AND,S_L,R_EDI,
|
emit_reg_reg(A_AND,S_L,R_EDI,
|
||||||
p^.location.register);
|
p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1659,37 +1657,37 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if p^.right^.location.loc=LOC_CREGISTER then
|
if p^.right^.location.loc=LOC_CREGISTER then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,opsize,p^.right^.location.register,R_EDI);
|
emit_reg_reg(A_MOV,opsize,p^.right^.location.register,R_EDI);
|
||||||
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,opsize,p^.right^.location.registerhigh,R_EDI);
|
emit_reg_reg(A_MOV,opsize,p^.right^.location.registerhigh,R_EDI);
|
||||||
{ the carry flag is still ok }
|
{ the carry flag is still ok }
|
||||||
emit_reg_reg(op2,opsize,p^.location.registerhigh,R_EDI);
|
emit_reg_reg(op2,opsize,p^.location.registerhigh,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.registerhigh);
|
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.registerhigh);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,opsize,
|
emit_ref_reg(A_MOV,opsize,
|
||||||
newreference(p^.right^.location.reference),R_EDI);
|
newreference(p^.right^.location.reference),R_EDI);
|
||||||
emit_reg_reg(op,opsize,p^.location.registerlow,R_EDI);
|
emit_reg_reg(op,opsize,p^.location.registerlow,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.registerlow);
|
emit_reg_reg(A_MOV,opsize,R_EDI,p^.location.registerlow);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
hr:=newreference(p^.right^.location.reference);
|
hr:=newreference(p^.right^.location.reference);
|
||||||
inc(hr^.offset,4);
|
inc(hr^.offset,4);
|
||||||
emit_ref_reg(A_MOV,opsize,
|
emit_ref_reg(A_MOV,opsize,
|
||||||
@ -1698,9 +1696,9 @@ implementation
|
|||||||
emit_reg_reg(op2,opsize,p^.location.registerhigh,R_EDI);
|
emit_reg_reg(op2,opsize,p^.location.registerhigh,R_EDI);
|
||||||
emit_reg_reg(A_MOV,opsize,R_EDI,
|
emit_reg_reg(A_MOV,opsize,R_EDI,
|
||||||
p^.location.registerhigh);
|
p^.location.registerhigh);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
ungetiftemp(p^.right^.location.reference);
|
ungetiftemp(p^.right^.location.reference);
|
||||||
del_reference(p^.right^.location.reference);
|
del_reference(p^.right^.location.reference);
|
||||||
end;
|
end;
|
||||||
@ -1950,9 +1948,9 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if not(R_EAX in unused) then
|
if not(R_EAX in unused) then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,S_L,R_EAX,R_EDI);
|
emit_reg_reg(A_MOV,S_L,R_EAX,R_EDI);
|
||||||
end;
|
end;
|
||||||
emit_reg(A_FNSTSW,S_NO,R_AX);
|
emit_reg(A_FNSTSW,S_NO,R_AX);
|
||||||
@ -1960,9 +1958,9 @@ implementation
|
|||||||
if not(R_EAX in unused) then
|
if not(R_EAX in unused) then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(A_MOV,S_L,R_EDI,R_EAX);
|
emit_reg_reg(A_MOV,S_L,R_EDI,R_EAX);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
if p^.swaped then
|
if p^.swaped then
|
||||||
begin
|
begin
|
||||||
@ -2143,9 +2141,11 @@ implementation
|
|||||||
if p^.right^.location.loc=LOC_CMMXREGISTER then
|
if p^.right^.location.loc=LOC_CMMXREGISTER then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(A_MOVQ,S_NO,p^.right^.location.register,R_MM7);
|
emit_reg_reg(A_MOVQ,S_NO,p^.right^.location.register,R_MM7);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
{ where does the result of this (R_EDI) get used?? }
|
{ where does the result of this (R_EDI) get used?? No }
|
||||||
{$endif AllocEDI}
|
{ allocinfo for EDI added, because it doesn't seem to be }
|
||||||
|
{ used anyway }
|
||||||
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(op,S_NO,p^.location.register,R_EDI);
|
emit_reg_reg(op,S_NO,p^.location.register,R_EDI);
|
||||||
emit_reg_reg(A_MOVQ,S_NO,R_MM7,p^.location.register);
|
emit_reg_reg(A_MOVQ,S_NO,R_MM7,p^.location.register);
|
||||||
end
|
end
|
||||||
@ -2206,7 +2206,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.85 2000-01-09 01:44:18 jonas
|
Revision 1.86 2000-01-09 12:34:59 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.85 2000/01/09 01:44:18 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -120,16 +120,16 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(p^.left^.location.reference),R_EDI);
|
newreference(p^.left^.location.reference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emitpushreferenceaddr(p^.left^.location.reference);
|
emitpushreferenceaddr(p^.left^.location.reference);
|
||||||
@ -146,16 +146,16 @@ implementation
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(p^.left^.location.reference),R_EDI);
|
newreference(p^.left^.location.reference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emitpushreferenceaddr(p^.left^.location.reference);
|
emitpushreferenceaddr(p^.left^.location.reference);
|
||||||
@ -177,17 +177,16 @@ implementation
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(p^.left^.location.reference),R_EDI);
|
newreference(p^.left^.location.reference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
emit_reg_ref(A_MOV,S_L,
|
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
||||||
R_EDI,r);
|
{$ifndef noAllocEdi}
|
||||||
{$ifdef AllocEDI}
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
{$endif noAllocEdi}
|
||||||
{$endif AllocEDI}
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emitpushreferenceaddr(p^.left^.location.reference);
|
emitpushreferenceaddr(p^.left^.location.reference);
|
||||||
@ -423,16 +422,16 @@ implementation
|
|||||||
{$endif not OLD_C_STACK}
|
{$endif not OLD_C_STACK}
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(funcretref),R_EDI);
|
newreference(funcretref),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,inlinecode^.retoffset);
|
r:=new_reference(procinfo^.framepointer,inlinecode^.retoffset);
|
||||||
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
emit_reg_ref(A_MOV,S_L,R_EDI,r);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emitpushreferenceaddr(funcretref);
|
emitpushreferenceaddr(funcretref);
|
||||||
@ -778,9 +777,9 @@ implementation
|
|||||||
r^.base:=R_ESI;
|
r^.base:=R_ESI;
|
||||||
{ this is one point where we need vmt_offset (PM) }
|
{ this is one point where we need vmt_offset (PM) }
|
||||||
r^.offset:= pprocdef(p^.procdefinition)^._class^.vmt_offset;
|
r^.offset:= pprocdef(p^.procdefinition)^._class^.vmt_offset;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
||||||
new(r);
|
new(r);
|
||||||
reset_reference(r^);
|
reset_reference(r^);
|
||||||
@ -820,9 +819,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{$endif TESTOBJEXT}
|
{$endif TESTOBJEXT}
|
||||||
emit_ref(A_CALL,S_NO,r);
|
emit_ref(A_CALL,S_NO,r);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else if not inlined then
|
else if not inlined then
|
||||||
emitcall(pprocdef(p^.procdefinition)^.mangledname)
|
emitcall(pprocdef(p^.procdefinition)^.mangledname)
|
||||||
@ -858,9 +857,9 @@ implementation
|
|||||||
(p^.right^.location.reference.index=R_ESI) then
|
(p^.right^.location.reference.index=R_ESI) then
|
||||||
begin
|
begin
|
||||||
del_reference(p^.right^.location.reference);
|
del_reference(p^.right^.location.reference);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(p^.right^.location.reference),R_EDI);
|
newreference(p^.right^.location.reference),R_EDI);
|
||||||
hregister:=R_EDI;
|
hregister:=R_EDI;
|
||||||
@ -882,11 +881,14 @@ implementation
|
|||||||
emit_ref(A_CALL,S_NO,newreference(p^.right^.location.reference))
|
emit_ref(A_CALL,S_NO,newreference(p^.right^.location.reference))
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hregister = R_EDI then
|
ungetregister32(hregister);
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)))
|
{$else noAllocEdi}
|
||||||
else ungetregister32(hregister);
|
{ the same code, the previous line is just to }
|
||||||
{$endif AllocEDI}
|
{ indicate EDI actually is deallocated if allocated }
|
||||||
|
{ above (JM) }
|
||||||
|
ungetregister32(hregister);
|
||||||
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_CALL,S_NO,hregister);
|
emit_reg(A_CALL,S_NO,hregister);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -918,13 +920,13 @@ implementation
|
|||||||
{ better than an add on all processors }
|
{ better than an add on all processors }
|
||||||
if pushedparasize=4 then
|
if pushedparasize=4 then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_EDI);
|
emit_reg(A_POP,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
{ the pentium has two pipes and pop reg is pairable }
|
{ the pentium has two pipes and pop reg is pairable }
|
||||||
{ but the registers must be different! }
|
{ but the registers must be different! }
|
||||||
@ -933,20 +935,20 @@ implementation
|
|||||||
(aktoptprocessor=ClassP5) and
|
(aktoptprocessor=ClassP5) and
|
||||||
(procinfo^._class=nil) then
|
(procinfo^._class=nil) then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_EDI);
|
emit_reg(A_POP,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_ESI);
|
emit_reg(A_POP,S_L,R_ESI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else if pushedparasize<>0 then
|
else if pushedparasize<>0 then
|
||||||
emit_const_reg(A_ADD,S_L,pushedparasize,R_ESP);
|
emit_const_reg(A_ADD,S_L,pushedparasize,R_ESP);
|
||||||
@ -1289,7 +1291,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.115 2000-01-09 01:44:19 jonas
|
Revision 1.116 2000-01-09 12:35:00 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.115 2000/01/09 01:44:19 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -98,9 +98,9 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ not so elegant (goes better with extra register }
|
{ not so elegant (goes better with extra register }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if (p^.right^.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
|
if (p^.right^.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(A_MOV,S_L,makereg32(p^.right^.location.register),R_EDI);
|
emit_reg_reg(A_MOV,S_L,makereg32(p^.right^.location.register),R_EDI);
|
||||||
@ -114,9 +114,9 @@ implementation
|
|||||||
emit_const_reg(A_SHL,S_L,8,R_EDI);
|
emit_const_reg(A_SHL,S_L,8,R_EDI);
|
||||||
emit_const_reg(A_OR,S_L,1,R_EDI);
|
emit_const_reg(A_OR,S_L,1,R_EDI);
|
||||||
emit_reg_ref(A_MOV,S_W,R_DI,newreference(p^.left^.location.reference));
|
emit_reg_ref(A_MOV,S_W,R_DI,newreference(p^.left^.location.reference));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
@ -701,10 +701,10 @@ implementation
|
|||||||
if (pfrom^.location.loc=LOC_REGISTER) or
|
if (pfrom^.location.loc=LOC_REGISTER) or
|
||||||
(pfrom^.location.loc=LOC_CREGISTER) then
|
(pfrom^.location.loc=LOC_CREGISTER) then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if not (porddef(pfrom^.resulttype)^.typ in [u32bit,s32bit,u64bit,s64bit]) then
|
if not (porddef(pfrom^.resulttype)^.typ in [u32bit,s32bit,u64bit,s64bit]) then
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
case porddef(pfrom^.resulttype)^.typ of
|
case porddef(pfrom^.resulttype)^.typ of
|
||||||
s8bit : emit_reg_reg(A_MOVSX,S_BL,pfrom^.location.register,R_EDI);
|
s8bit : emit_reg_reg(A_MOVSX,S_BL,pfrom^.location.register,R_EDI);
|
||||||
u8bit : emit_reg_reg(A_MOVZX,S_BL,pfrom^.location.register,R_EDI);
|
u8bit : emit_reg_reg(A_MOVZX,S_BL,pfrom^.location.register,R_EDI);
|
||||||
@ -723,9 +723,9 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
r:=newreference(pfrom^.location.reference);
|
r:=newreference(pfrom^.location.reference);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
case porddef(pfrom^.resulttype)^.typ of
|
case porddef(pfrom^.resulttype)^.typ of
|
||||||
s8bit:
|
s8bit:
|
||||||
emit_ref_reg(A_MOVSX,S_BL,r,R_EDI);
|
emit_ref_reg(A_MOVSX,S_BL,r,R_EDI);
|
||||||
@ -751,10 +751,10 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{ for 64 bit integers, the high dword is already pushed }
|
{ for 64 bit integers, the high dword is already pushed }
|
||||||
emit_reg(A_PUSH,S_L,hregister);
|
emit_reg(A_PUSH,S_L,hregister);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hregister = R_EDI then
|
if hregister = R_EDI then
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
r:=new_reference(R_ESP,0);
|
r:=new_reference(R_ESP,0);
|
||||||
case porddef(pfrom^.resulttype)^.typ of
|
case porddef(pfrom^.resulttype)^.typ of
|
||||||
u32bit:
|
u32bit:
|
||||||
@ -774,16 +774,16 @@ implementation
|
|||||||
{ if it is 1 then we add $80000000 000000000 }
|
{ if it is 1 then we add $80000000 000000000 }
|
||||||
{ as double }
|
{ as double }
|
||||||
inc(r^.offset,4);
|
inc(r^.offset,4);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
||||||
r:=new_reference(R_ESP,4);
|
r:=new_reference(R_ESP,4);
|
||||||
emit_const_ref(A_AND,S_L,$7fffffff,r);
|
emit_const_ref(A_AND,S_L,$7fffffff,r);
|
||||||
emit_const_reg(A_TEST,S_L,$80000000,R_EDI);
|
emit_const_reg(A_TEST,S_L,$80000000,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
r:=new_reference(R_ESP,0);
|
r:=new_reference(R_ESP,0);
|
||||||
emit_ref(A_FILD,S_IQ,r);
|
emit_ref(A_FILD,S_IQ,r);
|
||||||
getdatalabel(l1);
|
getdatalabel(l1);
|
||||||
@ -802,13 +802,13 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
emit_ref(A_FILD,S_IL,r);
|
emit_ref(A_FILD,S_IL,r);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_EDI);
|
emit_reg(A_POP,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
inc(fpuvaroffset);
|
inc(fpuvaroffset);
|
||||||
@ -847,13 +847,13 @@ implementation
|
|||||||
rreg:=getregister32;
|
rreg:=getregister32;
|
||||||
emit_reg(A_POP,S_L,rreg);
|
emit_reg(A_POP,S_L,rreg);
|
||||||
{ better than an add on all processors }
|
{ better than an add on all processors }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_EDI);
|
emit_reg(A_POP,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
|
|
||||||
clear_location(pto^.location);
|
clear_location(pto^.location);
|
||||||
pto^.location.loc:=LOC_REGISTER;
|
pto^.location.loc:=LOC_REGISTER;
|
||||||
@ -1390,31 +1390,31 @@ implementation
|
|||||||
r^.base:=p^.location.register
|
r^.base:=p^.location.register
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_mov_loc_reg(p^.location,R_EDI);
|
emit_mov_loc_reg(p^.location,R_EDI);
|
||||||
r^.base:=R_EDI;
|
r^.base:=R_EDI;
|
||||||
end;
|
end;
|
||||||
{ NIL must be accepted !! }
|
{ NIL must be accepted !! }
|
||||||
emit_reg_reg(A_OR,S_L,r^.base,r^.base);
|
emit_reg_reg(A_OR,S_L,r^.base,r^.base);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
getlabel(nillabel);
|
getlabel(nillabel);
|
||||||
emitjmp(C_E,nillabel);
|
emitjmp(C_E,nillabel);
|
||||||
{ this is one point where we need vmt_offset (PM) }
|
{ this is one point where we need vmt_offset (PM) }
|
||||||
r^.offset:= pobjectdef(ppointerdef(p^.resulttype)^.definition)^.vmt_offset;
|
r^.offset:= pobjectdef(ppointerdef(p^.resulttype)^.definition)^.vmt_offset;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
emit_ref_reg(A_MOV,S_L,r,R_EDI);
|
||||||
emit_sym(A_PUSH,S_L,
|
emit_sym(A_PUSH,S_L,
|
||||||
newasmsymbol(pobjectdef(ppointerdef(p^.resulttype)^.definition)^.vmt_mangledname));
|
newasmsymbol(pobjectdef(ppointerdef(p^.resulttype)^.definition)^.vmt_mangledname));
|
||||||
emit_reg(A_PUSH,S_L,R_EDI);
|
emit_reg(A_PUSH,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emitcall('FPC_CHECK_OBJECT_EXT');
|
emitcall('FPC_CHECK_OBJECT_EXT');
|
||||||
emitlab(nillabel);
|
emitlab(nillabel);
|
||||||
end;
|
end;
|
||||||
@ -1533,7 +1533,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.99 2000-01-09 01:44:19 jonas
|
Revision 1.100 2000-01-09 12:35:00 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.99 2000/01/09 01:44:19 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -191,9 +191,9 @@ implementation
|
|||||||
reset_reference(r^);
|
reset_reference(r^);
|
||||||
r^.symbol:=newasmsymbol(
|
r^.symbol:=newasmsymbol(
|
||||||
'U_'+upper(target_info.system_unit)+io[doread]);
|
'U_'+upper(target_info.system_unit)+io[doread]);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,r,R_EDI)
|
emit_ref_reg(A_LEA,S_L,r,R_EDI)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -236,9 +236,9 @@ implementation
|
|||||||
loadstream;
|
loadstream;
|
||||||
{ save @aktfile in temporary variable }
|
{ save @aktfile in temporary variable }
|
||||||
emit_reg_ref(A_MOV,S_L,R_EDI,newreference(aktfile));
|
emit_reg_ref(A_MOV,S_L,R_EDI,newreference(aktfile));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -264,9 +264,9 @@ implementation
|
|||||||
CGMessage(cg_e_illegal_expression);
|
CGMessage(cg_e_illegal_expression);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
|
|
||||||
emit_ref_reg(A_LEA,S_L,newreference(node^.left^.location.reference),R_EDI);
|
emit_ref_reg(A_LEA,S_L,newreference(node^.left^.location.reference),R_EDI);
|
||||||
|
|
||||||
@ -281,9 +281,9 @@ implementation
|
|||||||
|
|
||||||
{ save @aktfile in temporary variable }
|
{ save @aktfile in temporary variable }
|
||||||
emit_reg_ref(A_MOV,S_L,R_EDI,newreference(aktfile));
|
emit_reg_ref(A_MOV,S_L,R_EDI,newreference(aktfile));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if doread then
|
if doread then
|
||||||
{ parameter by READ gives call by reference }
|
{ parameter by READ gives call by reference }
|
||||||
dummycoll.paratyp:=vs_var
|
dummycoll.paratyp:=vs_var
|
||||||
@ -798,21 +798,21 @@ implementation
|
|||||||
{load the address of the code parameter}
|
{load the address of the code parameter}
|
||||||
secondpass(code_para^.left);
|
secondpass(code_para^.left);
|
||||||
{move the code to its destination}
|
{move the code to its destination}
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,NewReference(hr),R_EDI);
|
emit_ref_reg(A_MOV,S_L,NewReference(hr),R_EDI);
|
||||||
emit_mov_reg_loc(R_DI,code_para^.left^.location);
|
emit_mov_reg_loc(R_DI,code_para^.left^.location);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
Disposetree(code_para);
|
Disposetree(code_para);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{restore the address of the result}
|
{restore the address of the result}
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg(A_POP,S_L,R_EDI);
|
emit_reg(A_POP,S_L,R_EDI);
|
||||||
|
|
||||||
{set up hr2 to a refernce with EDI as base register}
|
{set up hr2 to a refernce with EDI as base register}
|
||||||
@ -845,9 +845,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
If (cs_check_range in aktlocalswitches) and
|
If (cs_check_range in aktlocalswitches) and
|
||||||
(dest_para^.left^.resulttype^.deftype = orddef) and
|
(dest_para^.left^.resulttype^.deftype = orddef) and
|
||||||
(not(is_64bitint(dest_para^.left^.resulttype))) and
|
(not(is_64bitint(dest_para^.left^.resulttype))) and
|
||||||
@ -1380,9 +1380,9 @@ implementation
|
|||||||
hregister:=p^.left^.right^.left^.location.register
|
hregister:=p^.left^.right^.left^.location.register
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
hregister:=R_EDI;
|
hregister:=R_EDI;
|
||||||
opsize:=def2def_opsize(p^.left^.right^.left^.resulttype,u32bitdef);
|
opsize:=def2def_opsize(p^.left^.right^.left^.resulttype,u32bitdef);
|
||||||
if opsize in [S_B,S_W,S_L] then
|
if opsize in [S_B,S_W,S_L] then
|
||||||
@ -1398,10 +1398,10 @@ implementation
|
|||||||
else
|
else
|
||||||
emit_reg_reg(asmop,S_L,hregister,
|
emit_reg_reg(asmop,S_L,hregister,
|
||||||
p^.left^.left^.location.register);
|
p^.left^.left^.location.register);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hregister = R_EDI then
|
if hregister = R_EDI then
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1510,7 +1510,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.88 2000-01-09 01:44:19 jonas
|
Revision 1.89 2000-01-09 12:35:00 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.88 2000/01/09 01:44:19 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -300,9 +300,9 @@ implementation
|
|||||||
LOC_MEM,
|
LOC_MEM,
|
||||||
LOC_REFERENCE:
|
LOC_REFERENCE:
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
hregister:=R_EDI;
|
hregister:=R_EDI;
|
||||||
if pobjectdef(p^.left^.resulttype)^.is_class then
|
if pobjectdef(p^.left^.resulttype)^.is_class then
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
@ -346,15 +346,15 @@ implementation
|
|||||||
{ ... and store it }
|
{ ... and store it }
|
||||||
emit_reg_ref(A_MOV,S_L,
|
emit_reg_ref(A_MOV,S_L,
|
||||||
R_EDI,newreference(p^.location.reference));
|
R_EDI,newreference(p^.location.reference));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
s:=newasmsymbol(pprocsym(p^.symtableentry)^.definition^.mangledname);
|
s:=newasmsymbol(pprocsym(p^.symtableentry)^.definition^.mangledname);
|
||||||
emit_sym_ofs_ref(A_MOV,S_L,s,0,
|
emit_sym_ofs_ref(A_MOV,S_L,s,0,
|
||||||
newreference(p^.location.reference));
|
newreference(p^.location.reference));
|
||||||
@ -1005,7 +1005,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.95 2000-01-09 01:44:20 jonas
|
Revision 1.96 2000-01-09 12:35:01 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.95 2000/01/09 01:44:20 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -152,9 +152,9 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
hreg2 := R_EDI;
|
hreg2 := R_EDI;
|
||||||
emit_reg_reg(A_MOV,S_L,hreg1,R_EDI);
|
emit_reg_reg(A_MOV,S_L,hreg1,R_EDI);
|
||||||
{ if the left value is signed, R_EDI := $ffffffff,
|
{ if the left value is signed, R_EDI := $ffffffff,
|
||||||
@ -166,13 +166,13 @@ implementation
|
|||||||
{ add to the left value }
|
{ add to the left value }
|
||||||
emit_reg_reg(A_ADD,S_L,hreg2,hreg1);
|
emit_reg_reg(A_ADD,S_L,hreg2,hreg1);
|
||||||
{ release EDX if we used it }
|
{ release EDX if we used it }
|
||||||
if (hreg2 = R_EDX) then
|
{$ifndef noAllocEdi}
|
||||||
ungetregister32(hreg2)
|
{ also releas EDI }
|
||||||
{$ifdef AllocEDI}
|
ungetregister32(hreg2);
|
||||||
else
|
{$else noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)))
|
if (hreg2 = R_EDX) then
|
||||||
{$endif AllocEDI}
|
ungetregister32(hreg2);
|
||||||
;
|
{$endif noAllocEdi}
|
||||||
{ do the shift }
|
{ do the shift }
|
||||||
emit_const_reg(A_SAR,S_L,power,hreg1);
|
emit_const_reg(A_SAR,S_L,power,hreg1);
|
||||||
end
|
end
|
||||||
@ -188,6 +188,7 @@ implementation
|
|||||||
else
|
else
|
||||||
emit_const_reg(A_ADD,S_L,p^.right^.value-1,hreg1);
|
emit_const_reg(A_ADD,S_L,p^.right^.value-1,hreg1);
|
||||||
emitlab(hl);
|
emitlab(hl);
|
||||||
|
emit_const_reg(A_SAR,S_L,power,hreg1);
|
||||||
end
|
end
|
||||||
End
|
End
|
||||||
Else
|
Else
|
||||||
@ -207,9 +208,9 @@ implementation
|
|||||||
{ EDI is always free, it's }
|
{ EDI is always free, it's }
|
||||||
{ only used for temporary }
|
{ only used for temporary }
|
||||||
{ purposes }
|
{ purposes }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if (p^.right^.location.loc<>LOC_REGISTER) and
|
if (p^.right^.location.loc<>LOC_REGISTER) and
|
||||||
(p^.right^.location.loc<>LOC_CREGISTER) then
|
(p^.right^.location.loc<>LOC_CREGISTER) then
|
||||||
begin
|
begin
|
||||||
@ -261,9 +262,9 @@ implementation
|
|||||||
emit_reg(A_DIV,S_L,R_EDI)
|
emit_reg(A_DIV,S_L,R_EDI)
|
||||||
else
|
else
|
||||||
emit_reg(A_IDIV,S_L,R_EDI);
|
emit_reg(A_IDIV,S_L,R_EDI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if p^.treetype=divn then
|
if p^.treetype=divn then
|
||||||
begin
|
begin
|
||||||
{ if result register is busy then copy }
|
{ if result register is busy then copy }
|
||||||
@ -889,9 +890,9 @@ implementation
|
|||||||
secondpass(p^.left);
|
secondpass(p^.left);
|
||||||
p^.location.loc:=LOC_MMXREGISTER;
|
p^.location.loc:=LOC_MMXREGISTER;
|
||||||
{ prepare EDI }
|
{ prepare EDI }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_const_reg(A_MOV,S_L,$ffffffff,R_EDI);
|
emit_const_reg(A_MOV,S_L,$ffffffff,R_EDI);
|
||||||
{ load operand }
|
{ load operand }
|
||||||
case p^.left^.location.loc of
|
case p^.left^.location.loc of
|
||||||
@ -912,9 +913,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{ load mask }
|
{ load mask }
|
||||||
emit_reg_reg(A_MOVD,S_NO,R_EDI,R_MM7);
|
emit_reg_reg(A_MOVD,S_NO,R_EDI,R_MM7);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
{ lower 32 bit }
|
{ lower 32 bit }
|
||||||
emit_reg_reg(A_PXOR,S_D,R_MM7,p^.location.register);
|
emit_reg_reg(A_PXOR,S_D,R_MM7,p^.location.register);
|
||||||
{ shift mask }
|
{ shift mask }
|
||||||
@ -995,7 +996,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.39 2000-01-09 01:44:20 jonas
|
Revision 1.40 2000-01-09 12:35:01 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.39 2000/01/09 01:44:20 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -826,10 +826,10 @@ implementation
|
|||||||
p^.islocal:=true;
|
p^.islocal:=true;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ call can happend with a property }
|
{ call can have happend with a property }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if { (p^.left^.treetype=calln) and Don't think that
|
if { (p^.left^.treetype=calln) and Don't think that
|
||||||
this is necessary (FK) }
|
this is necessary (FK) }
|
||||||
(p^.left^.resulttype^.deftype=objectdef) and
|
(p^.left^.resulttype^.deftype=objectdef) and
|
||||||
@ -866,9 +866,9 @@ implementation
|
|||||||
{ move to temp reference }
|
{ move to temp reference }
|
||||||
emit_reg_ref(A_MOV,S_L,
|
emit_reg_ref(A_MOV,S_L,
|
||||||
R_EDI,newreference(p^.withreference^));
|
R_EDI,newreference(p^.withreference^));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
del_reference(p^.left^.location.reference);
|
del_reference(p^.left^.location.reference);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -891,7 +891,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.67 2000-01-09 01:44:20 jonas
|
Revision 1.68 2000-01-09 12:35:02 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.67 2000/01/09 01:44:20 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -371,9 +371,9 @@ implementation
|
|||||||
{ the set element isn't never samller than a byte }
|
{ the set element isn't never samller than a byte }
|
||||||
{ and because it's a small set we need only 5 bits }
|
{ and because it's a small set we need only 5 bits }
|
||||||
{ but 8 bits are easier to load }
|
{ but 8 bits are easier to load }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOVZX,S_BL,
|
emit_ref_reg(A_MOVZX,S_BL,
|
||||||
newreference(p^.left^.location.reference),R_EDI);
|
newreference(p^.left^.location.reference),R_EDI);
|
||||||
hr:=R_EDI;
|
hr:=R_EDI;
|
||||||
@ -403,11 +403,12 @@ implementation
|
|||||||
newreference(p^.right^.location.reference));
|
newreference(p^.right^.location.reference));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hr = R_EDI then
|
{ simply to indicate EDI is deallocated here too (JM) }
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
ungetregister32(hr);
|
ungetregister32(hr);
|
||||||
|
{$else noAllocEdi}
|
||||||
|
ungetregister32(hr);
|
||||||
|
{$endif noAllocEdi}
|
||||||
p^.location.loc:=LOC_FLAGS;
|
p^.location.loc:=LOC_FLAGS;
|
||||||
p^.location.resflags:=F_C;
|
p^.location.resflags:=F_C;
|
||||||
end;
|
end;
|
||||||
@ -905,7 +906,14 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.46 2000-01-09 01:44:21 jonas
|
Revision 1.47 2000-01-09 12:35:02 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.46 2000/01/09 01:44:21 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -448,10 +448,10 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
S_W : hreg:=R_DI;
|
S_W : hreg:=R_DI;
|
||||||
S_L : hreg:=R_EDI;
|
S_L : hreg:=R_EDI;
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hreg in [R_DI,R_EDI] then
|
if hreg in [R_DI,R_EDI] then
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,siz,
|
emit_ref_reg(A_MOV,siz,
|
||||||
newreference(t.reference),hreg);
|
newreference(t.reference),hreg);
|
||||||
del_reference(t.reference);
|
del_reference(t.reference);
|
||||||
@ -464,10 +464,10 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
else
|
else
|
||||||
ungetregister(hreg);
|
ungetregister(hreg);
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hreg in [R_DI,R_EDI] then
|
if hreg in [R_DI,R_EDI] then
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
{ we can release the registers }
|
{ we can release the registers }
|
||||||
{ but only AFTER the MOV! Important for the optimizer!
|
{ but only AFTER the MOV! Important for the optimizer!
|
||||||
(JM)}
|
(JM)}
|
||||||
@ -706,16 +706,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
internalerror(331)
|
internalerror(331)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(t.reference),R_EDI);
|
newreference(t.reference),R_EDI);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,
|
||||||
R_EDI,newreference(ref))));
|
R_EDI,newreference(ref))));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
{ release the registers }
|
{ release the registers }
|
||||||
del_reference(t.reference);
|
del_reference(t.reference);
|
||||||
@ -737,15 +737,15 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
internalerror(331)
|
internalerror(331)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,
|
emit_ref_reg(A_LEA,S_L,
|
||||||
newreference(t.reference),R_EDI);
|
newreference(t.reference),R_EDI);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
if freetemp then
|
if freetemp then
|
||||||
ungetiftemp(t.reference);
|
ungetiftemp(t.reference);
|
||||||
@ -988,9 +988,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
) then
|
) then
|
||||||
begin
|
begin
|
||||||
del_reference(p^.location.reference);
|
del_reference(p^.location.reference);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,newreference(p^.location.reference),
|
emit_ref_reg(A_LEA,S_L,newreference(p^.location.reference),
|
||||||
R_EDI);
|
R_EDI);
|
||||||
{$ifdef TEMPS_NOT_PUSH}
|
{$ifdef TEMPS_NOT_PUSH}
|
||||||
@ -1000,9 +1000,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
{$else TEMPS_NOT_PUSH}
|
{$else TEMPS_NOT_PUSH}
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
||||||
{$endif TEMPS_NOT_PUSH}
|
{$endif TEMPS_NOT_PUSH}
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
pushed:=true;
|
pushed:=true;
|
||||||
end
|
end
|
||||||
else pushed:=false;
|
else pushed:=false;
|
||||||
@ -1047,16 +1047,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
) then
|
) then
|
||||||
begin
|
begin
|
||||||
del_reference(p^.location.reference);
|
del_reference(p^.location.reference);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,newreference(p^.location.reference),
|
emit_ref_reg(A_LEA,S_L,newreference(p^.location.reference),
|
||||||
R_EDI);
|
R_EDI);
|
||||||
gettempofsizereference(href,4);
|
gettempofsizereference(href,4);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,href)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,href)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
p^.temp_offset:=href.offset;
|
p^.temp_offset:=href.offset;
|
||||||
pushed:=true;
|
pushed:=true;
|
||||||
end
|
end
|
||||||
@ -1075,14 +1075,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
not(cs_littlesize in aktglobalswitches)
|
not(cs_littlesize in aktglobalswitches)
|
||||||
Then
|
Then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_XOR,S_L,R_EDI,R_EDI);
|
emit_reg_reg(A_XOR,S_L,R_EDI,R_EDI);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
exprasmlist^.concat(new(paicpu,op_const(A_PUSH,S_L,l)));
|
exprasmlist^.concat(new(paicpu,op_const(A_PUSH,S_L,l)));
|
||||||
@ -1099,14 +1099,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
not(cs_littlesize in aktglobalswitches)
|
not(cs_littlesize in aktglobalswitches)
|
||||||
then
|
then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,newreference(ref),R_EDI);
|
emit_ref_reg(A_MOV,S_L,newreference(ref),R_EDI);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,S_L,newreference(ref))));
|
else exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,S_L,newreference(ref))));
|
||||||
end;
|
end;
|
||||||
@ -1141,14 +1141,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,ref.base)))
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,ref.base)))
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,newreference(ref),R_EDI);
|
emit_ref_reg(A_LEA,S_L,newreference(ref),R_EDI);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_PUSH,S_L,R_EDI)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1453,25 +1453,25 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(pushedparasize,8);
|
inc(pushedparasize,8);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
inc(tempreference.offset,4);
|
inc(tempreference.offset,4);
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize+4);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize+4);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1485,16 +1485,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1514,16 +1514,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end;
|
end;
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,opsize,
|
emit_ref_reg(A_MOV,opsize,
|
||||||
newreference(tempreference),hreg);
|
newreference(tempreference),hreg);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,opsize,hreg,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,opsize,hreg,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,opsize,
|
exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,opsize,
|
||||||
@ -1542,16 +1542,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1563,16 +1563,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(tempreference.offset,4);
|
inc(tempreference.offset,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1580,16 +1580,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
dec(tempreference.offset,4);
|
dec(tempreference.offset,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1603,16 +1603,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(tempreference.offset,6);
|
inc(tempreference.offset,6);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1620,16 +1620,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1649,16 +1649,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end;
|
end;
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,opsize,
|
emit_ref_reg(A_MOV,opsize,
|
||||||
newreference(tempreference),hreg);
|
newreference(tempreference),hreg);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,opsize,hreg,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,opsize,hreg,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,opsize,
|
exprasmlist^.concat(new(paicpu,op_ref(A_PUSH,opsize,
|
||||||
@ -1673,16 +1673,16 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(pushedparasize,4);
|
inc(pushedparasize,4);
|
||||||
if inlined then
|
if inlined then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_MOV,S_L,
|
emit_ref_reg(A_MOV,S_L,
|
||||||
newreference(tempreference),R_EDI);
|
newreference(tempreference),R_EDI);
|
||||||
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
r:=new_reference(procinfo^.framepointer,para_offset-pushedparasize);
|
||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_MOV,S_L,R_EDI,r)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
emit_push_mem(tempreference);
|
emit_push_mem(tempreference);
|
||||||
@ -1775,11 +1775,13 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end;
|
end;
|
||||||
LOC_FLAGS:
|
LOC_FLAGS:
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
if not(R_EAX in unused) then
|
if not(R_EAX in unused) then
|
||||||
emit_reg_reg(A_MOV,S_L,R_EAX,R_EDI);
|
begin
|
||||||
|
{$ifndef noAllocEdi}
|
||||||
|
getexplicitregister32(R_EDI);
|
||||||
|
{$endif noAllocEdi}
|
||||||
|
emit_reg_reg(A_MOV,S_L,R_EAX,R_EDI);
|
||||||
|
end;
|
||||||
emit_flag2reg(p^.location.resflags,R_AL);
|
emit_flag2reg(p^.location.resflags,R_AL);
|
||||||
emit_reg_reg(A_MOVZX,S_BW,R_AL,R_AX);
|
emit_reg_reg(A_MOVZX,S_BW,R_AL,R_AX);
|
||||||
if alignment=4 then
|
if alignment=4 then
|
||||||
@ -1804,9 +1806,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
if not(R_EAX in unused) then
|
if not(R_EAX in unused) then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(A_MOV,S_L,R_EDI,R_EAX);
|
emit_reg_reg(A_MOV,S_L,R_EDI,R_EAX);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef SUPPORT_MMX}
|
{$ifdef SUPPORT_MMX}
|
||||||
@ -2108,27 +2110,27 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
emitjmp(C_L,neglabel);
|
emitjmp(C_L,neglabel);
|
||||||
end;
|
end;
|
||||||
{ insert bound instruction only }
|
{ insert bound instruction only }
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,newasmsymbol(rstr),0,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,newasmsymbol(rstr),0,R_EDI)));
|
||||||
emitcall('FPC_BOUNDCHECK');
|
emitcall('FPC_BOUNDCHECK');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
{ u32bit needs 2 checks }
|
{ u32bit needs 2 checks }
|
||||||
if doublebound then
|
if doublebound then
|
||||||
begin
|
begin
|
||||||
emitjmp(C_None,poslabel);
|
emitjmp(C_None,poslabel);
|
||||||
emitlab(neglabel);
|
emitlab(neglabel);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,newasmsymbol(rstr),8,R_EDI)));
|
exprasmlist^.concat(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,newasmsymbol(rstr),8,R_EDI)));
|
||||||
emitcall('FPC_BOUNDCHECK');
|
emitcall('FPC_BOUNDCHECK');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emitlab(poslabel);
|
emitlab(poslabel);
|
||||||
end;
|
end;
|
||||||
if popecx then
|
if popecx then
|
||||||
@ -2146,18 +2148,18 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
hreg:=p^.location.register
|
hreg:=p^.location.register
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
emit_reg_reg(op,opsize,p^.location.register,R_EDI);
|
||||||
hreg:=R_EDI;
|
hreg:=R_EDI;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(op,opsize,newreference(p^.location.reference),R_EDI);
|
emit_ref_reg(op,opsize,newreference(p^.location.reference),R_EDI);
|
||||||
hreg:=R_EDI;
|
hreg:=R_EDI;
|
||||||
end;
|
end;
|
||||||
@ -2179,10 +2181,10 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
exprasmlist^.concat(new(paicpu,op_reg_ref(A_BOUND,S_L,hreg,newreference(href))));
|
exprasmlist^.concat(new(paicpu,op_reg_ref(A_BOUND,S_L,hreg,newreference(href))));
|
||||||
emitlab(poslabel);
|
emitlab(poslabel);
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
if hreg = R_EDI then
|
if hreg = R_EDI then
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2219,9 +2221,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
(not(cs_littlesize in aktglobalswitches ) and (size<=12))) then
|
(not(cs_littlesize in aktglobalswitches ) and (size<=12))) then
|
||||||
begin
|
begin
|
||||||
helpsize:=size shr 2;
|
helpsize:=size shr 2;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
for i:=1 to helpsize do
|
for i:=1 to helpsize do
|
||||||
begin
|
begin
|
||||||
emit_ref_reg(A_MOV,S_L,newreference(source),R_EDI);
|
emit_ref_reg(A_MOV,S_L,newreference(source),R_EDI);
|
||||||
@ -2246,9 +2248,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
inc(dest.offset,2);
|
inc(dest.offset,2);
|
||||||
dec(size,2);
|
dec(size,2);
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if size>0 then
|
if size>0 then
|
||||||
begin
|
begin
|
||||||
{ and now look for an 8 bit register }
|
{ and now look for an 8 bit register }
|
||||||
@ -2281,9 +2283,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
if swap then
|
if swap then
|
||||||
{ was earlier XCHG, of course nonsense }
|
{ was earlier XCHG, of course nonsense }
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_reg_reg(A_MOV,S_L,reg32,R_EDI);
|
emit_reg_reg(A_MOV,S_L,reg32,R_EDI);
|
||||||
end;
|
end;
|
||||||
emit_ref_reg(A_MOV,S_B,newreference(source),reg8);
|
emit_ref_reg(A_MOV,S_B,newreference(source),reg8);
|
||||||
@ -2295,25 +2297,25 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
if swap then
|
if swap then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(A_MOV,S_L,R_EDI,reg32);
|
emit_reg_reg(A_MOV,S_L,R_EDI,reg32);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_ref_reg(A_LEA,S_L,newreference(dest),R_EDI);
|
emit_ref_reg(A_LEA,S_L,newreference(dest),R_EDI);
|
||||||
{$ifdef regallocfix}
|
{$ifdef regallocfix}
|
||||||
{is this ok?? (JM)}
|
{is this ok?? (JM)}
|
||||||
del_reference(dest);
|
del_reference(dest);
|
||||||
{$endif regallocfix}
|
{$endif regallocfix}
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if loadref then
|
if loadref then
|
||||||
emit_ref_reg(A_MOV,S_L,newreference(source),R_ESI)
|
emit_ref_reg(A_MOV,S_L,newreference(source),R_ESI)
|
||||||
else
|
else
|
||||||
@ -2354,15 +2356,12 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
if size=1 then
|
if size=1 then
|
||||||
exprasmlist^.concat(new(paicpu,op_none(A_MOVSB,S_NO)));
|
exprasmlist^.concat(new(paicpu,op_none(A_MOVSB,S_NO)));
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_ESI)));
|
exprasmlist^.concat(new(pairegalloc,dealloc(R_ESI)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
if ecxpushed then
|
if ecxpushed then
|
||||||
begin
|
begin
|
||||||
{$ifdef AllocEDI}
|
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ECX)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
exprasmlist^.concat(new(paicpu,op_reg(A_POP,S_L,R_ECX)));
|
exprasmlist^.concat(new(paicpu,op_reg(A_POP,S_L,R_ECX)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2446,15 +2445,15 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
begin
|
begin
|
||||||
if assigned(procinfo^._class) then
|
if assigned(procinfo^._class) then
|
||||||
begin
|
begin
|
||||||
|
{$ifndef noAllocEdi}
|
||||||
|
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
||||||
|
{$endif noAllocEdi}
|
||||||
if lexlevel>normal_function_level then
|
if lexlevel>normal_function_level then
|
||||||
begin
|
begin
|
||||||
new(hp);
|
new(hp);
|
||||||
reset_reference(hp^);
|
reset_reference(hp^);
|
||||||
hp^.offset:=procinfo^.framepointer_offset;
|
hp^.offset:=procinfo^.framepointer_offset;
|
||||||
hp^.base:=procinfo^.framepointer;
|
hp^.base:=procinfo^.framepointer;
|
||||||
{$ifdef AllocEDI}
|
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
emit_ref_reg(A_MOV,S_L,hp,R_ESI);
|
emit_ref_reg(A_MOV,S_L,hp,R_ESI);
|
||||||
p:=procinfo^.parent;
|
p:=procinfo^.parent;
|
||||||
for i:=3 to lexlevel-1 do
|
for i:=3 to lexlevel-1 do
|
||||||
@ -2777,9 +2776,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
reset_reference(r^);
|
reset_reference(r^);
|
||||||
r^.base:=procinfo^.framepointer;
|
r^.base:=procinfo^.framepointer;
|
||||||
r^.offset:=pvarsym(p)^.address+4+procinfo^.call_offset;
|
r^.offset:=pvarsym(p)^.address+4+procinfo^.call_offset;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_ref_reg(A_MOV,S_L,r,R_EDI)));
|
op_ref_reg(A_MOV,S_L,r,R_EDI)));
|
||||||
|
|
||||||
@ -2811,17 +2810,17 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
emitlab(ok);
|
emitlab(ok);
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_reg_reg(A_SUB,S_L,R_EDI,R_ESP)));
|
op_reg_reg(A_SUB,S_L,R_EDI,R_ESP)));
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
{ now reload EDI }
|
{ now reload EDI }
|
||||||
new(r);
|
new(r);
|
||||||
reset_reference(r^);
|
reset_reference(r^);
|
||||||
r^.base:=procinfo^.framepointer;
|
r^.base:=procinfo^.framepointer;
|
||||||
r^.offset:=pvarsym(p)^.address+4+procinfo^.call_offset;
|
r^.offset:=pvarsym(p)^.address+4+procinfo^.call_offset;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_ref_reg(A_MOV,S_L,r,R_EDI)));
|
op_ref_reg(A_MOV,S_L,r,R_EDI)));
|
||||||
|
|
||||||
@ -2843,10 +2842,6 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ don't destroy the registers! }
|
{ don't destroy the registers! }
|
||||||
{$ifdef AllocEDI}
|
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ECX)));
|
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_reg(A_PUSH,S_L,R_ECX)));
|
op_reg(A_PUSH,S_L,R_ECX)));
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
@ -2896,11 +2891,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
S_W : exprasmlist^.concat(new(paicpu,op_none(A_MOVSW,S_NO)));
|
S_W : exprasmlist^.concat(new(paicpu,op_none(A_MOVSW,S_NO)));
|
||||||
S_L : exprasmlist^.concat(new(paicpu,op_none(A_MOVSD,S_NO)));
|
S_L : exprasmlist^.concat(new(paicpu,op_none(A_MOVSD,S_NO)));
|
||||||
end;
|
end;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_ESI)));
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_ECX)));
|
|
||||||
{$endif AllocEDI}
|
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_reg(A_POP,S_L,R_ESI)));
|
op_reg(A_POP,S_L,R_ESI)));
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
@ -3079,9 +3072,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
begin
|
begin
|
||||||
exprasmlist^.insert(new(paicpu,op_cond_sym(A_Jcc,C_Z,S_NO,faillabel)));
|
exprasmlist^.insert(new(paicpu,op_cond_sym(A_Jcc,C_Z,S_NO,faillabel)));
|
||||||
emitinsertcall('FPC_HELP_CONSTRUCTOR');
|
emitinsertcall('FPC_HELP_CONSTRUCTOR');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.insert(new(paicpu,op_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI)));
|
exprasmlist^.insert(new(paicpu,op_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI)));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3096,9 +3089,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
reset_reference(hr^);
|
reset_reference(hr^);
|
||||||
hr^.offset:=procinfo^.selfpointer_offset;
|
hr^.offset:=procinfo^.selfpointer_offset;
|
||||||
hr^.base:=procinfo^.framepointer;
|
hr^.base:=procinfo^.framepointer;
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
exprasmlist^.concat(new(pairegalloc,alloc(R_ESI)));
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.insert(new(paicpu,op_ref_reg(A_MOV,S_L,hr,R_ESI)));
|
exprasmlist^.insert(new(paicpu,op_ref_reg(A_MOV,S_L,hr,R_ESI)));
|
||||||
end;
|
end;
|
||||||
{ should we save edi,esi,ebx like C ? }
|
{ should we save edi,esi,ebx like C ? }
|
||||||
@ -3183,9 +3176,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
getlabel(again);
|
getlabel(again);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_const_reg(A_MOV,S_L,stackframe div winstackpagesize,R_EDI)));
|
op_const_reg(A_MOV,S_L,stackframe div winstackpagesize,R_EDI)));
|
||||||
emitlab(again);
|
emitlab(again);
|
||||||
@ -3196,9 +3189,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_reg(A_DEC,S_L,R_EDI)));
|
op_reg(A_DEC,S_L,R_EDI)));
|
||||||
emitjmp(C_NZ,again);
|
emitjmp(C_NZ,again);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.concat(new(paicpu,
|
exprasmlist^.concat(new(paicpu,
|
||||||
op_const_reg(A_SUB,S_L,stackframe mod winstackpagesize,R_ESP)));
|
op_const_reg(A_SUB,S_L,stackframe mod winstackpagesize,R_ESP)));
|
||||||
end
|
end
|
||||||
@ -3407,9 +3400,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
emitinsertcall('FPC_HELP_DESTRUCTOR');
|
emitinsertcall('FPC_HELP_DESTRUCTOR');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.insert(new(paicpu,op_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI)));
|
exprasmlist^.insert(new(paicpu,op_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI)));
|
||||||
{ must the object be finalized ? }
|
{ must the object be finalized ? }
|
||||||
if procinfo^._class^.needs_inittable then
|
if procinfo^._class^.needs_inittable then
|
||||||
@ -3417,9 +3410,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
getlabel(nofinal);
|
getlabel(nofinal);
|
||||||
exprasmlist^.insert(new(pai_label,init(nofinal)));
|
exprasmlist^.insert(new(pai_label,init(nofinal)));
|
||||||
emitinsertcall('FPC_FINALIZE');
|
emitinsertcall('FPC_FINALIZE');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
exprasmlist^.insert(new(paicpu,op_reg(A_PUSH,S_L,R_ESI)));
|
exprasmlist^.insert(new(paicpu,op_reg(A_PUSH,S_L,R_ESI)));
|
||||||
exprasmlist^.insert(new(paicpu,op_sym(A_PUSH,S_L,procinfo^._class^.get_inittable_label)));
|
exprasmlist^.insert(new(paicpu,op_sym(A_PUSH,S_L,procinfo^._class^.get_inittable_label)));
|
||||||
ai:=new(paicpu,op_sym(A_Jcc,S_NO,nofinal));
|
ai:=new(paicpu,op_sym(A_Jcc,S_NO,nofinal));
|
||||||
@ -3495,14 +3488,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
emit_ref_reg(A_MOV,S_L,new_reference(procinfo^.framepointer,12),R_ESI);
|
emit_ref_reg(A_MOV,S_L,new_reference(procinfo^.framepointer,12),R_ESI);
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,alloc(R_EDI)));
|
getexplicitregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
emit_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI);
|
emit_const_reg(A_MOV,S_L,procinfo^._class^.vmt_offset,R_EDI);
|
||||||
emitcall('FPC_HELP_FAIL');
|
emitcall('FPC_HELP_FAIL');
|
||||||
{$ifdef AllocEDI}
|
{$ifndef noAllocEdi}
|
||||||
exprasmlist^.concat(new(pairegalloc,dealloc(R_EDI)));
|
ungetregister32(R_EDI);
|
||||||
{$endif AllocEDI}
|
{$endif noAllocEdi}
|
||||||
end;
|
end;
|
||||||
emitlab(okexitlabel);
|
emitlab(okexitlabel);
|
||||||
|
|
||||||
@ -3667,7 +3660,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.67 2000-01-09 01:44:21 jonas
|
Revision 1.68 2000-01-09 12:35:02 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.67 2000/01/09 01:44:21 jonas
|
||||||
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
+ (de)allocation info for EDI to fix reported bug on mailinglist.
|
||||||
Also some (de)allocation info for ESI added. Between -dallocEDI
|
Also some (de)allocation info for ESI added. Between -dallocEDI
|
||||||
because at this time of the night bugs could easily slip in ;)
|
because at this time of the night bugs could easily slip in ;)
|
||||||
|
@ -815,20 +815,6 @@ Begin
|
|||||||
End;
|
End;
|
||||||
End
|
End
|
||||||
Else
|
Else
|
||||||
{remove an instruction which never makes sense: we've got
|
|
||||||
"mov mem, %reg1; mov %reg1, %edi" and then EDI isn't used anymore!}
|
|
||||||
{ Begin
|
|
||||||
If (Paicpu(hp1)^.oper[1].reg = R_EDI) And
|
|
||||||
Not(GetNextInstruction(hp1, hp2) And
|
|
||||||
(Pai(hp2)^.typ = ait_instruction) And
|
|
||||||
(Paicpu(hp2)^.oper[1].typ = top_reg) And
|
|
||||||
(Paicpu(hp2)^.oper[1] = Pointer(R_ESI))) Then
|
|
||||||
Begin
|
|
||||||
AsmL^.Remove(hp1);
|
|
||||||
Dispose(hp1, Done);
|
|
||||||
Continue;
|
|
||||||
End
|
|
||||||
End}
|
|
||||||
Else
|
Else
|
||||||
{Change "mov %reg1, %reg2; xxx %reg2, ???" to
|
{Change "mov %reg1, %reg2; xxx %reg2, ???" to
|
||||||
"mov %reg1, %reg2; xxx %reg1, ???" to avoid a write/read
|
"mov %reg1, %reg2; xxx %reg1, ???" to avoid a write/read
|
||||||
@ -1743,7 +1729,14 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.76 2000-01-07 01:14:30 peter
|
Revision 1.77 2000-01-09 12:35:02 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.76 2000/01/07 01:14:30 peter
|
||||||
* updated copyright to 2000
|
* updated copyright to 2000
|
||||||
|
|
||||||
Revision 1.75 1999/12/30 17:56:44 peter
|
Revision 1.75 1999/12/30 17:56:44 peter
|
||||||
|
@ -354,6 +354,13 @@ implementation
|
|||||||
procedure ungetregister32(r : tregister);
|
procedure ungetregister32(r : tregister);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$ifndef noAllocEdi}
|
||||||
|
if r = R_EDI then
|
||||||
|
begin
|
||||||
|
exprasmlist^.concat(new(pairegalloc,dealloc(r)));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
{$endif noAllocEdi}
|
||||||
if cs_regalloc in aktglobalswitches then
|
if cs_regalloc in aktglobalswitches then
|
||||||
begin
|
begin
|
||||||
{ takes much time }
|
{ takes much time }
|
||||||
@ -541,6 +548,14 @@ implementation
|
|||||||
function getexplicitregister32(r : tregister) : tregister;
|
function getexplicitregister32(r : tregister) : tregister;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$ifndef noAllocEdi}
|
||||||
|
if r = R_EDI then
|
||||||
|
begin
|
||||||
|
exprasmlist^.concat(new(pairegalloc,alloc(r)));
|
||||||
|
getexplicitregister32 := r;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
{$endif noAllocEdi}
|
||||||
if r in unused then
|
if r in unused then
|
||||||
begin
|
begin
|
||||||
dec(usablereg32);
|
dec(usablereg32);
|
||||||
@ -615,7 +630,14 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.37 2000-01-07 01:14:47 peter
|
Revision 1.38 2000-01-09 12:35:02 jonas
|
||||||
|
* changed edi allocation to use getexplicitregister32/ungetregister
|
||||||
|
(adapted tgeni386 a bit for this) and enabled it by default
|
||||||
|
* fixed very big and stupid bug of mine in cg386mat that broke the
|
||||||
|
include() code (and make cycle :( ) if you compiled without
|
||||||
|
-dnewoptimizations
|
||||||
|
|
||||||
|
Revision 1.37 2000/01/07 01:14:47 peter
|
||||||
* updated copyright to 2000
|
* updated copyright to 2000
|
||||||
|
|
||||||
Revision 1.36 1999/11/06 14:34:31 peter
|
Revision 1.36 1999/11/06 14:34:31 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user