Lane number should be printed w/o hash
[oota-llvm.git] / lib / Target / ARM / AsmPrinter / ARMAsmPrinter.cpp
index 3bbb3b9d4644fc4be843fea807938f3da6be070f..fc88f89f017aae82d0e0dbf5d2aabd1c8c27b803 100644 (file)
@@ -170,7 +170,7 @@ namespace {
                                        const char *ExtraCode);
 
     void PrintGlobalVariable(const GlobalVariable* GVar);
-    bool printInstruction(const MachineInstr *MI);  // autogenerated.
+    void printInstruction(const MachineInstr *MI);  // autogenerated.
     void printMachineInstruction(const MachineInstr *MI);
     bool runOnMachineFunction(MachineFunction &F);
     bool doInitialization(Module &M);
@@ -345,6 +345,11 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
         O << '{'
           << TRI->getAsmName(DRegLo) << ',' << TRI->getAsmName(DRegHi)
           << '}';
+      } else if (Modifier && strcmp(Modifier, "lane") == 0) {
+        unsigned RegNum = ARMRegisterInfo::getRegisterNumbering(Reg);
+        unsigned DReg = TRI->getMatchingSuperReg(Reg, RegNum & 1 ? 0 : 1,
+                                                 &ARM::DPRRegClass);
+        O << TRI->getAsmName(DReg) << '[' << (RegNum & 1) << ']';
       } else {
         O << TRI->getAsmName(Reg);
       }
@@ -354,7 +359,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
   }
   case MachineOperand::MO_Immediate: {
     if (!Modifier || strcmp(Modifier, "no_hash") != 0)
-      O << "#";
+      O << '#';
 
     O << MO.getImm();
     break;