From 01d6358f93faadd4ec8f61c1146d6a5178792580 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 22 Sep 2021 22:08:56 +0200 Subject: [PATCH] * some fixes for expectloc --- compiler/x86/nx86add.pas | 4 ++++ compiler/x86/nx86con.pas | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/x86/nx86add.pas b/compiler/x86/nx86add.pas index 160a3be1bf..3e3e408589 100644 --- a/compiler/x86/nx86add.pas +++ b/compiler/x86/nx86add.pas @@ -1170,6 +1170,10 @@ unit nx86add; make_not_regable(right,[ra_addr_regable]); end; Result:=inherited pass_1; + { correct expectloc, it does not matter of Result is set as another pass_1 is run on it + which will fix that one } + if use_vectorfpu(resultdef) then + expectloc:=LOC_MMREGISTER; end; diff --git a/compiler/x86/nx86con.pas b/compiler/x86/nx86con.pas index 1ec11ff33c..5d8c4f6e27 100644 --- a/compiler/x86/nx86con.pas +++ b/compiler/x86/nx86con.pas @@ -53,12 +53,14 @@ implementation result:=nil; if is_number_float(value_real) and not(use_vectorfpu(resultdef)) and ((value_real=1.0) or ((value_real=0.0) and (get_real_sign(value_real)=1))) then expectloc:=LOC_FPUREGISTER + else if (value_real=0.0) and (get_real_sign(value_real)=1) and use_vectorfpu(resultdef) then + expectloc:=LOC_MMREGISTER else expectloc:=LOC_CREFERENCE; end; - procedure tx86realconstnode.pass_generate_code; + procedure tx86realconstnode.pass_generate_code; begin if is_number_float(value_real) then begin