MC machine encoding for simple aritmetic instructions that use a shifted
[oota-llvm.git] / lib / Target / ARM / ARMAddressingModes.h
index db481005b3a4c65483ad0cf0493bfcc9bd43f314..7f68c8109431decada2fa6ea23e5d1902d42375d 100644 (file)
@@ -50,6 +50,16 @@ namespace ARM_AM {
     }
   }
 
+  static inline unsigned getShiftOpcEncoding(ShiftOpc Op) {
+    switch (Op) {
+    default: assert(0 && "Unknown shift opc!");
+    case ARM_AM::asr: return 2;
+    case ARM_AM::lsl: return 0;
+    case ARM_AM::lsr: return 1;
+    case ARM_AM::ror: return 3;
+    }
+  }
+
   static inline ShiftOpc getShiftOpcForNode(SDValue N) {
     switch (N.getOpcode()) {
     default:          return ARM_AM::no_shift;