Browse Source

* another fix for min/max intrinsics on x86_64 for non constant/reference/register locations, resolves #40724

florian 1 year ago
parent
commit
8cdb3deebd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/x86/nx86inl.pas

+ 4 - 0
compiler/x86/nx86inl.pas

@@ -1730,6 +1730,10 @@ implementation
                hlcg.location_force_reg(current_asmdata.CurrAsmList,paraarray[1].location,
                hlcg.location_force_reg(current_asmdata.CurrAsmList,paraarray[1].location,
                  paraarray[1].resultdef,paraarray[1].resultdef,true);
                  paraarray[1].resultdef,paraarray[1].resultdef,true);
 
 
+             if not(paraarray[2].location.loc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_REGISTER,LOC_CREGISTER]) then
+               hlcg.location_force_reg(current_asmdata.CurrAsmList,paraarray[2].location,
+                 paraarray[2].resultdef,paraarray[2].resultdef,true);
+
              location_reset(location,LOC_REGISTER,paraarray[1].location.size);
              location_reset(location,LOC_REGISTER,paraarray[1].location.size);
              location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
              location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);