mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 09:10:25 +02:00
+ use pxor/vpxor to load 0.0
git-svn-id: trunk@47053 -
This commit is contained in:
parent
a8bc2f6947
commit
36d21d2d81
@ -41,6 +41,7 @@ implementation
|
||||
symdef,
|
||||
defutil,
|
||||
cpubase,
|
||||
aasmdata,
|
||||
cga,cgx86,cgobj,cgbase,cgutils;
|
||||
|
||||
{*****************************************************************************
|
||||
@ -68,14 +69,26 @@ implementation
|
||||
location.register:=NR_ST;
|
||||
tcgx86(cg).inc_fpu_stack;
|
||||
end
|
||||
else if (value_real=0.0) and not(use_vectorfpu(resultdef)) then
|
||||
else if value_real=0.0 then
|
||||
begin
|
||||
emit_none(A_FLDZ,S_NO);
|
||||
if (get_real_sign(value_real) < 0) then
|
||||
emit_none(A_FCHS,S_NO);
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location.register:=NR_ST;
|
||||
tcgx86(cg).inc_fpu_stack;
|
||||
if use_vectorfpu(resultdef) then
|
||||
begin
|
||||
location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
|
||||
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef));
|
||||
if UseAVX then
|
||||
emit_reg_reg_reg(A_VPXOR,S_NO,location.register,location.register,location.register)
|
||||
else
|
||||
emit_reg_reg(A_PXOR,S_NO,location.register,location.register);
|
||||
end
|
||||
else
|
||||
begin
|
||||
emit_none(A_FLDZ,S_NO);
|
||||
if (get_real_sign(value_real) < 0) then
|
||||
emit_none(A_FCHS,S_NO);
|
||||
location_reset(location,LOC_FPUREGISTER,def_cgsize(resultdef));
|
||||
location.register:=NR_ST;
|
||||
tcgx86(cg).inc_fpu_stack;
|
||||
end;
|
||||
end
|
||||
else
|
||||
inherited pass_generate_code;
|
||||
|
Loading…
Reference in New Issue
Block a user