diff options
author | Owen Anderson <resistor@mac.com> | 2010-11-11 21:36:43 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-11-11 21:36:43 +0000 |
commit | 99a8cb4875da9e5b0c32f3aaa20f9f93f586ee2b (patch) | |
tree | 77ac4dd252d9eeff73ae2ffc23f7afbd6810dd49 /llvm/lib | |
parent | 468638826e6f01c44b2126905c2871459e013ec6 (diff) | |
download | bcm5719-llvm-99a8cb4875da9e5b0c32f3aaa20f9f93f586ee2b.tar.gz bcm5719-llvm-99a8cb4875da9e5b0c32f3aaa20f9f93f586ee2b.zip |
Add correct Thumb2 encodings for NEON vst[1,2,3,4] and vld[1,2,3,4].
llvm-svn: 118843
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMCodeEmitter.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrFormats.td | 2 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp | 19 |
3 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp index 3cb0df54ab9..cd4ac6a6c19 100644 --- a/llvm/lib/Target/ARM/ARMCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/ARMCodeEmitter.cpp @@ -163,6 +163,8 @@ namespace { // far along that this one can be eliminated entirely. unsigned NEONThumb2DataIPostEncoder(const MachineInstr &MI, unsigned Val) const { return 0; } + unsigned NEONThumb2LoadStorePostEncoder(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 c6858892c48..56aa4b0e0d8 100644 --- a/llvm/lib/Target/ARM/ARMInstrFormats.td +++ b/llvm/lib/Target/ARM/ARMInstrFormats.td @@ -1827,6 +1827,8 @@ class NLdSt<bit op23, bits<2> op21_20, bits<4> op11_8, bits<4> op7_4, let Inst{11-8} = op11_8; let Inst{7-4} = op7_4; + string PostEncoderMethod = "NEONThumb2LoadStorePostEncoder"; + bits<5> Vd; bits<6> Rn; bits<4> Rm; diff --git a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp index 6e63a0be360..a407acad4d4 100644 --- a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp @@ -174,6 +174,8 @@ public: unsigned NEONThumb2DataIPostEncoder(const MCInst &MI, unsigned EncodedValue) const; + unsigned NEONThumb2LoadStorePostEncoder(const MCInst &MI, + unsigned EncodedValue) const; void EmitByte(unsigned char C, raw_ostream &OS) const { OS << (char)C; @@ -198,7 +200,7 @@ MCCodeEmitter *llvm::createARMMCCodeEmitter(const Target &, TargetMachine &TM, return new ARMMCCodeEmitter(TM, Ctx); } -/// NEONThumb2PostEncoder - Post-process encoded NEON data-processing +/// NEONThumb2DataIPostEncoder - Post-process encoded NEON data-processing /// instructions, and rewrite them to their Thumb2 form if we are currently in /// Thumb2 mode. unsigned ARMMCCodeEmitter::NEONThumb2DataIPostEncoder(const MCInst &MI, @@ -218,6 +220,21 @@ unsigned ARMMCCodeEmitter::NEONThumb2DataIPostEncoder(const MCInst &MI, return EncodedValue; } +/// NEONThumb2LoadStorePostEncoder - Post-process encoded NEON load/store +/// instructions, and rewrite them to their Thumb2 form if we are currently in +/// Thumb2 mode. +unsigned ARMMCCodeEmitter::NEONThumb2LoadStorePostEncoder(const MCInst &MI, + unsigned EncodedValue) const { + const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>(); + if (Subtarget.isThumb2()) { + EncodedValue &= 0xF0FFFFFF; + EncodedValue |= 0x09000000; + } + + return EncodedValue; +} + + /// getMachineOpValue - Return binary encoding of operand. If the machine /// operand requires relocation, record the relocation and return zero. unsigned ARMMCCodeEmitter:: |