Ver Fonte

* unified the 8-bit and 16-bit alu handling in tshlshrnode.pass_typecheck

git-svn-id: trunk@27642 -
nickysn há 11 anos atrás
pai
commit
a47ab44ec8
1 ficheiros alterados com 4 adições e 23 exclusões
  1. 4 23
      compiler/nmat.pas

+ 4 - 23
compiler/nmat.pas

@@ -641,9 +641,6 @@ implementation
     function tshlshrnode.pass_typecheck:tnode;
     function tshlshrnode.pass_typecheck:tnode;
       var
       var
          t : tnode;
          t : tnode;
-{$ifdef cpunodefaultint}
-         nd : tdef;
-{$endif cpunodefaultint}
       begin
       begin
          result:=nil;
          result:=nil;
          typecheckpass(left);
          typecheckpass(left);
@@ -673,14 +670,6 @@ implementation
               exit;
               exit;
            end;
            end;
 
 
-{$ifdef cpunodefaultint}
-         { for small cpus we use the smallest common type }
-         if (left.resultdef.typ=orddef) and (right.resultdef.typ=orddef) then
-           nd:=get_common_intdef(torddef(left.resultdef),torddef(right.resultdef),false)
-         else
-           nd:=s32inttype;
-{$endif cpunodefaultint}
-
          { calculations for ordinals < 32 bit have to be done in
          { calculations for ordinals < 32 bit have to be done in
            32 bit for backwards compatibility. That way 'shl 33' is
            32 bit for backwards compatibility. That way 'shl 33' is
            the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
            the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
@@ -690,11 +679,9 @@ implementation
              { keep singness of orignal type }
              { keep singness of orignal type }
              if is_signed(left.resultdef) then
              if is_signed(left.resultdef) then
                begin
                begin
-{$if defined(cpunodefaultint)}
-                 inserttypeconv(left,nd)
-{$elseif defined(cpu64bitalu) or defined(cpu32bitalu)}
+{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
                  inserttypeconv(left,s32inttype)
                  inserttypeconv(left,s32inttype)
-{$elseif defined(cpu16bitalu)}
+{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
                  inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(sinttype),true));
                  inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(sinttype),true));
 {$else}
 {$else}
                  internalerror(2013031301);
                  internalerror(2013031301);
@@ -702,11 +689,9 @@ implementation
                end
                end
              else
              else
                begin
                begin
-{$if defined(cpunodefaultint)}
-                 inserttypeconv(left,nd)
-{$elseif defined(cpu64bitalu) or defined(cpu32bitalu)}
+{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
                  inserttypeconv(left,u32inttype);
                  inserttypeconv(left,u32inttype);
-{$elseif defined(cpu16bitalu)}
+{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
                  inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(uinttype),true));
                  inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(uinttype),true));
 {$else}
 {$else}
                  internalerror(2013031301);
                  internalerror(2013031301);
@@ -714,11 +699,7 @@ implementation
                end
                end
            end;
            end;
 
 
-{$ifdef cpunodefaultint}
-         inserttypeconv(right,nd);
-{$else cpunodefaultint}
          inserttypeconv(right,sinttype);
          inserttypeconv(right,sinttype);
-{$endif cpunodefaultint}
 
 
          resultdef:=left.resultdef;
          resultdef:=left.resultdef;