summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2019-04-30 19:17:59 +0000
committerDan Gohman <dan433584@gmail.com>2019-04-30 19:17:59 +0000
commit3a7532e645b959f69214578d14dc633baf564df0 (patch)
tree44e13b44651327332af8ef501acd79f36985c7cf /llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
parent1ca746170bb201cf396465c7ae2f0c260f6deb69 (diff)
downloadbcm5719-llvm-3a7532e645b959f69214578d14dc633baf564df0.tar.gz
bcm5719-llvm-3a7532e645b959f69214578d14dc633baf564df0.zip
[WebAssembly] Support f16 libcalls
Add support for f16 libcalls in WebAssembly. This entails adding signatures for the remaining F16 libcalls, and renaming gnu_f2h_ieee/gnu_h2f_ieee to truncsfhf2/extendhfsf2 for consistency between f32 and f64/f128 (compiler-rt already supports this). Differential Revision: https://reviews.llvm.org/D61287 Reviewer: dschuff llvm-svn: 359600
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index 105b1360ac2..3d805344483 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -271,6 +271,11 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
MaxStoresPerMemsetOptSize = 1;
}
+ // Override the __gnu_f2h_ieee/__gnu_h2f_ieee names so that the f32 name is
+ // consistent with the f64 and f128 names.
+ setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfsf2");
+ setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
+
// Always convert switches to br_tables unless there is only one case, which
// is equivalent to a simple branch. This reduces code size for wasm, and we
// defer possible jump table optimizations to the VM.
OpenPOWER on IntegriCloud