summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/BinaryStreamRef.cpp
diff options
context:
space:
mode:
authorMikhail Maltsev <mikhail.maltsev@arm.com>2018-09-12 09:19:19 +0000
committerMikhail Maltsev <mikhail.maltsev@arm.com>2018-09-12 09:19:19 +0000
commite04ab4fe97100437fa1aa8d78754bde4999d6f3d (patch)
treeec4e5540b8d0b4fc7e306110b5023985559cfff3 /llvm/lib/Support/BinaryStreamRef.cpp
parenta023c7a9cb7564c26517cfd73737cfeabdc80330 (diff)
downloadbcm5719-llvm-e04ab4fe97100437fa1aa8d78754bde4999d6f3d.tar.gz
bcm5719-llvm-e04ab4fe97100437fa1aa8d78754bde4999d6f3d.zip
[CodeGen][ARM] Coerce FP16 vectors to integer vectors when needed
Summary: On targets that do not support FP16 natively LLVM currently legalizes vectors of FP16 values by scalarizing them and promoting to FP32. This causes problems for the following code: void foo(int, ...); typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t; void bar(float16x4_t x) { foo(42, x); } According to the AAPCS (appendix A.2) float16x4_t is a containerized vector fundamental type, so 'foo' expects that the 4 16-bit FP values are packed into 2 32-bit registers, but instead bar promotes them to 4 single precision values. Since we already handle scalar FP16 values in the frontend by bitcasting them to/from integers, this patch adds similar handling for vector types and homogeneous FP16 vector aggregates. One existing test required some adjustments because we now generate more bitcasts (so the patch changes the test to target a machine with native FP16 support). Reviewers: eli.friedman, olista01, SjoerdMeijer, javed.absar, efriedma Reviewed By: javed.absar, efriedma Subscribers: efriedma, kristof.beyls, cfe-commits, chrib Differential Revision: https://reviews.llvm.org/D50507 llvm-svn: 342034
Diffstat (limited to 'llvm/lib/Support/BinaryStreamRef.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud