+ define cpunodefaultint

git-svn-id: trunk@10415 -
This commit is contained in:
florian 2008-03-01 20:31:56 +00:00
parent bc0586139a
commit 5826b9bdad
2 changed files with 34 additions and 1 deletions

View File

@ -113,6 +113,7 @@
{$define cpu16bit}
{$define cpuflags}
{$define cpunofpu}
{$define cpunodefaultint}
{$endif avr}
{$IFDEF MACOS}

View File

@ -1,7 +1,7 @@
{
Copyright (c) 1998-2002 by Florian Klaempfl
Type checking and register allocation for add nodes
Type checking and simplification for add nodes
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -1206,8 +1206,40 @@ implementation
is_signed(rd) or
(nodetype=subn) then
begin
{$ifdef cpunodefaultint}
{ for small cpus we use the smallest common type }
llow:=torddef(rd).low;
if llow<torddef(ld).low then
llow:=torddef(ld).low;
lhigh:=torddef(rd).high;
if lhigh<torddef(ld).high then
lhigh:=torddef(ld).high;
case range_to_basetype(llow,lhigh) of
s8bit:
nd:=s8inttype;
u8bit:
nd:=u8inttype;
s16bit:
nd:=s8inttype;
u16bit:
nd:=u8inttype;
s32bit:
nd:=s8inttype;
u32bit:
nd:=u8inttype;
s64bit:
nd:=s8inttype;
u64bit:
nd:=u8inttype;
else
internalerror(200802291);
end;
inserttypeconv(right,nd);
inserttypeconv(left,nd);
{$else cpunodefaultint}
inserttypeconv(right,sinttype);
inserttypeconv(left,sinttype);
{$endif cpunodefaultint}
end
else
begin