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)
commit15f91c5240ab3dfea362300cf017d4d88f2f27df
tree21f85e84a2229ca04790f8402a255dbd2997e5ef
parentf2eacabd666e48b3ce4762861f5ec1a8dc3833a8
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
llvm-svn: 223110
llvm/include/llvm/Support/ARMBuildAttributes.h
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/test/CodeGen/ARM/build-attributes.ll