Explorar el Código

* avoid some superfluous memory accesses when converting a double
precision/comp value in an fpu register to an sse value

git-svn-id: trunk@9420 -

Jonas Maebe hace 17 años
padre
commit
91e0e5db17
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  1. 8 2
      compiler/ncgcnv.pas

+ 8 - 2
compiler/ncgcnv.pas

@@ -272,6 +272,10 @@ interface
 
 
     procedure tcgtypeconvnode.second_real_to_real;
+{$ifdef x86}
+      var
+        tr: treference;
+{$endif x86}
       begin
          location_reset(location,expectloc,def_cgsize(resultdef));
 {$ifdef x86}
@@ -284,8 +288,10 @@ interface
              if (left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
                location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
              { round them down to the proper precision }
-             cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,left.location.register);
-             left.location.size:=location.size;
+             tg.gettemp(current_asmdata.currasmlist,resultdef.size,tt_normal,tr);
+             cg.a_loadfpu_reg_ref(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,tr);
+             location_reset(left.location,LOC_REFERENCE,location.size);
+             left.location.reference:=tr;
            end;
 {$endif x86}
          case left.location.loc of