[PATCH] D16869: Fix printing of f16 machine operands
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 3 17:08:46 PST 2016
rampitec updated this revision to Diff 46853.
rampitec added a comment.
Changed braces use.
http://reviews.llvm.org/D16869
Files:
MachineInstr.cpp
Index: MachineInstr.cpp
===================================================================
--- MachineInstr.cpp
+++ MachineInstr.cpp
@@ -372,10 +372,16 @@
getCImm()->getValue().print(OS, false);
break;
case MachineOperand::MO_FPImmediate:
- if (getFPImm()->getType()->isFloatTy())
+ if (getFPImm()->getType()->isFloatTy()) {
OS << getFPImm()->getValueAPF().convertToFloat();
- else
+ } 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;
case MachineOperand::MO_MachineBasicBlock:
OS << "<BB#" << getMBB()->getNumber() << ">";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16869.46853.patch
Type: text/x-patch
Size: 847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/9bc2da12/attachment.bin>
More information about the llvm-commits
mailing list