================
@@ -327,6 +326,33 @@ defm real_sum_reassociation
         standard-conforming Fortran semantics.
       }]>;
 
+def ffpe_trap_EQ : Joined<["-"], "ffpe-trap=">, Group<f_Group>,
+  HelpText<"Set the initial floating-point exception halting mode for the main 
program">,
+  DocBrief<[{The ``-ffpe-trap=[list]`` option sets the initial floating-point
+exception halting mode for the main program unit. ``[list]`` is a 
comma-separated
+list of the exceptions to halt on: ``invalid``, ``zero``, ``overflow``,
+``underflow``, and ``inexact``, corresponding to the Fortran 2023 (17.6)
+``IEEE_FLAG_TYPE`` values ``IEEE_INVALID``, ``IEEE_DIVIDE_BY_ZERO``,
+``IEEE_OVERFLOW``, ``IEEE_UNDERFLOW``, and ``IEEE_INEXACT``. As a non-standard
+GFortran-compatible extension, ``denormal`` halts on the hardware denormal
+(subnormal) operand exception. An empty list, or the value ``none``, disables
+halting. In the absence of this option, the program runs with traps disabled
+(equivalent to passing ``none``). Multiple occurrences are allowed; only the
+last ``-ffpe-trap=`` takes effect.
+
+Halting is enabled only for exceptions the target's floating-point environment
+can trap on. Halting control is implemented for x86 targets and for glibc-based
+(Linux) targets; for other targets the compiler emits a warning that the option
----------------
vntkmr wrote:

I have updated the docbrief with a table to make things more clear. Basically, 
for now the support is dependent on glibc's `feenableexcept()` support.
In a future PR I will add an enhancement that on X86 with SSE can take 
advantage of the architecture instructions directly without relying on glibc. 

https://github.com/llvm/llvm-project/pull/208828
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to