Procházet zdrojové kódy

* don't destroy source register when performing division of signed
number by constant power of two

git-svn-id: trunk@7431 -

Jonas Maebe před 18 roky
rodič
revize
683de5ada2
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      compiler/sparc/ncpumat.pas

+ 2 - 2
compiler/sparc/ncpumat.pas

@@ -107,8 +107,8 @@ implementation
                  { if signed, tmpreg=right value-1, otherwise 0 }
                  { if signed, tmpreg=right value-1, otherwise 0 }
                  cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_AND,OS_INT,tordconstnode(right).value-1,tmpreg);
                  cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_AND,OS_INT,tordconstnode(right).value-1,tmpreg);
                  { add to the left value }
                  { add to the left value }
-                 cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_INT,tmpreg,numerator);
-                 cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,aword(power),numerator,resultreg);
+                 cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_INT,numerator,tmpreg);
+                 cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SAR,OS_INT,aword(power),tmpreg,resultreg);
                end
                end
              else
              else
                cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SHR,OS_INT,aword(power),numerator,resultreg);
                cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SHR,OS_INT,aword(power),numerator,resultreg);