[CodeGen] Convert double -> __fp16 in one step.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 23 Mar 2015 17:48:07 +0000 (17:48 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 23 Mar 2015 17:48:07 +0000 (17:48 +0000)
commit47ec2c7479de7527c955c93fce1323717c58782c
tree00053954d42ec8a0c2dfb1d58cca8de30f2207ba
parentaffe181b397be2bef404e0158b3a8410795fd716
[CodeGen] Convert double -> __fp16 in one step.

Fix the CodeGen so that for types bigger than float, instead of
converting to fp16 via the sequence "InTy -> float -> fp16", we
perform conversions in just one step.  This avoids the double
rounding which potentially changes results from a natural
IEEE-754 operation.

rdar://17594379, rdar://17468714
Differential Revision: http://reviews.llvm.org/D4602
Part of: http://reviews.llvm.org/D8367

llvm-svn: 232968
clang/lib/CodeGen/CGExprScalar.cpp
clang/test/CodeGen/fp16-ops.c