Add pattern for OR
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 3 May 2009 13:05:00 +0000 (13:05 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 3 May 2009 13:05:00 +0000 (13:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70720 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/MSP430/MSP430ISelLowering.cpp
lib/Target/MSP430/MSP430ISelLowering.h
lib/Target/MSP430/MSP430InstrInfo.td

index 39ee075661930ef08e2df47fa9936734ea037f85..e7149e541ecd926f35785ff0f8fcc4a6506ba651 100644 (file)
@@ -54,7 +54,6 @@ MSP430TargetLowering::MSP430TargetLowering(MSP430TargetMachine &tm) :
   setShiftAmountType(MVT::i8);
 
   setOperationAction(ISD::SRA, MVT::i16, Custom);
-
   setOperationAction(ISD::RET, MVT::Other, Custom);
 }
 
index e68b3ffe9f5c1f9378f64b0d72cf0cadc25e215a..d68c7a7ccf24d4a6afabb0e32264aec73b05be1a 100644 (file)
@@ -50,7 +50,6 @@ namespace llvm {
     SDValue LowerRET(SDValue Op, SelectionDAG &DAG);
     SDValue LowerCCCArguments(SDValue Op, SelectionDAG &DAG);
     SDValue LowerShifts(SDValue Op, SelectionDAG &DAG);
-
   private:
     const MSP430Subtarget &Subtarget;
     const MSP430TargetMachine &TM;
index 6eed56deb818fbc2610a046770584c18563fdec3..d1d02dbe5ebdef59c1309a7c8214849b03ebecec 100644 (file)
@@ -152,4 +152,15 @@ def SAR16r1 : Pseudo<(outs GR16:$dst), (ins GR16:$src),
                      [(set GR16:$dst, (MSP430rra GR16:$src)),
                       (implicit SR)]>;
 } // Defs = [SR]
+
+let isCommutable = 1 in { // X = OR Y, Z  == X = OR Z, Y
+def OR16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
+                    "bis.w\t{$src2, $dst|$dst, $src2}",
+                    [(set GR16:$dst, (or GR16:$src1, GR16:$src2))]>;
+}
+
+def OR16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
+                    "bis.w\t{$src2, $dst|$dst, $src2}",
+                    [(set GR16:$dst, (or GR16:$src1, imm:$src2))]>;
+
 } // isTwoAddress = 1