From 5e9eb673f8141c2a931e971448cf1264d55e7f04 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 12 Sep 2021 20:28:40 +0200 Subject: [PATCH] * x86: only add mm capable consts to register candidate list, this is better than checking when they are assigned --- compiler/optcse.pas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/optcse.pas b/compiler/optcse.pas index 5485a3cd2c..c2be25f23e 100644 --- a/compiler/optcse.pas +++ b/compiler/optcse.pas @@ -604,7 +604,13 @@ unit optcse; begin result:=fen_true; consts:=pconstentries(arg); - if n.nodetype=realconstn then + if (n.nodetype=realconstn) +{$ifdef x86} + { x87 consts would end up in memory, so loading them in temps. makes no sense } + and use_vectorfpu(n.resultdef) +{$endif x86} + + then begin found:=false; i:=0; @@ -735,10 +741,6 @@ unit optcse; if { if there is a call, we need most likely to save/restore a register } ((constentries[i].weight>3) or ((constentries[i].weight>1) and not(pi_do_call in current_procinfo.flags))) -{$ifdef x86} - { x87 consts would end up in memory, so loading them in temps. makes no sense } - and use_vectorfpu(constentries[i].valuenode.resultdef) -{$endif x86} then begin old_current_filepos:=current_filepos;