]> granicus.if.org Git - clang/commit
[CodeGen] Properly support the half FP type with non-native operations.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 23 Mar 2015 17:54:16 +0000 (17:54 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 23 Mar 2015 17:54:16 +0000 (17:54 +0000)
commitdc18cb9e2de3b40f37b9fdf390ef5d0f21334c4b
tree5f7c8fcf03478b05e3d5dc18888463befad842fc
parentc86a805eae835415be6ea788178a7d8efcfcdd4a
[CodeGen] Properly support the half FP type with non-native operations.

On AArch64, the -fallow-half-args-and-returns option is the default.
With it, the half type is considered legal (rather than the i16 used
normally for __fp16), but no operation is, except conversions and
load/stores and such.

The previous behavior was tantamount to saying LangOpts.NativeHalfType
was implied by LangOpts.HalfArgsAndReturns, which isn't true.
Instead, teach the various parts of CodeGen that already know about
half (using the intrinsics or not) about this weird in-between case,
where the "half" type is legal, but operations on it aren't.

This is a smaller intermediate step to the end-goal of removing the
intrinsic, always using "half", and letting the backend legalize.

Builds on r232968.
rdar://20045970, rdar://17468714
Differential Revision: http://reviews.llvm.org/D8367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232971 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprScalar.cpp
test/CodeGen/fp16-ops.c