[XLA:CPU] Add FP32<->FP16 conversion routines
authorSanjoy Das <sanjoy@google.com>
Wed, 21 Feb 2018 07:12:57 +0000 (23:12 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 21 Feb 2018 07:17:10 +0000 (23:17 -0800)
commit241c944a423892c658b47b16958a75194e3d11b1
treed92d34dff940858abd6bb55f92afa96fb41f44eb
parentd5e35145e9016077cbe045968e8de59358040622
[XLA:CPU] Add FP32<->FP16 conversion routines

LLVM generates calls to these functions when lowering some fp16 operations on
certain architectures.  These symbols are defined in compiler-rt but we don't
always link to compiler-rt so these symbols are sometimes absent.

This change adds __gnu_f2h_ieee and __gnu_h2f_ieee as weak symbols.  Making them
weak ensures that we are able to build successfully even when linking to a
compiler-rt that defines these symbols.

PiperOrigin-RevId: 186416684
tensorflow/compiler/xla/service/cpu/BUILD
tensorflow/compiler/xla/service/cpu/runtime_fp16.cc [new file with mode: 0644]
tensorflow/compiler/xla/service/cpu/runtime_fp16.h [new file with mode: 0644]
tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc
tensorflow/compiler/xla/tests/BUILD
tensorflow/compiler/xla/tests/convert_test.cc
tensorflow/compiler/xla/tests/literal_test_util.cc