Add a Thumb2 instruction flag to that indicates whether the instruction can be transf...
authorEvan Cheng <evan.cheng@apple.com>
Wed, 8 Jul 2009 01:46:35 +0000 (01:46 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 8 Jul 2009 01:46:35 +0000 (01:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74988 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARM.td
lib/Target/ARM/ARMInstrFormats.td
lib/Target/ARM/ARMInstrInfo.h

index 9001e5033c7dba44fd91ced26af8bb1a8aa05d48..2ed6b9c6c2f6ac82c7fe5b9824458e7e78953e1b 100644 (file)
@@ -131,13 +131,13 @@ def ARMInstrInfo : InstrInfo {
   let TSFlagsFields = ["AddrModeBits",
                        "SizeFlag",
                        "IndexModeBits",
-                       "isUnaryDataProc",
-                       "Form"];
+                       "Form",
+                       "isUnaryDataProc"];
   let TSFlagsShifts = [0,
                        4,
                        7,
                        9,
-                       10];
+                       15];
 }
 
 //===----------------------------------------------------------------------===//
index 301a6c1a5cca4388af73fa6255d2e39e95282705..b9868ccf6aede184bba7521ef2020d099458ac24 100644 (file)
@@ -54,9 +54,16 @@ def NEONGetLnFrm  : Format<25>;
 def NEONSetLnFrm  : Format<26>;
 def NEONDupFrm    : Format<27>;
 
-// Misc flag for data processing instructions that indicates whether
+// Misc flags.
+
 // the instruction has a Rn register operand.
-class UnaryDP  { bit isUnaryDataProc = 1; }
+// UnaryDP - Indicates this is a unary data processing instruction, i.e.
+// it doesn't have a Rn operand.
+class UnaryDP    { bit isUnaryDataProc = 1; }
+
+// Xform16Bit - Indicates this Thumb2 instruction may be transformed into
+// a 16-bit Thumb instruction if certain conditions are met.
+class Xform16Bit { bit canXformTo16Bit = 1; }
 
 //===----------------------------------------------------------------------===//
 // ARM Instruction flags.  These need to match ARMInstrInfo.h.
@@ -130,6 +137,7 @@ class InstARM<AddrMode am, SizeFlagVal sz, IndexMode im,
   // Attributes specific to ARM instructions...
   //
   bit isUnaryDataProc = 0;
+  bit canXformTo16Bit = 0;
   
   let Constraints = cstr;
 }
index 8c8f7883a06ce21e2984996d6e42fe111c09c322..ea8947d2f63f76c42bc13d84a9e815cb9d234c59 100644 (file)
@@ -65,18 +65,11 @@ namespace ARMII {
     IndexModePre   = 1,
     IndexModePost  = 2,
 
-    //===------------------------------------------------------------------===//
-    // Misc flags.
-
-    // UnaryDP - Indicates this is a unary data processing instruction, i.e.
-    // it doesn't have a Rn operand.
-    UnaryDP       = 1 << 9,
-
     //===------------------------------------------------------------------===//
     // Instruction encoding formats.
     //
-    FormShift     = 10,
-    FormMask      = 0x1f << FormShift,
+    FormShift     = 9,
+    FormMask      = 0x3f << FormShift,
 
     // Pseudo instructions
     Pseudo        = 0  << FormShift,
@@ -126,6 +119,17 @@ namespace ARMII {
     NEONSetLnFrm  = 26 << FormShift,
     NEONDupFrm    = 27 << FormShift,
 
+    //===------------------------------------------------------------------===//
+    // Misc flags.
+
+    // UnaryDP - Indicates this is a unary data processing instruction, i.e.
+    // it doesn't have a Rn operand.
+    UnaryDP       = 1 << 15,
+
+    // Xform16Bit - Indicates this Thumb2 instruction may be transformed into
+    // a 16-bit Thumb instruction if certain conditions are met.
+    Xform16Bit    = 1 << 16,
+
     //===------------------------------------------------------------------===//
     // Field shifts - such shifts are used to set field while generating
     // machine instructions.