* bug with mul. of dwords fixed, reported by Alexander Stohr

* some changes to compile with TP
  + small enhancements for the new code generator
This commit is contained in:
florian 1999-01-19 10:18:58 +00:00
parent a3c0f5e306
commit 77f7afffa9
6 changed files with 65 additions and 32 deletions

View File

@ -798,10 +798,10 @@ implementation
emitloadord2reg(p^.right^.location,u32bitdef,R_EAX,true); emitloadord2reg(p^.right^.location,u32bitdef,R_EAX,true);
exprasmlist^.concat(new(pai386,op_reg(A_MUL,S_L,R_EDI))); exprasmlist^.concat(new(pai386,op_reg(A_MUL,S_L,R_EDI)));
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 popeax then
exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EAX)));
if popedx then if popedx then
exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EDX))); exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EDX)));
if popeax then
exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EAX)));
SetResultLocation(false,true,p); SetResultLocation(false,true,p);
exit; exit;
end; end;
@ -1737,7 +1737,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.38 1999-01-05 17:03:36 jonas Revision 1.39 1999-01-19 10:18:58 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.38 1999/01/05 17:03:36 jonas
* don't output inc/dec if cs_check_overflow is on, because inc/dec don't change * don't output inc/dec if cs_check_overflow is on, because inc/dec don't change
the carry flag the carry flag

View File

@ -545,7 +545,6 @@ implementation
begin begin
clear_location(pto^.location); clear_location(pto^.location);
pto^.location.loc:=LOC_REFERENCE; pto^.location.loc:=LOC_REFERENCE;
clear_reference(pto^.location.reference);
gettempofsizereference(pto^.resulttype^.size,pto^.location.reference); gettempofsizereference(pto^.resulttype^.size,pto^.location.reference);
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype))); ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference)))); exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
@ -1345,6 +1344,9 @@ implementation
{ the helper routines need access to the release list } { the helper routines need access to the release list }
ltemptoremove:=oldrl; ltemptoremove:=oldrl;
if not(assigned(ltemptoremove)) then
internalerror(18011);
{ this isn't good coding, I think tc_bool_2_int, shouldn't be } { this isn't good coding, I think tc_bool_2_int, shouldn't be }
{ type conversion (FK) } { type conversion (FK) }
@ -1476,7 +1478,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.43 1998-12-22 13:10:59 florian Revision 1.44 1999-01-19 10:18:59 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.43 1998/12/22 13:10:59 florian
* memory leaks for ansistring type casts fixed * memory leaks for ansistring type casts fixed
Revision 1.42 1998/12/19 00:23:42 florian Revision 1.42 1998/12/19 00:23:42 florian

View File

@ -1328,15 +1328,6 @@ unit i386;
procedure reset_reference(var ref : treference); procedure reset_reference(var ref : treference);
begin begin
{$ifdef ver0_6}
ref.index:=R_NO;
ref.base:=R_NO;
ref.segment:=R_DEFAULT_SEG;
ref.offset:=0;
ref.scalefactor:=1;
ref.isintvalue:=false;
ref.symbol:=nil;
{$else}
with ref do with ref do
begin begin
index:=R_NO; index:=R_NO;
@ -1347,7 +1338,6 @@ unit i386;
isintvalue:=false; isintvalue:=false;
symbol:=nil; symbol:=nil;
end; end;
{$endif}
end; end;
function new_reference(base : tregister;offset : longint) : preference; function new_reference(base : tregister;offset : longint) : preference;
@ -1962,7 +1952,12 @@ Begin
end. end.
{ {
$Log$ $Log$
Revision 1.28 1999-01-13 11:34:06 florian Revision 1.29 1999-01-19 10:19:02 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.28 1999/01/13 11:34:06 florian
* unified i386.pas for the old and new code generator * unified i386.pas for the old and new code generator
Revision 1.27 1999/01/10 15:37:53 peter Revision 1.27 1999/01/10 15:37:53 peter

View File

@ -42,19 +42,29 @@ unit convtree;
node : pnode; node : pnode;
begin begin
case p^.treetype of if assigned(p) then
blockn: begin
node:=new(pblocknode,init); case p^.treetype of
else internalerror(13751); blockn:
end; node:=new(pblocknode,init(convtree2node(p^.left)));
disposetree(p); else internalerror(13751);
convtree2node:=node; end;
disposetree(p);
convtree2node:=node;
end
else
convtree2node:=nil;
end; end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 1999-01-13 22:52:37 florian Revision 1.2 1999-01-19 10:19:04 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.1 1999/01/13 22:52:37 florian
+ YES, finally the new code generator is compilable, but it doesn't run yet :( + YES, finally the new code generator is compilable, but it doesn't run yet :(
} }

View File

@ -195,7 +195,7 @@ unit tree;
procedure pass_1; procedure pass_1;
{ dermines the resulttype of the node } { dermines the resulttype of the node }
procedure det_resulttype;virtual; procedure det_resulttype;virtual;
{ dermines the number of necessary temp. locations to evalute { dermines the number of necessary temp. locations to evaluate
the node } the node }
procedure det_temp;virtual; procedure det_temp;virtual;
procedure secondpass;virtual; procedure secondpass;virtual;
@ -208,7 +208,6 @@ unit tree;
end; end;
ploadnode = ^tloadnode; ploadnode = ^tloadnode;
tloadnode = object(tnode) tloadnode = object(tnode)
symtableentry : psym; symtableentry : psym;
symtable : psymtable; symtable : psymtable;
@ -282,6 +281,7 @@ unit tree;
tunarynode = object(tnode) tunarynode = object(tnode)
left : pnode; left : pnode;
procedure dowrite;virtual; procedure dowrite;virtual;
constructor init(l : pnode);
end; end;
pbinarynode = ^tbinarynode; pbinarynode = ^tbinarynode;
@ -298,7 +298,7 @@ unit tree;
pblocknode = ^tblocknode; pblocknode = ^tblocknode;
tblocknode = object(tunarynode) tblocknode = object(tunarynode)
constructor init; constructor init(l : pnode);
end; end;
{$ifdef dummy} {$ifdef dummy}
@ -605,6 +605,13 @@ unit tree;
TUNARYNODE TUNARYNODE
****************************************************************************} ****************************************************************************}
constructor tunarynode.init(l : pnode);
begin
inherited init;
left:=l;
end;
procedure tunarynode.dowrite; procedure tunarynode.dowrite;
begin begin
@ -619,10 +626,10 @@ unit tree;
TBLOCKNODE TBLOCKNODE
****************************************************************************} ****************************************************************************}
constructor tblocknode.init; constructor tblocknode.init(l : pnode);
begin begin
inherited init; inherited init(l);
treetype:=blockn; treetype:=blockn;
end; end;
@ -1918,7 +1925,12 @@ unit tree;
end. end.
{ {
$Log$ $Log$
Revision 1.3 1999-01-13 22:52:40 florian Revision 1.4 1999-01-19 10:19:06 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.3 1999/01/13 22:52:40 florian
+ YES, finally the new code generator is compilable, but it doesn't run yet :( + YES, finally the new code generator is compilable, but it doesn't run yet :(
Revision 1.2 1998/12/26 15:20:32 florian Revision 1.2 1998/12/26 15:20:32 florian

View File

@ -159,7 +159,6 @@ uses
{$O os2_targ} {$O os2_targ}
{$O win_targ} {$O win_targ}
{$endif i386} {$endif i386}
{$O asmutils}
{$ifdef gdb} {$ifdef gdb}
{$O gdb} {$O gdb}
{$endif gdb} {$endif gdb}
@ -265,7 +264,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.37 1998-12-16 00:27:21 peter Revision 1.38 1999-01-19 10:19:03 florian
* bug with mul. of dwords fixed, reported by Alexander Stohr
* some changes to compile with TP
+ small enhancements for the new code generator
Revision 1.37 1998/12/16 00:27:21 peter
* removed some obsolete version checks * removed some obsolete version checks
Revision 1.36 1998/11/27 22:54:52 michael Revision 1.36 1998/11/27 22:54:52 michael