diff options
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index b1a1230..a6eab33 100644 --- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp +++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp @@ -241,15 +241,15 @@ static DecodeStatus DecodeBranchImmInstruction(MCInst &Inst,unsigned Insn, uint64_t Address, const void *Decoder); static DecodeStatus DecodeAddrMode6Operand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Val, +static DecodeStatus DecodeVLDST1Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeVST1Instruction(MCInst &Inst, unsigned Val, +static DecodeStatus DecodeVLDST2Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeVST2Instruction(MCInst &Inst, unsigned Val, +static DecodeStatus DecodeVLDST3Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeVST3Instruction(MCInst &Inst, unsigned Val, +static DecodeStatus DecodeVLDST4Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeVST4Instruction(MCInst &Inst, unsigned Val, +static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); static DecodeStatus DecodeVSTInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder); @@ -2430,47 +2430,55 @@ static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Insn, return S; } -static DecodeStatus DecodeVST1Instruction(MCInst& Inst, unsigned Insn, - uint64_t Addr, const void* Decoder) { +static DecodeStatus DecodeVLDST1Instruction(MCInst &Inst, unsigned Insn, + uint64_t Address, 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); + if (type == 6 && (align & 2)) return MCDisassembler::Fail; + if (type == 7 && (align & 2)) return MCDisassembler::Fail; + if (type == 10 && align == 3) return MCDisassembler::Fail; + + unsigned load = fieldFromInstruction(Insn, 21, 1); + return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder) + : DecodeVSTInstruction(Inst, Insn, Address, Decoder); } -static DecodeStatus DecodeVST2Instruction(MCInst& Inst, unsigned Insn, - uint64_t Addr, const void* Decoder) { +static DecodeStatus DecodeVLDST2Instruction(MCInst &Inst, unsigned Insn, + uint64_t Address, const void *Decoder) { unsigned size = fieldFromInstruction(Insn, 6, 2); - if(size == 3) return MCDisassembler::Fail; + 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); + if (type == 8 && align == 3) return MCDisassembler::Fail; + if (type == 9 && align == 3) return MCDisassembler::Fail; + + unsigned load = fieldFromInstruction(Insn, 21, 1); + return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder) + : DecodeVSTInstruction(Inst, Insn, Address, Decoder); } -static DecodeStatus DecodeVST3Instruction(MCInst& Inst, unsigned Insn, - uint64_t Addr, const void* Decoder) { +static DecodeStatus DecodeVLDST3Instruction(MCInst &Inst, unsigned Insn, + uint64_t Address, const void *Decoder) { unsigned size = fieldFromInstruction(Insn, 6, 2); - if(size == 3) return MCDisassembler::Fail; + if (size == 3) return MCDisassembler::Fail; unsigned align = fieldFromInstruction(Insn, 4, 2); - if(align & 2) return MCDisassembler::Fail; + if (align & 2) return MCDisassembler::Fail; - return DecodeVSTInstruction(Inst, Insn, Addr, Decoder); + unsigned load = fieldFromInstruction(Insn, 21, 1); + return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder) + : DecodeVSTInstruction(Inst, Insn, Address, Decoder); } -static DecodeStatus DecodeVST4Instruction(MCInst& Inst, unsigned Insn, - uint64_t Addr, const void* Decoder) { +static DecodeStatus DecodeVLDST4Instruction(MCInst &Inst, unsigned Insn, + uint64_t Address, const void *Decoder) { unsigned size = fieldFromInstruction(Insn, 6, 2); - if(size == 3) return MCDisassembler::Fail; + if (size == 3) return MCDisassembler::Fail; - return DecodeVSTInstruction(Inst, Insn, Addr, Decoder); + unsigned load = fieldFromInstruction(Insn, 21, 1); + return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder) + : DecodeVSTInstruction(Inst, Insn, Address, Decoder); } static DecodeStatus DecodeVSTInstruction(MCInst &Inst, unsigned Insn, |