Use helper function
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 23 Jun 2014 18:00:24 +0000 (18:00 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 23 Jun 2014 18:00:24 +0000 (18:00 +0000)
llvm-svn: 211510

llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp

index 11ae091..a935f9e 100644 (file)
@@ -216,13 +216,8 @@ void AMDGPUInstPrinter::printClamp(const MCInst *MI, unsigned OpNo,
 
 void AMDGPUInstPrinter::printLiteral(const MCInst *MI, unsigned OpNo,
                                      raw_ostream &O) {
-  union Literal {
-    float f;
-    int32_t i;
-  } L;
-
-  L.i = MI->getOperand(OpNo).getImm();
-  O << L.i << "(" << L.f << ")";
+  int32_t Imm = MI->getOperand(OpNo).getImm();
+  O << Imm << '(' << BitsToFloat(Imm) << ')';
 }
 
 void AMDGPUInstPrinter::printLast(const MCInst *MI, unsigned OpNo,