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 | 57dac88f775c1191a98cff89abd1f7ad33df5e29 (patch) | |
tree | 7a79ff1858db38676b8100914e6751cf415dd15c /lib | |
parent | 888cbda188523b5316525bf7daa96517f5e5dbdf (diff) | |
download | external_llvm-57dac88f775c1191a98cff89abd1f7ad33df5e29.zip external_llvm-57dac88f775c1191a98cff89abd1f7ad33df5e29.tar.gz external_llvm-57dac88f775c1191a98cff89abd1f7ad33df5e29.tar.bz2 |
Add correct Thumb2 encodings for NEON vst[1,2,3,4] and vld[1,2,3,4].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMCodeEmitter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMInstrFormats.td | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMMCCodeEmitter.cpp | 19 |
3 files changed, 22 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMCodeEmitter.cpp b/lib/Target/ARM/ARMCodeEmitter.cpp index 3cb0df5..cd4ac6a 100644 --- a/lib/Target/ARM/ARMCodeEmitter.cpp +++ b/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/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index c685889..56aa4b0 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/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/lib/Target/ARM/ARMMCCodeEmitter.cpp b/lib/Target/ARM/ARMMCCodeEmitter.cpp index 6e63a0b..a407aca 100644 --- a/lib/Target/ARM/ARMMCCodeEmitter.cpp +++ b/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:: |