Add a SPR register class to the ARM target.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 22 Dec 2009 23:54:44 +0000 (23:54 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 22 Dec 2009 23:54:44 +0000 (23:54 +0000)
Certain Thumb instructions require only SP (e.g. tSTRspi).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91944 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb.td
lib/Target/ARM/ARMRegisterInfo.td

index c92dd0e28ff66e9e15cbff35850d4222ca9e8a57..34d7d8f6eff55e11f395f0163172654ba69ef43a 100644 (file)
@@ -113,7 +113,7 @@ def t_addrmode_s1 : Operand<i32>,
 def t_addrmode_sp : Operand<i32>,
                     ComplexPattern<i32, 2, "SelectThumbAddrModeSP", []> {
   let PrintMethod = "printThumbAddrModeSPOperand";
-  let MIOperandInfo = (ops tGPR:$base, i32imm:$offsimm);
+  let MIOperandInfo = (ops JustSP:$base, i32imm:$offsimm);
 }
 
 //===----------------------------------------------------------------------===//
index d393e8d7e3e26e58a8cf93b5eb57fe7c01be976e..9fbde815cdb50a79e2aa4bea6967a100b551f4d1 100644 (file)
@@ -367,6 +367,19 @@ def QPR_8 : RegisterClass<"ARM", [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
 // Condition code registers.
 def CCR : RegisterClass<"ARM", [i32], 32, [CPSR]>;
 
+// Just the stack pointer (for tSTRspi and friends).
+def JustSP : RegisterClass<"ARM", [i32], 32, [SP]> {
+  let MethodProtos = [{
+    iterator allocation_order_end(const MachineFunction &MF) const;
+  }];
+  let MethodBodies = [{
+      JustSPClass::iterator
+      JustSPClass::allocation_order_end(const MachineFunction &MF) const {
+        return allocation_order_begin(MF);
+      }
+  }];
+}
+
 //===----------------------------------------------------------------------===//
 // Subregister Set Definitions... now that we have all of the pieces, define the
 // sub registers for each register.