[llvm-dev] Default FPENV state

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 14 06:34:57 PDT 2017


Hi, Dinar,

You should assume that FPU exceptions are not enabled. LLVM does not 
(currently) support them. That having been said, in this particular 
case, the output is also different if a NaN is produced (i.e. it 
produces a NaN and not a -1), and so I'd think you can only do this 
transformations when the call has the nnan flag (e.g. because the code 
was compiled with -ffinite-math-only).

  -Hal

On 06/14/2017 05:06 AM, Dinar Temirbulatov wrote:
> Hi,
> We are interesting in expanding some vector operations directly in the
> IR form as constants https://reviews.llvm.org/D33406,
> for example: _mm256_cmp_ps("any input", "any input", _CMP_TRUE_UQ)
> should produce -1, -1, -1, ... vector, but for some values for example
> "1.00 -nan" if FPU exceptions were enabled this operation triggers the
> exception. Here is the question: Should we assume that FPENV was
> initialized with FE_ALL_EXCEPT by default or we could rely for example
> on "-fno-trapping-math" flag or we could completely ignore the FPU
> exception issue(see https://bugs.llvm.org/show_bug.cgi?id=6050)?
>
>                  Thanks, Dinar.

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list