From e8206bc27e1633c7e4c99907f43bf67d2f200cd5 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Sun, 29 Jun 2025 11:23:58 -0400 Subject: [powerpc] Full merge of PowerPC disassembler PRs, including: * Remove dependency on capstone for PowerPC disassembly #6292 * Add support for PowerPC VLE instruction set #6740 * Add support for paired-single instructions #6821 * Various post-merge fixes and tweaks to disassembly and lifting * Removal of dependence on capstone for assembler's scoring mechanism (capstone currently disabled, but not removed from codebase yet) --- arch/powerpc/decode/priv.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 arch/powerpc/decode/priv.h (limited to 'arch/powerpc/decode/priv.h') diff --git a/arch/powerpc/decode/priv.h b/arch/powerpc/decode/priv.h new file mode 100644 index 00000000..8cc8b297 --- /dev/null +++ b/arch/powerpc/decode/priv.h @@ -0,0 +1,54 @@ +#include + +#include "decode.h" + +int32_t sign_extend(uint32_t x, unsigned numBits); + +uint32_t GetA(uint32_t word32); +uint32_t GetB(uint32_t word32); +uint32_t GetC(uint32_t word32); +uint32_t GetD(uint32_t word32); +uint32_t GetS(uint32_t word32); + +uint32_t GetBI(uint32_t word32); +uint32_t GetBO(uint32_t word32); + +uint32_t GetVsxA(uint32_t word32); +uint32_t GetVsxB(uint32_t word32); +uint32_t GetVsxC(uint32_t word32); +uint32_t GetVsxD(uint32_t word32); + +uint32_t GetSpecialRegisterCommon(uint32_t word32); + +uint32_t GetME(uint32_t word32); +uint32_t GetMB(uint32_t word32); +uint32_t GetSH(uint32_t word32); +uint32_t GetSH64(uint32_t word32); +uint32_t GetMX64(uint32_t word32); + +void FillOperands32(Instruction* instruction, uint32_t word32, uint64_t address); + +Register Gpr(uint32_t value); +Register Crf(uint32_t value); +void PushUIMMValue(Instruction* instruction, uint64_t uimm); +void PushSIMMValue(Instruction* instruction, int32_t simm); +void PushRegister(Instruction* instruction, OperandClass cls, Register reg); +void PushRA(Instruction* instruction, uint32_t word32); +void PushRB(Instruction* instruction, uint32_t word32); +void PushRD(Instruction* instruction, uint32_t word32); +void PushRS(Instruction* instruction, uint32_t word32); +void PushCRBitA(Instruction* instruction, uint32_t word32); +void PushCRBitB(Instruction* instruction, uint32_t word32); +void PushCRBitD(Instruction* instruction, uint32_t word32); +void PushCRFD(Instruction* instruction, uint32_t word32); +void PushCRFDImplyCR0(Instruction* instruction, uint32_t word32); +void PushCRFS(Instruction* instruction, uint32_t word32); +void PushMem(Instruction* instruction, OperandClass cls, Register reg, int32_t offset); +void PushMemRA(Instruction* instruction, uint32_t word32); +void PushLabel(Instruction* instruction, uint64_t address); + +void CopyOperand(Operand* dst, const Operand* src); + +InstructionId Decode0x04(uint32_t word32, uint32_t decodeFlags); +InstructionId Decode0x1F(uint32_t word32, uint32_t decodeFlags); +InstructionId VleTranslateMnemonic(InstructionId id); -- cgit v1.3.1