summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-08 01:46:35 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-08 01:46:35 +0000
commit14965760a741320918d7ad36d03cafc1ca9e4d98 (patch)
tree28e5f2065f7171772a838930fd432654a862a037 /llvm/lib
parent9f211fb4fac722ef78d173f1611b02ea3726d8c5 (diff)
downloadbcm5719-llvm-14965760a741320918d7ad36d03cafc1ca9e4d98.tar.gz
bcm5719-llvm-14965760a741320918d7ad36d03cafc1ca9e4d98.zip
Add a Thumb2 instruction flag to that indicates whether the instruction can be transformed to 16-bit variant.
llvm-svn: 74988
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARM.td6
-rw-r--r--llvm/lib/Target/ARM/ARMInstrFormats.td12
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.h22
3 files changed, 26 insertions, 14 deletions
diff --git a/llvm/lib/Target/ARM/ARM.td b/llvm/lib/Target/ARM/ARM.td
index 9001e5033c7..2ed6b9c6c2f 100644
--- a/llvm/lib/Target/ARM/ARM.td
+++ b/llvm/lib/Target/ARM/ARM.td
@@ -131,13 +131,13 @@ def ARMInstrInfo : InstrInfo {
let TSFlagsFields = ["AddrModeBits",
"SizeFlag",
"IndexModeBits",
- "isUnaryDataProc",
- "Form"];
+ "Form",
+ "isUnaryDataProc"];
let TSFlagsShifts = [0,
4,
7,
9,
- 10];
+ 15];
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/ARM/ARMInstrFormats.td b/llvm/lib/Target/ARM/ARMInstrFormats.td
index 301a6c1a5cc..b9868ccf6ae 100644
--- a/llvm/lib/Target/ARM/ARMInstrFormats.td
+++ b/llvm/lib/Target/ARM/ARMInstrFormats.td
@@ -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;
}
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.h b/llvm/lib/Target/ARM/ARMInstrInfo.h
index 8c8f7883a06..ea8947d2f63 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.h
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.h
@@ -66,17 +66,10 @@ namespace ARMII {
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,
@@ -127,6 +120,17 @@ namespace ARMII {
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.
M_BitShift = 5,
OpenPOWER on IntegriCloud