[PATCH] D16869: Fix printing of f16 machine operands

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 16:28:27 PST 2016


rampitec removed rL LLVM as the repository for this revision.
rampitec updated this revision to Diff 46851.
rampitec added a comment.

Changed unused => Unused.


http://reviews.llvm.org/D16869

Files:
  lib/CodeGen/MachineInstr.cpp

Index: lib/CodeGen/MachineInstr.cpp
===================================================================
--- lib/CodeGen/MachineInstr.cpp
+++ lib/CodeGen/MachineInstr.cpp
@@ -374,6 +374,12 @@
   case MachineOperand::MO_FPImmediate:
     if (getFPImm()->getType()->isFloatTy())
       OS << getFPImm()->getValueAPF().convertToFloat();
+    else if (getFPImm()->getType()->isHalfTy()) {
+      APFloat APF = getFPImm()->getValueAPF();
+      bool Unused;
+      APF.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &Unused);
+      OS << "half " << APF.convertToFloat();
+    }
     else
       OS << getFPImm()->getValueAPF().convertToDouble();
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16869.46851.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/27b71a87/attachment.bin>


More information about the llvm-commits mailing list