From bf7bf44727c0f26577e093a9cccdcbe44f163171 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 29 Sep 2024 20:48:33 +0300 Subject: [PATCH] * MIPS: don't generate FPU code for abs(real), sqr(real) and sqrt(real) in case FPU emulation is enabled --- compiler/mips/ncpuinln.pas | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/compiler/mips/ncpuinln.pas b/compiler/mips/ncpuinln.pas index d158a94091..39b375510d 100644 --- a/compiler/mips/ncpuinln.pas +++ b/compiler/mips/ncpuinln.pas @@ -46,7 +46,7 @@ implementation uses systems, - globtype, + globtype,globals, cutils, verbose, symconst, symdef, aasmtai, aasmcpu, aasmdata, @@ -74,22 +74,37 @@ end; function tMIPSELinlinenode.first_abs_real: tnode; begin - expectloc := LOC_FPUREGISTER; - first_abs_real := nil; + if not (cs_fp_emulation in current_settings.moduleswitches) then + begin + expectloc := LOC_FPUREGISTER; + first_abs_real := nil; + end + else + result:=inherited; end; function tMIPSELinlinenode.first_sqr_real: tnode; begin - expectloc := LOC_FPUREGISTER; - first_sqr_real := nil; + if not (cs_fp_emulation in current_settings.moduleswitches) then + begin + expectloc := LOC_FPUREGISTER; + first_sqr_real := nil; + end + else + result:=inherited; end; function tMIPSELinlinenode.first_sqrt_real: tnode; begin - expectloc := LOC_FPUREGISTER; - first_sqrt_real := nil; + if not (cs_fp_emulation in current_settings.moduleswitches) then + begin + expectloc := LOC_FPUREGISTER; + first_sqrt_real := nil; + end + else + result:=inherited; end;