For pre-v6t2 targets, only select MOVi32imm if the immediate can be handled with...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 12 Nov 2010 23:46:13 +0000 (23:46 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 12 Nov 2010 23:46:13 +0000 (23:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118945 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
lib/Target/ARM/InstPrinter/ARMInstPrinter.h

index 95106218b3a7359fb91d88cb334859a765b435a1..a0611649c02bb47925b235a0847e851e589655b2 100644 (file)
@@ -359,12 +359,17 @@ def so_imm : Operand<i32>, PatLeaf<(imm), [{ return Pred_so_imm(N); }]> {
 // Break so_imm's up into two pieces.  This handles immediates with up to 16
 // bits set in them.  This uses so_imm2part to match and so_imm2part_[12] to
 // get the first/second pieces.
-def so_imm2part : Operand<i32>,
-                  PatLeaf<(imm), [{
+def so_imm2part : PatLeaf<(imm), [{
       return ARM_AM::isSOImmTwoPartVal((unsigned)N->getZExtValue());
-    }]> {
-  let PrintMethod = "printSOImm2PartOperand";
-}
+}]>;
+
+/// arm_i32imm - True for +V6T2, or true only if so_imm2part is true.
+///
+def arm_i32imm : PatLeaf<(imm), [{
+  if (Subtarget->hasV6T2Ops())
+    return true;
+  return ARM_AM::isSOImmTwoPartVal((unsigned)N->getZExtValue());
+}]>;
 
 def so_imm2part_1 : SDNodeXForm<imm, [{
   unsigned V = ARM_AM::getSOImmTwoPartFirst((unsigned)N->getZExtValue());
@@ -3223,7 +3228,7 @@ def : ARMPat<(add GPR:$LHS, so_neg_imm2part:$RHS),
 // FIXME: Remove this when we can do generalized remat.
 let isReMaterializable = 1 in
 def MOVi32imm : PseudoInst<(outs GPR:$dst), (ins i32imm:$src), IIC_iMOVix2, "",
-                           [(set GPR:$dst, (i32 imm:$src))]>,
+                           [(set GPR:$dst, (arm_i32imm:$src))]>,
                            Requires<[IsARM]>;
 
 // ConstantPool, GlobalAddress, and JumpTable
index 790557037c4257562ecf533465db01d752dc64e8..cb8f78772e2e3d21f6c77d195e172695ade42723 100644 (file)
@@ -160,14 +160,6 @@ void ARMInstPrinter::printSOImmOperand(const MCInst *MI, unsigned OpNum,
   printSOImm(O, MO.getImm(), CommentStream, &MAI);
 }
 
-/// printSOImm2PartOperand - SOImm is broken into two pieces using a 'mov'
-/// followed by an 'orr' to materialize.
-void ARMInstPrinter::printSOImm2PartOperand(const MCInst *MI, unsigned OpNum,
-                                            raw_ostream &O) {
-  // FIXME: REMOVE this method.
-  abort();
-}
-
 // so_reg is a 4-operand unit corresponding to register forms of the A5.1
 // "Addressing Mode 1 - Data-processing operands" forms.  This includes:
 //    REG 0   0           - e.g. R5
index f4382b0e515ef17ad78db2fb27cc67d258dace17..1a36f4830a0b908cdc26da4f2327af1b3dec5ccd 100644 (file)
@@ -36,7 +36,6 @@ public:
   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
 
   void printSOImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
-  void printSOImm2PartOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
 
   void printSORegOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
   void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, raw_ostream &O);