R600/SI: Remove handling of fpimm
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 13 Feb 2015 19:05:07 +0000 (19:05 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 13 Feb 2015 19:05:07 +0000 (19:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229136 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp

index 12aaaa7c7aadc52523d7630d4a330aae6db1c6a1..428248706bde5d6e592faa5c2296fd70b853815d 100644 (file)
@@ -31,12 +31,6 @@ using namespace llvm;
 
 namespace {
 
-/// \brief Helper type used in encoding
-typedef union {
-  int64_t I;
-  double F;
-} IntFloatUnion;
-
 class SIMCCodeEmitter : public  AMDGPUMCCodeEmitter {
   SIMCCodeEmitter(const SIMCCodeEmitter &) LLVM_DELETED_FUNCTION;
   void operator=(const SIMCCodeEmitter &) LLVM_DELETED_FUNCTION;
@@ -217,19 +211,15 @@ void SIMCCodeEmitter::EncodeInstruction(const MCInst &MI, raw_ostream &OS,
       continue;
 
     // Yes! Encode it
-    IntFloatUnion Imm;
+    int64_t Imm = 0;
+
     if (Op.isImm())
-      Imm.I = Op.getImm();
-    else if (Op.isFPImm())
-      Imm.F = Op.getFPImm();
-    else {
-      assert(Op.isExpr());
-      // This will be replaced with a fixup value.
-      Imm.I = 0;
-    }
+      Imm = Op.getImm();
+    else if (!Op.isExpr()) // Exprs will be replaced with a fixup value.
+      llvm_unreachable("Must be immediate or expr");
 
     for (unsigned j = 0; j < 4; j++) {
-      OS.write((uint8_t) ((Imm.I >> (8 * j)) & 0xff));
+      OS.write((uint8_t) ((Imm >> (8 * j)) & 0xff));
     }
 
     // Only one literal value allowed