summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Instruction/ARM
Commit message (Collapse)AuthorAgeFilesLines
...
* Add header declarations for the remaining instructions we need toCaroline Tice2011-02-171-0/+203
| | | | | | emulate, to cover those that can change the PC. llvm-svn: 125791
* Refactoring. Abstracted the set flags operation into its own helper methodJohnny Chen2011-02-172-64/+71
| | | | | | | WriteFlags() and renamed WriteCoreRegisterWithFlags() to WriteCoreRegOptionalFlags(). Modified the call sites to use the helper methods. llvm-svn: 125788
* A8.6.6 ADD (register)Johnny Chen2011-02-172-8/+34
| | | | | | | Renamed EmulateAddRdnRm() to EmulateAddReg(), and added Encoding T1 to it. Where Encoding T2 can potentially modify the PC, causing a brnach. llvm-svn: 125782
* Add EmulateTB() method to emulate "Table Branch Byte" and "Table Branch ↵Johnny Chen2011-02-172-0/+89
| | | | | | | | Halfword" operations for Thumb2. llvm-svn: 125767
* Add stubs for pseudocode functions "MemA[]" amd "MemU[]", corresponding to ↵Caroline Tice2011-02-172-34/+103
| | | | | | | | | | | | | | aligned and unaligned memory accesses. The new stub functions are MemARead, MemAWrite, MemURead, and MemUWrite. At the moment these stubs just call ReadMemoryUnsigned or WriteMemoryUnsigned, but we can fill them out further later if we decide we need more accurate emulation of the memory system. Replaced all the direct calls to ReadMemoryUnsigned and WriteMemoryUnsigned in EmulateInstructionARM.cpp with calls to the appropriate new stub function. llvm-svn: 125766
* Move Align(val, alignment) utility function to ARMUtils.h.Johnny Chen2011-02-171-5/+0
| | | | llvm-svn: 125753
* Add comment for the helper method WriteCoreRegisterWithFlags().Johnny Chen2011-02-171-0/+3
| | | | llvm-svn: 125703
* Refactoring. Wrap the following pseudocode from the ARM Architecture ↵Johnny Chen2011-02-172-117/+90
| | | | | | | | | | | | | | | | | | | | | Reference Manul: // if d == 15 then // Can only occur for encoding A1 // ALUWritePC(result); // setflags is always FALSE here // else // R[d] = result; // if setflags then // APSR.N = result<31>; // APSR.Z = IsZeroBit(result); // APSR.C = carry; // // APSR.V unchanged into a helper method WriteCoreRegisterWithFlags, and modified the existing methods to take advantage of it. Plus add two emulation methods (declaration only for now) for ORR (immediate) and ORR (register). llvm-svn: 125701
* Add emulation methods for ROR (immediate), ROR (register), and RRX.Johnny Chen2011-02-162-5/+126
| | | | | | | | | | Turns out that they can be funneled through the helper methods EmulateShiftImm()/ EmulateShiftReg() as well. Modify EmulateShiftImm() to handle SRType_ROR and SRType_RRX. And fix a typo in the impl of utility Shift_C() in ARMUtils.h. llvm-svn: 125689
* Add code to emulate STRB (Thumb) instruction.Caroline Tice2011-02-162-1/+147
| | | | llvm-svn: 125686
* Add encoding entries for LSL (immediate and register) and LSR (immediate and ↵Johnny Chen2011-02-161-1/+21
| | | | | | | | register) to ARM and Thumb opcode tables. llvm-svn: 125683
* Add tagging for EmulateLDRRtRnImm().Johnny Chen2011-02-161-0/+1
| | | | llvm-svn: 125671
* Minor comment change.Johnny Chen2011-02-161-2/+2
| | | | llvm-svn: 125634
* Add emulation methods for LSL (immediate), LSL (register), LSR (immediate), ↵Johnny Chen2011-02-162-21/+160
| | | | | | | | | | | and LSR (register). Create two helper methods EmulateShiftImm() and EmulateShiftReg() and have ASR, LSL, and LSR delegate to the helper methods which take an extra ARM_ShifterType parameter. The opcodes tables have not been updated yet to reflect these new entries. llvm-svn: 125633
* Add documentation tags for LDM/STM instruction families.Caroline Tice2011-02-162-2/+211
| | | | | | Add code to emulate STR (register) Arm instruction. llvm-svn: 125623
* Section heading for EmulateB().Johnny Chen2011-02-161-1/+1
| | | | llvm-svn: 125620
* Add section headings corresponding to some of the ARM/Thumb emulation ↵Johnny Chen2011-02-161-5/+28
| | | | | | methods for better documentation. llvm-svn: 125618
* A8.6.14 ASR (register)Johnny Chen2011-02-152-3/+109
| | | | | | Add EmulateASRReg() Encodings T1, T2, and A1 to the opcodes tables. llvm-svn: 125614
* Add eContextRegisterLoad instruction emulation context.Caroline Tice2011-02-152-2/+170
| | | | | | Add code to emulate STR (Immediate, Thumb) instruction. llvm-svn: 125610
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-152-31/+16
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* Remove the "Register &reg" parameter from the BXWritePC(), LoadWritePC(), ↵Johnny Chen2011-02-152-35/+25
| | | | | | | | | and ALUWritePC() methods of EmulateInstructionARM class. The context data structure should provide sufficient information already. llvm-svn: 125596
* Fix wrong mask and encoding for T2 of ASR (immediate).Johnny Chen2011-02-151-1/+1
| | | | llvm-svn: 125593
* A8.6.14 ASR (immediate)Johnny Chen2011-02-152-0/+112
| | | | | | Add EmulateASRImm() Encodings T1, T2, and A1 to the opcodes tables. llvm-svn: 125592
* Add code to emulate STMIB Arm instruction.Caroline Tice2011-02-152-11/+145
| | | | llvm-svn: 125580
* Add code to emulate STMDB Arm instruction.Caroline Tice2011-02-152-2/+176
| | | | | | Add some bit-mask fixes to code for getting register bits for various LDM and STM instructions. llvm-svn: 125578
* Remove the unnecessary assignment of m_inst_cpsr inside EvaluateInstruction(),Johnny Chen2011-02-151-4/+0
| | | | | | because it's already been done within ReadInstruction(). llvm-svn: 125569
* Add code to emulate the STMDA Arm instruction.Caroline Tice2011-02-152-1/+134
| | | | llvm-svn: 125542
* Add missing logic (if BadReg(d) then UNPREDICTABLE;) for Encoding T2 of ↵Johnny Chen2011-02-141-0/+2
| | | | | | EmulateMovRdImm(). llvm-svn: 125533
* Fix build warning (unused variable).Johnny Chen2011-02-141-4/+0
| | | | llvm-svn: 125531
* - Rearrange instruction emulation contexts to use a union for theCaroline Tice2011-02-142-203/+238
| | | | | | | | | | | | | | | various types and numbers of arguments rather than trying to keep a constant number of arguments for all the types. - Also create a Register type within the instructions, to hold register type and number. - Modify EmulateInstructionArm.cpp to use the new register and context types in all the instruction emulation functions. - Add code to emulate the STM Arm instruction. llvm-svn: 125528
* Add entries for EmulateMovRdImm() -- "MOV (immediate)" -- Encodings T1 & T2 ↵Johnny Chen2011-02-142-5/+101
| | | | | | | | | | into g_thumb_opcodes table. Modify EmulateInstructionARM::EvaluateInstruction() so that if the cpsr has changed during evaluate instruction, we flush out the change into m_inst_cpsr in preparation for the next instruction. llvm-svn: 125524
* Add impl for EmulateMvnRdImm() -- "MVN (immediate)". Plus zero out the arg0 ↵Johnny Chen2011-02-141-6/+64
| | | | | | | | | field of the context of eContextImmediate type, since the immediate value is known from the argument value to WriteRegisterUnsigned() callback already. llvm-svn: 125518
* Add entries for Encodings T1 and A1 of "MVN (immediate)" to g_arm_opcodes ↵Johnny Chen2011-02-122-0/+39
| | | | | | | | and g_thumb_opcodes tables. The corresponding EmulateMvnRdImm() method impl is empty for now. llvm-svn: 125425
* Add helper methods InITBlock() and LastInITBlock() to EmulateInstructionARM ↵Johnny Chen2011-02-122-15/+32
| | | | | | | | | class instead of calling out to m_it_session.InITBlock()/LastInITBlock(), which simplifies the coding a bit. llvm-svn: 125421
* Add EmulateBXRm() ("Branch and Exchange") to both g_arm_opcodes and ↵Johnny Chen2011-02-122-3/+62
| | | | | | g_thumb_opcodes table. llvm-svn: 125418
* - Add three more instruction contexts to EmulateInstruction:Caroline Tice2011-02-112-11/+215
| | | | | | | | | | | | | | eContextAdjustBaseRegister, eContextRegisterStore and eContextWriteMemoryRandomBits. - Implement a version of WriteBits32UnknownToMemory for writing to memory. - Modify EmulateLDM, EmulateLDMDA, EmulateLDMDB and EmulateLDMIB to use the eContextAdjustBaseRegister context when appropriate. - Add code to emulate the STM/STMIA/STMEA Arm instruction. llvm-svn: 125414
* Add EmulateCmpRnRm() for Encodings T1 & T2 to the g_thumb_opcodes table to ↵Johnny Chen2011-02-112-0/+72
| | | | | | | | emulate CMP (register) operations. llvm-svn: 125413
* Rearraned some emulate instruction entries under the appropriate category.Johnny Chen2011-02-111-9/+9
| | | | llvm-svn: 125405
* Handle the case of interworking branch for EmulateLDMDA.Johnny Chen2011-02-111-1/+2
| | | | llvm-svn: 125392
* Add Thumb2 LDR (literal) instruction into the g_thumb_opcodes table.Johnny Chen2011-02-112-11/+52
| | | | | | | Change the method name from *LDRRdPCRelative to *LDRRtPCRelative to be compliant with the ARM Arch Manual which uses Rt for the destination register. llvm-svn: 125390
* Fix build.Johnny Chen2011-02-111-0/+1
| | | | llvm-svn: 125379
* Add new instruction context, eContextWriteRegisterRandomBits.Caroline Tice2011-02-112-7/+167
| | | | | | | | | | | Add new utility function, WriteBits32Unknown Modify the LDM* instruction emulation functions to call WriteBits32Unknown. Add missing overview comments to the LDM* instruction emulation functions. Add code to emulate LDMDA Arm instruction. llvm-svn: 125377
* Add an entry for CMP (immediate) (Encoding T1) to the g_thumb_opcodes table.Johnny Chen2011-02-112-4/+58
| | | | llvm-svn: 125333
* Add a helper method AddWithCarry() to the EmulateInstructionARM class.Johnny Chen2011-02-112-0/+31
| | | | llvm-svn: 125329
* Namings are important. Renamed Bits32(const uint32_t val, uint32_t bit) to ↵Johnny Chen2011-02-101-25/+25
| | | | | | | | Bit32(val, bit) and SetBits32(uint32_t &bits, uint32_t bit, uint32_t val) to SetBit32(bits, bit, val). llvm-svn: 125312
* Some refactorings to use the convenience function: Bits32(const uint32_t ↵Johnny Chen2011-02-101-23/+23
| | | | | | value, const uint32_t bit). llvm-svn: 125303
* Add some comment markers.Johnny Chen2011-02-101-0/+12
| | | | llvm-svn: 125302
* Add a generic EmulateMovRdRm() method and modify/add entries to the ↵Johnny Chen2011-02-102-4/+46
| | | | | | | | g_thumb_opcodes table. Also add some more defines and convenience functions. llvm-svn: 125300
* Rearrange the order of g_thumb_opcodes entries.Johnny Chen2011-02-101-3/+4
| | | | llvm-svn: 125295
* Add EmulateLDRRtRnImm() for EncodingT1 of LDR (immediate, Thumb) to the ↵Johnny Chen2011-02-102-1/+120
| | | | | | | | g_thumb_opcodes table, and a helper method UnalignedSupport(). llvm-svn: 125258
OpenPOWER on IntegriCloud