浏览代码

* release al/ax/eax immediately after the 'in', before (instead of after) moving
it to the destination imaginary register. This generates better code.

git-svn-id: trunk@39380 -

nickysn 7 年之前
父节点
当前提交
6cd88a24dc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      compiler/x86/nx86inl.pas

+ 2 - 2
compiler/x86/nx86inl.pas

@@ -402,8 +402,8 @@ implementation
                current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_IN,dsize,portnumber.location.value,dreg));
                current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_IN,dsize,portnumber.location.value,dreg));
                location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
                location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
                location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
                location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
-               hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,dtype,resultdef,dreg,location.register);
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,dreg);
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,dreg);
+               hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,dtype,resultdef,dreg,location.register);
              end
              end
            else
            else
              begin
              begin
@@ -414,8 +414,8 @@ implementation
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,NR_DX);
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,NR_DX);
                location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
                location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
                location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
                location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
-               hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,dtype,resultdef,dreg,location.register);
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,dreg);
                hlcg.ungetcpuregister(current_asmdata.CurrAsmList,dreg);
+               hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,dtype,resultdef,dreg,location.register);
              end;
              end;
          end;
          end;