mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fill out support for Thumb2 encodings of NEON instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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)
|
||||
|
@@ -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;
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user