mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 17:20:30 +02:00
* load 64 bit constants through a register into memory to avoid store-forwarding stalls, resolves #40945
This commit is contained in:
parent
c83a047dda
commit
210cb8cb74
@ -955,6 +955,7 @@ unit cgx86;
|
||||
procedure tcgx86.a_load_const_ref(list : TAsmList; tosize: tcgsize; a : tcgint;const ref : treference);
|
||||
var
|
||||
tmpref : treference;
|
||||
tmpreg: TRegister;
|
||||
begin
|
||||
tmpref:=ref;
|
||||
make_simple_ref(list,tmpref);
|
||||
@ -963,9 +964,9 @@ unit cgx86;
|
||||
if (tosize in [OS_S64,OS_64]) and
|
||||
((a<low(longint)) or (a>high(longint))) then
|
||||
begin
|
||||
a_load_const_ref(list,OS_32,longint(a and $ffffffff),tmpref);
|
||||
inc(tmpref.offset,4);
|
||||
a_load_const_ref(list,OS_32,longint(a shr 32),tmpref);
|
||||
tmpreg:=getintregister(list,tosize);
|
||||
a_load_const_reg(list,tosize,a,tmpreg);
|
||||
a_load_reg_ref(list,tosize,tosize,tmpreg,tmpref);
|
||||
end
|
||||
else
|
||||
{$endif x86_64}
|
||||
|
Loading…
Reference in New Issue
Block a user