diff --git a/compiler/x86/nx86inl.pas b/compiler/x86/nx86inl.pas index 5b80680e63..9837bb3c70 100644 --- a/compiler/x86/nx86inl.pas +++ b/compiler/x86/nx86inl.pas @@ -91,15 +91,25 @@ implementation function tx86inlinenode.first_pi : tnode; begin - expectloc:=LOC_FPUREGISTER; - first_pi := nil; + if (tfloatdef(pbestrealtype^).floattype=s80real) then + begin + expectloc:=LOC_FPUREGISTER; + first_pi := nil; + end + else + result:=inherited; end; function tx86inlinenode.first_arctan_real : tnode; begin - expectloc:=LOC_FPUREGISTER; - first_arctan_real := nil; + if (tfloatdef(pbestrealtype^).floattype=s80real) then + begin + expectloc:=LOC_FPUREGISTER; + first_arctan_real := nil; + end + else + result:=inherited; end; function tx86inlinenode.first_abs_real : tnode; @@ -113,20 +123,31 @@ implementation function tx86inlinenode.first_sqr_real : tnode; begin - expectloc:=LOC_FPUREGISTER; + if use_vectorfpu(resultdef) then + expectloc:=LOC_MMREGISTER + else + expectloc:=LOC_FPUREGISTER; first_sqr_real := nil; end; function tx86inlinenode.first_sqrt_real : tnode; begin - expectloc:=LOC_FPUREGISTER; + if use_vectorfpu(resultdef) then + expectloc:=LOC_MMREGISTER + else + expectloc:=LOC_FPUREGISTER; first_sqrt_real := nil; end; function tx86inlinenode.first_ln_real : tnode; begin - expectloc:=LOC_FPUREGISTER; - first_ln_real := nil; + if (tfloatdef(pbestrealtype^).floattype=s80real) then + begin + expectloc:=LOC_FPUREGISTER; + first_ln_real := nil; + end + else + result:=inherited; end; function tx86inlinenode.first_cos_real : tnode; diff --git a/rtl/x86_64/math.inc b/rtl/x86_64/math.inc index 2e8ec23540..1e7b1967fd 100644 --- a/rtl/x86_64/math.inc +++ b/rtl/x86_64/math.inc @@ -102,6 +102,9 @@ const result:=0; end; {$endif FPC_SYSTEM_HAS_SQRT} + +{$ifdef FPC_HAS_TYPE_EXTENDED} + {$ifndef FPC_SYSTEM_HAS_ARCTAN} {$define FPC_SYSTEM_HAS_ARCTAN} function fpc_arctan_real(d : ValReal) : ValReal;compilerproc; @@ -139,7 +142,6 @@ const end; {$endif FPC_SYSTEM_HAS_COS} -{$ifdef FPC_HAS_TYPE_EXTENDED} {$ifndef FPC_SYSTEM_HAS_EXP} {$define FPC_SYSTEM_HAS_EXP} function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;