mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-28 06:43:39 +02:00
* some small problems fixed
This commit is contained in:
parent
df07c1a0f5
commit
e6c1b96cff
@ -166,8 +166,15 @@ implementation
|
||||
begin
|
||||
p^.location.reference.base:=procinfo.framepointer;
|
||||
p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address+p^.symtable^.address_fixup;
|
||||
|
||||
if (symtabletype in [localsymtable,inlinelocalsymtable]) then
|
||||
p^.location.reference.offset:=-p^.location.reference.offset;
|
||||
begin
|
||||
if use_esp_stackframe then
|
||||
dec(p^.location.reference.offset,
|
||||
pvarsym(p^.symtableentry)^.getsize)
|
||||
else
|
||||
p^.location.reference.offset:=-p^.location.reference.offset;
|
||||
end;
|
||||
if (lexlevel>(p^.symtable^.symtablelevel)) then
|
||||
begin
|
||||
hregister:=getregister32;
|
||||
@ -929,7 +936,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.70 1999-08-04 13:45:22 florian
|
||||
Revision 1.71 1999-08-07 14:20:55 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.70 1999/08/04 13:45:22 florian
|
||||
+ floating point register variables !!
|
||||
* pairegalloc is now generated for register variables
|
||||
|
||||
|
@ -2710,6 +2710,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
||||
parasize:=0
|
||||
else
|
||||
parasize:=aktprocsym^.definition^.parast^.datasize+procinfo.call_offset-4;
|
||||
if stackframe<>0 then
|
||||
exprasmlist^.insert(new(pai386,
|
||||
op_const_reg(A_SUB,S_L,gettempsize,R_ESP)));
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -3079,9 +3082,18 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
||||
begin
|
||||
exprasmlist^.concat(new(pai386,op_none(A_POPA,S_L)));
|
||||
end;
|
||||
if not(nostackframe) then
|
||||
begin
|
||||
if not inlined then
|
||||
exprasmlist^.concat(new(pai386,op_none(A_LEAVE,S_NO)));
|
||||
end
|
||||
else
|
||||
begin
|
||||
if (gettempsize<>0) and not inlined then
|
||||
exprasmlist^.insert(new(pai386,
|
||||
op_const_reg(A_ADD,S_L,gettempsize,R_ESP)));
|
||||
end;
|
||||
|
||||
if not(nostackframe) and not inlined then
|
||||
exprasmlist^.concat(new(pai386,op_none(A_LEAVE,S_NO)));
|
||||
{ parameters are limited to 65535 bytes because }
|
||||
{ ret allows only imm16 }
|
||||
if (parasize>65535) and not(pocall_clearstack in aktprocsym^.definition^.proccalloptions) then
|
||||
@ -3176,7 +3188,10 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.27 1999-08-05 23:45:09 peter
|
||||
Revision 1.28 1999-08-07 14:20:57 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.27 1999/08/05 23:45:09 peter
|
||||
* saveregister is now working and used for assert and iocheck (which has
|
||||
been moved to system.inc because it's now system independent)
|
||||
|
||||
|
@ -694,14 +694,10 @@ type
|
||||
);
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
Constants
|
||||
*****************************************************************************}
|
||||
|
||||
type
|
||||
tcpuflags = (cf_registers64);
|
||||
|
||||
const
|
||||
general_registers = [R_EAX,R_EBX,R_ECX,R_EDX];
|
||||
|
||||
@ -716,9 +712,9 @@ const
|
||||
frame_pointer = R_EBP;
|
||||
self_pointer = R_ESI;
|
||||
accumulator = R_EAX;
|
||||
scratchregister = R_EDI;
|
||||
scratch_register = R_EDI;
|
||||
|
||||
cpuflags : set of tcpuflags = [];
|
||||
cpuflags = [];
|
||||
|
||||
{ sizes }
|
||||
pointersize = 4;
|
||||
@ -1011,7 +1007,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.3 1999-08-05 14:58:09 florian
|
||||
Revision 1.4 1999-08-07 14:20:58 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.3 1999/08/05 14:58:09 florian
|
||||
* some fixes for the floating point registers
|
||||
* more things for the new code generator
|
||||
|
||||
|
@ -31,10 +31,14 @@ unit cgobj;
|
||||
type
|
||||
qword = comp;
|
||||
|
||||
talignment = (AM_NATURAL,AM_NONE,AM_2BYTE,AM_4BYTE,AM_8BYTE);
|
||||
|
||||
pcg = ^tcg;
|
||||
tcg = object
|
||||
scratch_register_array_pointer : aword;
|
||||
unusedscratchregisters : tregisterset;
|
||||
|
||||
alignment : talignment
|
||||
{************************************************}
|
||||
{ basic routines }
|
||||
constructor init;
|
||||
@ -159,7 +163,7 @@ unit cgobj;
|
||||
{ loadref is true, it assumes that it first must load }
|
||||
{ the source address from the memory location where }
|
||||
{ source points to }
|
||||
procedure g_concatcopy(const source,dest : treference;len : aword;loadref : boolean);virtual;
|
||||
procedure g_concatcopy(list : paasmoutput;const source,dest : treference;len : aword;loadref : boolean);virtual;
|
||||
|
||||
{ uses the addr of ref as param, was emitpushreferenceaddr }
|
||||
procedure a_param_ref_addr(list : paasmoutput;r : treference;nr : longint);virtual;
|
||||
@ -323,7 +327,7 @@ unit cgobj;
|
||||
end;
|
||||
|
||||
|
||||
procedure tcg.g_concatcopy(const source,dest : treference;len : aword;loadref : boolean);
|
||||
procedure tcg.g_concatcopy(list : paasmoutput;const source,dest : treference;len : aword;loadref : boolean);
|
||||
|
||||
begin
|
||||
abstract;
|
||||
@ -994,7 +998,10 @@ unit cgobj;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.20 1999-08-06 18:05:52 florian
|
||||
Revision 1.21 1999-08-07 14:21:08 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.20 1999/08/06 18:05:52 florian
|
||||
* implemented some stuff for assignments
|
||||
|
||||
Revision 1.19 1999/08/06 17:00:54 florian
|
||||
|
@ -425,6 +425,10 @@ implementation
|
||||
3. no call to other procedures
|
||||
4. no interrupt handler
|
||||
}
|
||||
{!!!!!! this doesn work yet, because of problems with
|
||||
with linux and windows
|
||||
}
|
||||
(*
|
||||
if assigned(aktprocsym) then
|
||||
begin
|
||||
if not(aktprocsym^.definition^.proctypeoption in [potype_constructor,potype_destructor]) and
|
||||
@ -450,6 +454,7 @@ implementation
|
||||
aktprocsym^.definition^.parast^.address_fixup:=procinfo.call_offset;
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
if (p^.registers32<4) then
|
||||
begin
|
||||
for i:=1 to maxvarregs do
|
||||
@ -648,7 +653,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.30 1999-08-04 14:21:07 florian
|
||||
Revision 1.31 1999-08-07 14:20:59 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.30 1999/08/04 14:21:07 florian
|
||||
* now every available fpu register is used for
|
||||
fpu register variables
|
||||
|
||||
|
@ -475,6 +475,33 @@
|
||||
end;
|
||||
|
||||
|
||||
function tdef.is_intregable : boolean;
|
||||
|
||||
begin
|
||||
is_intregable:=false;
|
||||
case deftype of
|
||||
pointerdef,
|
||||
enumdef,
|
||||
procvardef :
|
||||
is_intregable:=true;
|
||||
orddef :
|
||||
case porddef(@self)^.typ of
|
||||
bool8bit,bool16bit,bool32bit,
|
||||
u8bit,u16bit,u32bit,
|
||||
s8bit,s16bit,s32bit:
|
||||
is_intregable:=true;
|
||||
end;
|
||||
setdef:
|
||||
is_intregable:=is_smallset(@self);
|
||||
end;
|
||||
end;
|
||||
|
||||
function tdef.is_fpuregable : boolean;
|
||||
|
||||
begin
|
||||
is_fpuregable:=not(pfloatdef(@self)^.typ in [f32bit,f16bit]);
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
TSTRINGDEF
|
||||
****************************************************************************}
|
||||
@ -3590,7 +3617,10 @@ Const local_symtable_index : longint = $8001;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.145 1999-08-07 13:36:54 daniel
|
||||
Revision 1.146 1999-08-07 14:21:00 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.145 1999/08/07 13:36:54 daniel
|
||||
* Recommitted the arraydef overflow bugfix.
|
||||
|
||||
Revision 1.143 1999/08/06 11:13:30 peter
|
||||
|
@ -86,6 +86,8 @@
|
||||
procedure generate_rtti;virtual;
|
||||
procedure write_rtti_data;virtual;
|
||||
procedure write_child_rtti_data;virtual;
|
||||
function is_intregable : boolean;
|
||||
function is_fpuregable : boolean;
|
||||
private
|
||||
savesize : longint;
|
||||
end;
|
||||
@ -517,7 +519,10 @@
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.38 1999-08-05 16:53:15 peter
|
||||
Revision 1.39 1999-08-07 14:21:02 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.38 1999/08/05 16:53:15 peter
|
||||
* V_Fatal=1, all other V_ are also increased
|
||||
* Check for local procedure when assigning procvar
|
||||
* fixed comment parsing because directives
|
||||
|
@ -872,53 +872,32 @@
|
||||
varstate:=vs_used;
|
||||
varoptions:=[];
|
||||
{ can we load the value into a register ? }
|
||||
case p^.deftype of
|
||||
pointerdef,
|
||||
enumdef,
|
||||
procvardef :
|
||||
if p^.is_intregable then
|
||||
|
||||
{$ifdef INCLUDEOK}
|
||||
include(varoptions,vo_regable);
|
||||
include(varoptions,vo_regable)
|
||||
{$else}
|
||||
varoptions:=varoptions+[vo_regable];
|
||||
varoptions:=varoptions+[vo_regable]
|
||||
{$endif}
|
||||
orddef :
|
||||
case porddef(p)^.typ of
|
||||
bool8bit,bool16bit,bool32bit,
|
||||
u8bit,u16bit,u32bit,
|
||||
s8bit,s16bit,s32bit :
|
||||
else
|
||||
{$ifdef INCLUDEOK}
|
||||
include(varoptions,vo_regable);
|
||||
exclude(varoptions,vo_regable);
|
||||
{$else}
|
||||
varoptions:=varoptions+[vo_regable];
|
||||
varoptions:=varoptions-[vo_regable];
|
||||
{$endif}
|
||||
else
|
||||
|
||||
if p^.is_fpuregable then
|
||||
{$ifdef INCLUDEOK}
|
||||
exclude(varoptions,vo_regable);
|
||||
include(varoptions,vo_fpuregable)
|
||||
{$else}
|
||||
varoptions:=varoptions-[vo_regable];
|
||||
varoptions:=varoptions+[vo_fpuregable]
|
||||
{$endif}
|
||||
end;
|
||||
setdef:
|
||||
if psetdef(p)^.settype=smallset then
|
||||
else
|
||||
{$ifdef INCLUDEOK}
|
||||
include(varoptions,vo_regable);
|
||||
exclude(varoptions,vo_regable);
|
||||
{$else}
|
||||
varoptions:=varoptions+[vo_regable];
|
||||
varoptions:=varoptions-[vo_fpuregable];
|
||||
{$endif}
|
||||
floatdef:
|
||||
if not(pfloatdef(p)^.typ in [f32bit,f16bit]) then
|
||||
{$ifdef INCLUDEOK}
|
||||
include(varoptions,vo_fpuregable);
|
||||
{$else}
|
||||
varoptions:=varoptions+[vo_fpuregable];
|
||||
{$endif}
|
||||
else
|
||||
{$ifdef INCLUDEOK}
|
||||
exclude(varoptions,vo_regable);
|
||||
{$else}
|
||||
varoptions:=varoptions-[vo_regable];
|
||||
{$endif}
|
||||
end;
|
||||
reg:=R_NO;
|
||||
end;
|
||||
|
||||
@ -2118,7 +2097,10 @@
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.109 1999-08-07 13:24:34 daniel
|
||||
Revision 1.110 1999-08-07 14:21:03 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.109 1999/08/07 13:24:34 daniel
|
||||
* Fixed open arrays
|
||||
|
||||
Revision 1.108 1999/08/05 16:53:17 peter
|
||||
|
@ -709,8 +709,13 @@ implementation
|
||||
end;
|
||||
if p^.explizit then
|
||||
begin
|
||||
{ check if the result could be in a register }
|
||||
if not(p^.resulttype^.is_intregable) and
|
||||
not(p^.resulttype^.is_fpuregable) then
|
||||
make_not_regable(p^.left);
|
||||
{ boolean to byte are special because the
|
||||
location can be different }
|
||||
|
||||
if is_integer(p^.resulttype) and
|
||||
is_boolean(p^.left^.resulttype) then
|
||||
begin
|
||||
@ -919,7 +924,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.44 1999-08-04 13:03:14 jonas
|
||||
Revision 1.45 1999-08-07 14:21:04 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.44 1999/08/04 13:03:14 jonas
|
||||
* all tokens now start with an underscore
|
||||
* PowerPC compiles!!
|
||||
|
||||
|
@ -163,7 +163,6 @@ interface
|
||||
{ returns the mmx type }
|
||||
function mmx_type(p : pdef) : tmmxtype;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -975,7 +974,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.82 1999-08-07 13:36:56 daniel
|
||||
Revision 1.83 1999-08-07 14:21:06 florian
|
||||
* some small problems fixed
|
||||
|
||||
Revision 1.82 1999/08/07 13:36:56 daniel
|
||||
* Recommitted the arraydef overflow bugfix.
|
||||
|
||||
Revision 1.80 1999/08/05 22:42:49 daniel
|
||||
|
Loading…
Reference in New Issue
Block a user