Revert r118457 and r118458. These won't hold for GPRs.
authorBill Wendling <isanbard@gmail.com>
Tue, 9 Nov 2010 00:30:18 +0000 (00:30 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 9 Nov 2010 00:30:18 +0000 (00:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118462 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMMCCodeEmitter.cpp

index 0a988138a92f33405669f74cdfd5af90f4ffe14f..7c7257900fd916e1c43419ede17229219225e484 100644 (file)
@@ -278,7 +278,6 @@ def brtarget : Operand<OtherVT>;
 
 // A list of registers separated by comma. Used by load/store multiple.
 def reglist : Operand<i32> {
-  int NumOperands = 2;
   string EncoderMethod = "getRegisterListOpValue";
   let PrintMethod = "printRegisterList";
 }
index fe6bd34a2b600ba0fa01b35031b1754a9a5e9521..296a5c9ce3646d4a8ba6e2058ca7d344a79e69c9 100644 (file)
@@ -378,11 +378,14 @@ getBitfieldInvertedMaskOpValue(const MCInst &MI, unsigned Op,
 
 unsigned ARMMCCodeEmitter::
 getRegisterListOpValue(const MCInst &MI, unsigned Op,
-                       SmallVectorImpl<MCFixup> &) const {
-  // {12-8} = Rd
-  // {7-0}  = count
-  unsigned Binary = getARMRegisterNumbering(MI.getOperand(Op).getReg()) << 8;
-  Binary |= MI.getOperand(Op + 1).getImm() & 0xFF;
+                       SmallVectorImpl<MCFixup> &Fixups) const {
+  // Convert a list of GPRs into a bitfield (R0 -> bit 0). For each
+  // register in the list, set the corresponding bit.
+  unsigned Binary = 0;
+  for (unsigned i = Op, e = MI.getNumOperands(); i < e; ++i) {
+    unsigned regno = getARMRegisterNumbering(MI.getOperand(i).getReg());
+    Binary |= 1 << regno;
+  }
   return Binary;
 }