diff options
author | Michael Klemm <michael.klemm@amd.com> | 2025-10-02 10:50:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-02 10:50:05 +0200 |
commit | 8aa64edb34ec6b30e1e7d0dbcc86236a6290eb0c (patch) | |
tree | d0e1d84dc9899f428192e1c92adc6e044465006b /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 031fb7414fd6edf20e0cd7f7783666313169a0d2 (diff) | |
download | llvm-8aa64edb34ec6b30e1e7d0dbcc86236a6290eb0c.zip llvm-8aa64edb34ec6b30e1e7d0dbcc86236a6290eb0c.tar.gz llvm-8aa64edb34ec6b30e1e7d0dbcc86236a6290eb0c.tar.bz2 |
[Flang] Add -ffast-real-mod and direct code for MOD on REAL types (#160660)
This patch adds direct code-gen support for a faster MOD intrinsic for
REAL types. Flang has maintained and keeps maintaining a high-precision
implementation of the MOD intrinsic as part of the Fortran runtime. With
the -ffast-real-mod flag, users can opt to avoid calling into the
Fortran runtime, but instead trigger code-gen that produces faster code
by avoiding the runtime call, at the expense of potentially risking bit
cancelation by having the compiler use the MOD formula a specified by
ISO Fortran.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 81610ed..548ca67 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1425,6 +1425,9 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc, opts.setFPContractMode(Fortran::common::LangOptions::FPM_Fast); } + if (args.hasArg(clang::driver::options::OPT_fno_fast_real_mod)) + opts.NoFastRealMod = true; + return true; } |