Emit Tag_ABI_FP_denormal correctly in fast-math mode.
authorCharlie Turner <charlie.turner@arm.com>
Tue, 2 Dec 2014 08:22:29 +0000 (08:22 +0000)
committerCharlie Turner <charlie.turner@arm.com>
Tue, 2 Dec 2014 08:22:29 +0000 (08:22 +0000)
commit364f2f3fcff7273c150bc7fb8bfa2e3a65a036ad
treec5131971cc39d2a716c643eaba16c1cf61990c5b
parent4b0964871de3bbb760ee07403d1b7abfd3d0694d
Emit Tag_ABI_FP_denormal correctly in fast-math mode.

The default ARM floating-point mode does not support IEEE 754 mode exactly. Of
relevance to this patch is that input denormals are flushed to zero. The way in
which they're flushed to zero depends on the architecture,

  * For VFPv2, it is implementation defined as to whether the sign of zero is
    preserved.
  * For VFPv3 and above, the sign of zero is always preserved when a denormal
    is flushed to zero.

When FP support has been disabled, the strategy taken by this patch is to
assume the software support will mirror the behaviour of the hardware support
for the target *if it existed*. That is, for architectures which can only have
VFPv2, it is assumed the software will flush to positive zero. For later
architectures it is assumed the software will flush to zero preserving sign.

Change-Id: Icc5928633ba222a4ba3ca8c0df44a440445865fd

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223110 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/ARMBuildAttributes.h
lib/Target/ARM/ARMAsmPrinter.cpp
test/CodeGen/ARM/build-attributes.ll