summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-11-11 23:12:55 +0000
committerOwen Anderson <resistor@mac.com>2010-11-11 23:12:55 +0000
commitce2250fba419a42b18a3037fc36aa6bf6091220f (patch)
treea9f15c4e4469fefc2fc129bb3783badcda4bd043 /llvm/lib
parent7716cd62b30e3870b479dd539766502eb71de118 (diff)
downloadbcm5719-llvm-ce2250fba419a42b18a3037fc36aa6bf6091220f.tar.gz
bcm5719-llvm-ce2250fba419a42b18a3037fc36aa6bf6091220f.zip
Fill out support for Thumb2 encodings of NEON instructions.
llvm-svn: 118854
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMCodeEmitter.cpp2
-rw-r--r--llvm/lib/Target/ARM/ARMInstrFormats.td2
-rw-r--r--llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp17
3 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
index cd4ac6a6c19..b068c64f63e 100644
--- a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
+++ b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
@@ -165,6 +165,8 @@ namespace {
const { return 0; }
unsigned NEONThumb2LoadStorePostEncoder(const MachineInstr &MI,unsigned Val)
const { return 0; }
+ unsigned NEONThumb2DupPostEncoder(const MachineInstr &MI,unsigned Val)
+ const { return 0; }
unsigned getBranchTargetOpValue(const MachineInstr &MI, unsigned Op)
const { return 0; }
unsigned getCCOutOpValue(const MachineInstr &MI, unsigned Op)
diff --git a/llvm/lib/Target/ARM/ARMInstrFormats.td b/llvm/lib/Target/ARM/ARMInstrFormats.td
index 56aa4b0e0d8..251e5c27a0b 100644
--- a/llvm/lib/Target/ARM/ARMInstrFormats.td
+++ b/llvm/lib/Target/ARM/ARMInstrFormats.td
@@ -2046,6 +2046,8 @@ class NVLaneOp<bits<8> opcod1, bits<4> opcod2, bits<2> opcod3,
let Pattern = pattern;
list<Predicate> Predicates = [HasNEON];
+ string PostEncoderMethod = "NEONThumb2DupPostEncoder";
+
bits<5> V;
bits<4> R;
bits<4> p;
diff --git a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
index a407acad4d4..ebd0d9b5599 100644
--- a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
+++ b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
@@ -176,6 +176,8 @@ public:
unsigned EncodedValue) const;
unsigned NEONThumb2LoadStorePostEncoder(const MCInst &MI,
unsigned EncodedValue) const;
+ unsigned NEONThumb2DupPostEncoder(const MCInst &MI,
+ unsigned EncodedValue) const;
void EmitByte(unsigned char C, raw_ostream &OS) const {
OS << (char)C;
@@ -234,6 +236,21 @@ unsigned ARMMCCodeEmitter::NEONThumb2LoadStorePostEncoder(const MCInst &MI,
return EncodedValue;
}
+/// NEONThumb2DupPostEncoder - Post-process encoded NEON vdup
+/// instructions, and rewrite them to their Thumb2 form if we are currently in
+/// Thumb2 mode.
+unsigned ARMMCCodeEmitter::NEONThumb2DupPostEncoder(const MCInst &MI,
+ unsigned EncodedValue) const {
+ const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>();
+ if (Subtarget.isThumb2()) {
+ EncodedValue &= 0x00FFFFFF;
+ EncodedValue |= 0xEE000000;
+ }
+
+ return EncodedValue;
+}
+
+
/// getMachineOpValue - Return binary encoding of operand. If the machine
/// operand requires relocation, record the relocation and return zero.
OpenPOWER on IntegriCloud