Parcourir la source

* don't reuse loc_register

git-svn-id: trunk@4426 -
Jonas Maebe il y a 19 ans
Parent
commit
63123d3c62
1 fichiers modifiés avec 20 ajouts et 23 suppressions
  1. 20 23
      compiler/powerpc/nppcmat.pas

+ 20 - 23
compiler/powerpc/nppcmat.pas

@@ -516,32 +516,29 @@ end;
              location_copy(location,left.location);
              resultreg := location.register;
              hregister1 := location.register;
-             if (location.loc = LOC_CREGISTER) then
-               begin
-                 location.loc := LOC_REGISTER;
-                 resultreg := cg.getintregister(current_asmdata.CurrAsmList,OS_32);
-                 location.register := resultreg;
-               end;
+             location.loc := LOC_REGISTER;
+             resultreg := cg.getintregister(current_asmdata.CurrAsmList,location.size);
+             location.register := resultreg;
 
-              { determine operator }
-              if nodetype=shln then
-                op:=OP_SHL
-              else
-                op:=OP_SHR;
+             { determine operator }
+             if nodetype=shln then
+               op:=OP_SHL
+             else
+               op:=OP_SHR;
 
-              { shifting by a constant directly coded: }
-              if (right.nodetype=ordconstn) then
-                cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,op,OS_32,
-                  tordconstnode(right).value and 31,hregister1,resultreg)
-              else
-                begin
-                  { load shift count in a register if necessary }
-                  location_force_reg(current_asmdata.CurrAsmList,right.location,def_cgsize(right.resulttype.def),true);
-                  hregister2 := right.location.register;
+             { shifting by a constant directly coded: }
+             if (right.nodetype=ordconstn) then
+               cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,op,location.size,
+                 tordconstnode(right).value and 31,hregister1,resultreg)
+             else
+               begin
+                 { load shift count in a register if necessary }
+                 location_force_reg(current_asmdata.CurrAsmList,right.location,def_cgsize(right.resulttype.def),true);
+                 hregister2 := right.location.register;
 
-                  cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,op,OS_32,hregister2,
-                    hregister1,resultreg);
-                end;
+                 cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,op,location.size,hregister2,
+                  hregister1,resultreg);
+               end;
            end;
       end;