[cfe-users] Is there a command line switch comparable to gcc's -fcx-limited-range ?

Christian Buchner via cfe-users cfe-users at lists.llvm.org
Wed Sep 30 05:23:53 PDT 2020


Hi,

we have a fairly large code base that spends significant time in library
routines like __mulsc3 and __muldc3 which are called whenever complex float
or double types are multiplied.

To improve this situation for people who want to trade speed for C99
compliance of complex multiplications, the gcc compiler provides the
command line switch -fcx-limited-range. It makes the compiler use the naive
complex multiplication formula that does not explicitly check for Inf, and
NaN and does not handle intermediate overflow properly.

As far as I know clang supports the #pragma STDC CX_LIMITED_RANGE ON to
achieve the same effect. However it seems a bit overboard to add this
pragma to hundreds of compilation units. Is there a command line switch in
the clang compiler frontend that has the same effect? Alternatively, can
pragmas be specified from the command line, similar to how -D allows
setting #defines ?

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20200930/dc56597e/attachment.html>


More information about the cfe-users mailing list