Browse Source

* x86: EDX is now deallocated before MULX instructions in the "magic div" algorithm so it can be used as the destination

J. Gareth "Curious Kit" Moreton 3 years ago
parent
commit
645fe8a0c3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/x86/nx86mat.pas

+ 2 - 2
compiler/x86/nx86mat.pas

@@ -510,8 +510,8 @@ interface
                 hreg4 := hreg2;
                 hreg4 := hreg2;
                 setsubreg(hreg4, SubSize);
                 setsubreg(hreg4, SubSize);
 
 
-                emit_reg_reg_reg(A_MULX, exp_opsize, hreg3, hreg4, hreg4);
                 cg.ungetcpuregister(current_asmdata.CurrAsmList, exp_regd);
                 cg.ungetcpuregister(current_asmdata.CurrAsmList, exp_regd);
+                emit_reg_reg_reg(A_MULX, exp_opsize, hreg3, hreg4, hreg4);
               end
               end
             else
             else
               begin
               begin
@@ -524,8 +524,8 @@ interface
                 cg.getcpuregister(current_asmdata.CurrAsmList, regd);
                 cg.getcpuregister(current_asmdata.CurrAsmList, regd);
                 emit_const_reg(A_MOV, opsize, aint(m), regd);
                 emit_const_reg(A_MOV, opsize, aint(m), regd);
                 hreg2 := cg.getintregister(current_asmdata.CurrAsmList, cgsize);
                 hreg2 := cg.getintregister(current_asmdata.CurrAsmList, cgsize);
-                emit_reg_reg_reg(A_MULX, opsize, hreg1, hreg2, hreg2);
                 cg.ungetcpuregister(current_asmdata.CurrAsmList, regd);
                 cg.ungetcpuregister(current_asmdata.CurrAsmList, regd);
+                emit_reg_reg_reg(A_MULX, opsize, hreg1, hreg2, hreg2);
 
 
                 if m_add then
                 if m_add then
                   begin
                   begin