aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
diff options
context:
space:
mode:
authorMihai Popa <mihail.popa@gmail.com>2013-05-20 14:57:05 +0000
committerMihai Popa <mihail.popa@gmail.com>2013-05-20 14:57:05 +0000
commit30a7a7c1fdbd2607345dd1554e3436749fd75c6e (patch)
tree380293c76297b65a5c975df2e29f173e4a967178 /lib/Target/ARM/Disassembler/ARMDisassembler.cpp
parentbac932e9c3c4305a3c73598f3d0dc55de53d4c68 (diff)
downloadexternal_llvm-30a7a7c1fdbd2607345dd1554e3436749fd75c6e.zip
external_llvm-30a7a7c1fdbd2607345dd1554e3436749fd75c6e.tar.gz
external_llvm-30a7a7c1fdbd2607345dd1554e3436749fd75c6e.tar.bz2
VSTn instructions have a number of encoding constraints which are not implemented. I have added these using wrapper methods around the original custom decoder (incidentally - this is a huge poorly written method that should be cleaned up. I have left it as is since the changes would be much to hard to review).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassembler.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index aa59c98..fb82945 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -241,6 +241,14 @@ static DecodeStatus DecodeAddrMode6Operand(MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeVST1Instruction(MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeVST2Instruction(MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeVST3Instruction(MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeVST4Instruction(MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
static DecodeStatus DecodeVSTInstruction(MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
static DecodeStatus DecodeVLD1DupInstruction(MCInst &Inst, unsigned Val,
@@ -2450,6 +2458,49 @@ static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Insn,
return S;
}
+static DecodeStatus DecodeVST1Instruction(MCInst& Inst, unsigned Insn,
+ uint64_t Addr, const void* Decoder) {
+ unsigned type = fieldFromInstruction(Insn, 8, 4);
+ unsigned align = fieldFromInstruction(Insn, 4, 2);
+ if(type == 7 && (align & 2)) return MCDisassembler::Fail;
+ if(type == 10 && align == 3) return MCDisassembler::Fail;
+ if(type == 6 && (align & 2)) return MCDisassembler::Fail;
+
+ return DecodeVSTInstruction(Inst, Insn, Addr, Decoder);
+}
+
+static DecodeStatus DecodeVST2Instruction(MCInst& Inst, unsigned Insn,
+ uint64_t Addr, const void* Decoder) {
+ unsigned size = fieldFromInstruction(Insn, 6, 2);
+ if(size == 3) return MCDisassembler::Fail;
+
+ unsigned type = fieldFromInstruction(Insn, 8, 4);
+ unsigned align = fieldFromInstruction(Insn, 4, 2);
+ if(type == 8 && align == 3) return MCDisassembler::Fail;
+ if(type == 9 && align == 3) return MCDisassembler::Fail;
+
+ return DecodeVSTInstruction(Inst, Insn, Addr, Decoder);
+}
+
+static DecodeStatus DecodeVST3Instruction(MCInst& Inst, unsigned Insn,
+ uint64_t Addr, const void* Decoder) {
+ unsigned size = fieldFromInstruction(Insn, 6, 2);
+ if(size == 3) return MCDisassembler::Fail;
+
+ unsigned align = fieldFromInstruction(Insn, 4, 2);
+ if(align & 2) return MCDisassembler::Fail;
+
+ return DecodeVSTInstruction(Inst, Insn, Addr, Decoder);
+}
+
+static DecodeStatus DecodeVST4Instruction(MCInst& Inst, unsigned Insn,
+ uint64_t Addr, const void* Decoder) {
+ unsigned size = fieldFromInstruction(Insn, 6, 2);
+ if(size == 3) return MCDisassembler::Fail;
+
+ return DecodeVSTInstruction(Inst, Insn, Addr, Decoder);
+}
+
static DecodeStatus DecodeVSTInstruction(MCInst &Inst, unsigned Insn,
uint64_t Address, const void *Decoder) {
DecodeStatus S = MCDisassembler::Success;