OSDN Git Service

[CodeGen] Always promote f16 if not legal
authorOliver Stannard <oliver.stannard@arm.com>
Mon, 9 Nov 2015 11:03:18 +0000 (11:03 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Mon, 9 Nov 2015 11:03:18 +0000 (11:03 +0000)
commitb32894764b8608996b18d364252661d9d08c0e78
treea39e3ba8e023d8d2fd78e86d5d577db2d77787db
parenta9275b1c2440f01a7fb16e3d9259288a0b8305e3
[CodeGen] Always promote f16 if not legal

We don't currently have any runtime library functions for operations on
f16 values (other than conversions to and from f32 and f64), so we
should always promote it to f32, even if that is not a legal type. In
that case, the f32 values would be softened to f32 library calls.

SoftenFloatRes_FP_EXTEND now needs to check the promoted operand's type,
as it may ne a no-op or require a different library call.

getCopyFromParts and getCopyToParts now need to cope with a
floating-point value stored in a larger integer part, as is the case for
any target that needs to store an f16 value in a 32-bit integer
register.

Differential Revision: http://reviews.llvm.org/D12856

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252459 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/TargetLoweringBase.cpp
test/CodeGen/ARM/fp16-promote.ll