Browse Source

+ set pi_do_call on ARM as well if we check for fpu exceptions

florian 1 year ago
parent
commit
8146443336
2 changed files with 18 additions and 2 deletions
  1. 4 0
      compiler/arm/narmadd.pas
  2. 14 2
      compiler/arm/narminl.pas

+ 4 - 0
compiler/arm/narmadd.pas

@@ -573,6 +573,10 @@ interface
                (unsigned and (nodetype in [ltn,lten,gtn,gten]))
                (unsigned and (nodetype in [ltn,lten,gtn,gten]))
               ) then
               ) then
               expectloc:=LOC_FLAGS;
               expectloc:=LOC_FLAGS;
+            if (left.resultdef.typ=floatdef) and
+              ([FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE]*fpu_capabilities[current_settings.fputype]<>[]) and
+              needs_check_for_fpu_exceptions then
+              Include(current_procinfo.flags,pi_do_call);
           end;
           end;
       end;
       end;
 
 

+ 14 - 2
compiler/arm/narminl.pas

@@ -61,6 +61,7 @@ implementation
 
 
     uses
     uses
       globtype,verbose,globals,
       globtype,verbose,globals,
+      procinfo,
       cpuinfo, defutil,symdef,aasmdata,aasmcpu,
       cpuinfo, defutil,symdef,aasmdata,aasmcpu,
       cgbase,cgutils,pass_1,pass_2,
       cgbase,cgutils,pass_1,pass_2,
       cpubase,ncgutil,cgobj,cgcpu, hlcgobj,
       cpubase,ncgutil,cgobj,cgcpu, hlcgobj,
@@ -135,6 +136,9 @@ implementation
               else
               else
                 internalerror(2009112401);
                 internalerror(2009112401);
             end;
             end;
+            if ([FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE]*fpu_capabilities[current_settings.fputype]<>[]) and
+              needs_check_for_fpu_exceptions then
+              Include(current_procinfo.flags,pi_do_call);
             first_abs_real:=nil;
             first_abs_real:=nil;
           end;
           end;
       end;
       end;
@@ -163,6 +167,9 @@ implementation
               else
               else
                 internalerror(2009112402);
                 internalerror(2009112402);
             end;
             end;
+            if ([FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE]*fpu_capabilities[current_settings.fputype]<>[]) and
+              needs_check_for_fpu_exceptions then
+              Include(current_procinfo.flags,pi_do_call);
             first_sqr_real:=nil;
             first_sqr_real:=nil;
           end;
           end;
       end;
       end;
@@ -191,6 +198,9 @@ implementation
               else
               else
                 internalerror(2009112403);
                 internalerror(2009112403);
             end;
             end;
+            if ([FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE]*fpu_capabilities[current_settings.fputype]<>[]) and
+              needs_check_for_fpu_exceptions then
+              Include(current_procinfo.flags,pi_do_call);
             first_sqrt_real := nil;
             first_sqrt_real := nil;
           end;
           end;
       end;
       end;
@@ -198,11 +208,13 @@ implementation
 
 
      function tarminlinenode.first_fma : tnode;
      function tarminlinenode.first_fma : tnode;
        begin
        begin
-         if (true) and
-           ((is_double(resultdef)) or (is_single(resultdef))) then
+         if ((is_double(resultdef)) or (is_single(resultdef))) then
            begin
            begin
              expectloc:=LOC_MMREGISTER;
              expectloc:=LOC_MMREGISTER;
              Result:=nil;
              Result:=nil;
+             if ([FPUARM_HAS_VFP_EXTENSION,FPUARM_HAS_VFP_DOUBLE]*fpu_capabilities[current_settings.fputype]<>[]) and
+               needs_check_for_fpu_exceptions then
+               Include(current_procinfo.flags,pi_do_call);
            end
            end
          else
          else
            Result:=inherited first_fma;
            Result:=inherited first_fma;