* introduced defaultordconsttype to decribe the default size of ordinal constants

on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
  + added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
  * int64s/qwords are allowed as for loop counter on 64 bit CPUs
This commit is contained in:
florian 2003-05-01 07:59:42 +00:00
parent 72df326165
commit 9612e57805
6 changed files with 80 additions and 8 deletions

View File

@ -752,7 +752,11 @@ implementation
if (hp.nodetype=loadn) and
(tloadnode(hp).symtableentry.typ=varsym) then
tvarsym(tloadnode(hp).symtableentry).varstate:=vs_used;
if (not(is_ordinal(t2.resulttype.def)) or is_64bitint(t2.resulttype.def)) then
if not(is_ordinal(t2.resulttype.def))
{$ifndef cpu64bit}
or is_64bitint(t2.resulttype.def)
{$endif cpu64bit}
then
CGMessagePos(hp.fileinfo,type_e_ordinal_expr_expected);
end
else
@ -1499,7 +1503,13 @@ begin
end.
{
$Log$
Revision 1.71 2003-04-27 11:21:33 peter
Revision 1.72 2003-05-01 07:59:42 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.71 2003/04/27 11:21:33 peter
* aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
* procinfo will now be stored in current_module so it can be

View File

@ -1658,26 +1658,33 @@ begin
{ new processor stuff }
{$ifdef i386}
def_symbol('CPUI386');
def_symbol('CPU32');
def_symbol('FPC_HAS_TYPE_EXTENDED');
def_symbol('FPC_HAS_TYPE_DOUBLE');
def_symbol('FPC_HAS_TYPE_SINGLE');
{$endif}
{$ifdef m68k}
def_symbol('CPU68K');
def_symbol('CPU32');
{$endif}
{$ifdef ALPHA}
def_symbol('CPUALPHA');
def_symbol('CPU64');
{$endif}
{$ifdef powerpc}
def_symbol('CPUPOWERPC');
def_symbol('CPUPOWERPC32');
def_symbol('CPU32');
def_symbol('FPC_HAS_TYPE_DOUBLE');
def_symbol('FPC_HAS_TYPE_SINGLE');
{$endif}
{$ifdef iA64}
def_symbol('CPUIA64');
def_symbol('CPU64');
{$endif}
{$ifdef x86_64}
def_symbol('CPUX86_64');
def_symbol('CPU64');
def_symbol('FPC_HAS_TYPE_FLOAT128');
def_symbol('FPC_HAS_TYPE_EXTENDED');
def_symbol('FPC_HAS_TYPE_DOUBLE');
@ -1685,9 +1692,12 @@ begin
{$endif}
{$ifdef sparc}
def_symbol('CPUSPARC');
def_symbol('CPUSPARC32');
def_symbol('CPU32');
{$endif}
{$ifdef vis}
def_symbol('CPUVIS');
def_symbol('CPU32');
{$endif}
{ get default messagefile }
@ -1908,7 +1918,13 @@ finalization
end.
{
$Log$
Revision 1.96 2003-04-30 16:35:00 florian
Revision 1.97 2003-05-01 07:59:42 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.96 2003/04/30 16:35:00 florian
* fixed defines for x86-64
Revision 1.95 2003/04/24 11:21:45 florian

View File

@ -1864,7 +1864,7 @@ implementation
else
begin
consume(_INTCONST);
p1:=cordconstnode.create(l,s32bittype,true)
p1:=cordconstnode.create(l,defaultordconsttype,true)
end
end
else
@ -2314,7 +2314,13 @@ implementation
end.
{
$Log$
Revision 1.113 2003-04-27 11:21:33 peter
Revision 1.114 2003-05-01 07:59:42 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.113 2003/04/27 11:21:33 peter
* aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
* procinfo will now be stored in current_module so it can be

View File

@ -248,18 +248,23 @@ implementation
globaldef('variant',cvarianttype);
{$ifdef i386}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
{$endif i386}
{$ifdef x86_64}
ordpointertype:=cu64bittype;
defaultordconsttype:=cs64bittype;
{$endif x86_64}
{$ifdef powerpc}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
{$endif powerpc}
{$ifdef sparc}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
{$endif sparc}
{$ifdef m68k}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
{$endif}
end;
@ -297,9 +302,11 @@ implementation
{$ifdef x86}
{$ifdef i386}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
{$endif i386}
{$ifdef x86_64}
ordpointertype:=cu64bittype;
defaultordconsttype:=cs64bittype;
{$endif x86_64}
s32floattype.setdef(tfloatdef.create(s32real));
s64floattype.setdef(tfloatdef.create(s64real));
@ -308,6 +315,7 @@ implementation
{$endif x86}
{$ifdef powerpc}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
s32floattype.setdef(tfloatdef.create(s32real));
s64floattype.setdef(tfloatdef.create(s64real));
s80floattype.setdef(tfloatdef.create(s80real));
@ -315,6 +323,7 @@ implementation
{$endif powerpc}
{$ifdef sparc}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
s32floattype.setdef(tfloatdef.create(s32real));
s64floattype.setdef(tfloatdef.create(s64real));
s80floattype.setdef(tfloatdef.create(s80real));
@ -322,6 +331,7 @@ implementation
{$endif sparc}
{$ifdef m68k}
ordpointertype:=u32bittype;
defaultordconsttype:=s32bittype;
s32floattype.setdef(tfloatdef.create(s32real));
s64floattype.setdef(tfloatdef.create(s64real));
s80floattype.setdef(tfloatdef.create(s80real));
@ -481,7 +491,13 @@ implementation
end.
{
$Log$
Revision 1.47 2003-04-25 20:59:34 peter
Revision 1.48 2003-05-01 07:59:42 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.47 2003/04/25 20:59:34 peter
* removed funcretn,funcretsym, function result is now in varsym
and aliases for result and function name are added using absolutesym
* vs_hidden parameter for funcret passed in parameter

View File

@ -684,6 +684,7 @@ interface
cvarianttype,
{ unsigned ord type with the same size as a pointer }
ordpointertype,
defaultordconsttype, { pointer to type of ordinal constants }
pvmttype : ttype; { type of classrefs, used for stabs }
{ pointer to the anchestor of all classes }
@ -2033,6 +2034,15 @@ implementation
procedure tfiledef.setsize;
begin
{$ifdef cpu64bit}
case filetyp of
ft_text :
savesize:=592;
ft_typed,
ft_untyped :
savesize:=316;
end;
{$else cpu64bit}
case filetyp of
ft_text :
savesize:=572;
@ -2040,6 +2050,7 @@ implementation
ft_untyped :
savesize:=316;
end;
{$endif cpu64bit}
end;
@ -5737,7 +5748,13 @@ implementation
end.
{
$Log$
Revision 1.138 2003-04-27 11:21:34 peter
Revision 1.139 2003-05-01 07:59:43 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.138 2003/04/27 11:21:34 peter
* aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
* procinfo will now be stored in current_module so it can be

View File

@ -148,6 +148,7 @@ interface
tvarsym(current_procdef.funcretsym).varstate:=vs_assigned;
if (s[length(s)]<>'%') and
(s[length(s)]<>'$') and
(s[length(s)]<>'.') and
((s[length(s)]<>'0') or (hs[1]<>'x')) then
begin
if assigned(current_procdef.localst) and
@ -319,7 +320,13 @@ initialization
end.
{
$Log$
Revision 1.1 2003-04-30 15:45:35 florian
Revision 1.2 2003-05-01 07:59:43 florian
* introduced defaultordconsttype to decribe the default size of ordinal constants
on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
+ added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
* int64s/qwords are allowed as for loop counter on 64 bit CPUs
Revision 1.1 2003/04/30 15:45:35 florian
* merged more x86-64/i386 code
Revision 1.11 2003/04/27 11:21:36 peter