[PATCH] Add support to promote f16 to f32

Ahmed Bougacha ahmed.bougacha at gmail.com
Mon Apr 13 13:40:58 PDT 2015


Looking better, thanks!


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1817
@@ +1816,3 @@
+// value and convert it to the promoted type.
+SDValue DAGTypeLegalizer::PromoteFloatRes_EXTRACT_VECTOR_ELT(SDNode *N) {
+  SDLoc dl(N);
----------------
This needs tests (also for insert_vector_elt ?)

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1932-1933
@@ +1931,4 @@
+
+// Explicit operation to reduce precision.  Similar to FROUND, reduce the value
+// to half precision and promote it back to the legal type.
+SDValue DAGTypeLegalizer::PromoteFloatRes_FP_ROUND(SDNode *N) {
----------------
Stale reference to FROUND?

================
Comment at: test/CodeGen/ARM/fp16-promote.ll:1
@@ +1,2 @@
+; RUN: llc -asm-verbose=false < %s -mattr=+vfp3,+fp16 | FileCheck %s
+
----------------
We should also have tests for non-native conversions with the libcall.

================
Comment at: test/CodeGen/Generic/fp16-promote.ll:1
@@ +1,2 @@
+; RUN: llc < %s
+
----------------
Some of the tests have half parameters and return types.  I'm not sure that's expected to work on all targets, is it?

If it's not, I still see value in a generic sanity check like this, so dealing with pointers instead is probably fine.

http://reviews.llvm.org/D8755

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list