Explorar o código

* fixes support for cpus with cpunodefaultint for unary minus nodes

git-svn-id: trunk@22838 -
florian %!s(int64=12) %!d(string=hai) anos
pai
achega
5e1e42ec2b
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 4 0
      compiler/ncgmat.pas
  2. 2 0
      compiler/nmat.pas

+ 4 - 0
compiler/ncgmat.pas

@@ -238,11 +238,15 @@ implementation
         secondpass(left);
         secondpass(left);
         { load left operator in a register }
         { load left operator in a register }
         location_copy(location,left.location);
         location_copy(location,left.location);
+{$ifdef cpunodefaultint}
+        opsize:=left.resultdef;
+{$else cpunodefaultint}
         { in case of a 32 bit system that can natively execute 64 bit operations }
         { in case of a 32 bit system that can natively execute 64 bit operations }
         if (left.resultdef.size<=sinttype.size) then
         if (left.resultdef.size<=sinttype.size) then
           opsize:=sinttype
           opsize:=sinttype
         else
         else
           opsize:=s64inttype;
           opsize:=s64inttype;
+{$endif cpunodefaultint}
         hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,opsize,false);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,opsize,false);
         hlcg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,opsize,location.register,location.register);
         hlcg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,opsize,location.register,location.register);
 
 

+ 2 - 0
compiler/nmat.pas

@@ -766,7 +766,9 @@ implementation
 {$endif not cpu64bitaddr}
 {$endif not cpu64bitaddr}
          else if (left.resultdef.typ=orddef) then
          else if (left.resultdef.typ=orddef) then
            begin
            begin
+{$ifndef cpunodefaultint}
              inserttypeconv(left,sinttype);
              inserttypeconv(left,sinttype);
+{$endif cpunodefaultint}
              resultdef:=left.resultdef
              resultdef:=left.resultdef
            end
            end
          else
          else