Browse Source

* fixed sign of location.size for divmodn, 64 shlshrn and for muln

git-svn-id: trunk@9646 -
Jonas Maebe 17 years ago
parent
commit
9ec3cc2022
2 changed files with 8 additions and 8 deletions
  1. 4 4
      compiler/i386/n386add.pas
  2. 4 4
      compiler/i386/n386mat.pas

+ 4 - 4
compiler/i386/n386add.pas

@@ -40,7 +40,7 @@ interface
     uses
     uses
       globtype,systems,
       globtype,systems,
       cutils,verbose,globals,
       cutils,verbose,globals,
-      symconst,symdef,paramgr,
+      symconst,symdef,paramgr,defutil,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       aasmbase,aasmtai,aasmdata,aasmcpu,
       cgbase,procinfo,
       cgbase,procinfo,
       ncon,nset,cgutils,tgobj,
       ncon,nset,cgutils,tgobj,
@@ -108,7 +108,7 @@ interface
               hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
               hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
               hregister2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
               hregister2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
               cg64.a_load64_loc_reg(current_asmdata.CurrAsmList,left.location,joinreg64(hregister,hregister2));
               cg64.a_load64_loc_reg(current_asmdata.CurrAsmList,left.location,joinreg64(hregister,hregister2));
-              location_reset(left.location,LOC_REGISTER,OS_64);
+              location_reset(left.location,LOC_REGISTER,left.location.size);
               left.location.register64.reglo:=hregister;
               left.location.register64.reglo:=hregister;
               left.location.register64.reghi:=hregister2;
               left.location.register64.reghi:=hregister2;
             end
             end
@@ -279,7 +279,7 @@ interface
                  hregister2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
                  hregister2:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
                  cg64.a_load64_loc_reg(current_asmdata.CurrAsmList,left.location,joinreg64(hregister,hregister2));
                  cg64.a_load64_loc_reg(current_asmdata.CurrAsmList,left.location,joinreg64(hregister,hregister2));
                  location_freetemp(current_asmdata.CurrAsmList,left.location);
                  location_freetemp(current_asmdata.CurrAsmList,left.location);
-                 location_reset(left.location,LOC_REGISTER,OS_64);
+                 location_reset(left.location,LOC_REGISTER,left.location.size);
                  left.location.register64.reglo:=hregister;
                  left.location.register64.reglo:=hregister;
                  left.location.register64.reghi:=hregister2;
                  left.location.register64.reghi:=hregister2;
                end;
                end;
@@ -354,7 +354,7 @@ interface
       pass_left_right;
       pass_left_right;
 
 
       {The location.register will be filled in later (JM)}
       {The location.register will be filled in later (JM)}
-      location_reset(location,LOC_REGISTER,OS_INT);
+      location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
       { Mul supports registers and references, so if not register/reference,
       { Mul supports registers and references, so if not register/reference,
         load the location into a register}
         load the location into a register}
       use_ref:=false;
       use_ref:=false;

+ 4 - 4
compiler/i386/n386mat.pas

@@ -93,8 +93,8 @@ implementation
           { should be handled in pass_1 (JM) }
           { should be handled in pass_1 (JM) }
           internalerror(200109052);
           internalerror(200109052);
         { put numerator in register }
         { put numerator in register }
-        location_reset(location,LOC_REGISTER,OS_INT);
-        location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false);
+        location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+        location_force_reg(current_asmdata.CurrAsmList,left.location,location.size,false);
         hreg1:=left.location.register;
         hreg1:=left.location.register;
 
 
         if (nodetype=divn) and (right.nodetype=ordconstn) then
         if (nodetype=divn) and (right.nodetype=ordconstn) then
@@ -368,10 +368,10 @@ implementation
         v : TConstExprInt;
         v : TConstExprInt;
         l1,l2,l3:Tasmlabel;
         l1,l2,l3:Tasmlabel;
       begin
       begin
-        location_reset(location,LOC_REGISTER,OS_64);
+        location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
 
 
         { load left operator in a register }
         { load left operator in a register }
-        location_force_reg(current_asmdata.CurrAsmList,left.location,OS_64,false);
+        location_force_reg(current_asmdata.CurrAsmList,left.location,location.size,false);
         hreg64hi:=left.location.register64.reghi;
         hreg64hi:=left.location.register64.reghi;
         hreg64lo:=left.location.register64.reglo;
         hreg64lo:=left.location.register64.reglo;