llvm/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp

//===-- EmulateInstructionMIPS64.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "EmulateInstructionMIPS64.h"

#include <cstdlib>
#include <optional>

#include "lldb/Core/Address.h"
#include "lldb/Core/Opcode.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Stream.h"
#include "llvm-c/Disassembler.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"

#include "llvm/ADT/STLExtras.h"

#include "Plugins/Process/Utility/InstructionUtils.h"
#include "Plugins/Process/Utility/RegisterContext_mips.h"

usingnamespacelldb;
usingnamespacelldb_private;

LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionMIPS64, InstructionMIPS64)

#define UInt(x)
#define integer

//
// EmulateInstructionMIPS64 implementation
//

#ifdef __mips__
extern "C" {
void LLVMInitializeMipsTargetInfo();
void LLVMInitializeMipsTarget();
void LLVMInitializeMipsAsmPrinter();
void LLVMInitializeMipsTargetMC();
void LLVMInitializeMipsDisassembler();
}
#endif

EmulateInstructionMIPS64::EmulateInstructionMIPS64(
    const lldb_private::ArchSpec &arch)
    :{}

void EmulateInstructionMIPS64::Initialize() {}

void EmulateInstructionMIPS64::Terminate() {}

llvm::StringRef EmulateInstructionMIPS64::GetPluginDescriptionStatic() {}

EmulateInstruction *
EmulateInstructionMIPS64::CreateInstance(const ArchSpec &arch,
                                         InstructionType inst_type) {}

bool EmulateInstructionMIPS64::SetTargetTriple(const ArchSpec &arch) {}

const char *EmulateInstructionMIPS64::GetRegisterName(unsigned reg_num,
                                                      bool alternate_name) {}

std::optional<RegisterInfo>
EmulateInstructionMIPS64::GetRegisterInfo(RegisterKind reg_kind,
                                          uint32_t reg_num) {}

EmulateInstructionMIPS64::MipsOpcode *
EmulateInstructionMIPS64::GetOpcodeForInstruction(llvm::StringRef op_name) {}

bool EmulateInstructionMIPS64::ReadInstruction() {}

bool EmulateInstructionMIPS64::EvaluateInstruction(uint32_t evaluate_options) {}

bool EmulateInstructionMIPS64::CreateFunctionEntryUnwind(
    UnwindPlan &unwind_plan) {}

bool EmulateInstructionMIPS64::nonvolatile_reg_p(uint64_t regnum) {}

bool EmulateInstructionMIPS64::Emulate_DADDiu(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_SD(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_LD(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_LUI(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_DSUBU_DADDU(llvm::MCInst &insn) {}

/*
    Emulate below MIPS branch instructions.
    BEQ, BNE : Branch on condition
    BEQL, BNEL : Branch likely
*/
bool EmulateInstructionMIPS64::Emulate_BXX_3ops(llvm::MCInst &insn) {}

/*
    Emulate below MIPS Non-Compact conditional branch and link instructions.
    BLTZAL, BGEZAL      :
    BLTZALL, BGEZALL    : Branch likely
*/
bool EmulateInstructionMIPS64::Emulate_Bcond_Link(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BAL(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BALC(llvm::MCInst &insn) {}

/*
    Emulate below MIPS conditional branch and link instructions.
    BLEZALC, BGEZALC, BLTZALC, BGTZALC, BEQZALC, BNEZALC : Compact branches
*/
bool EmulateInstructionMIPS64::Emulate_Bcond_Link_C(llvm::MCInst &insn) {}

/*
    Emulate below MIPS branch instructions.
    BLTZL, BGEZL, BGTZL, BLEZL : Branch likely
    BLTZ, BGEZ, BGTZ, BLEZ     : Non-compact branches
*/
bool EmulateInstructionMIPS64::Emulate_BXX_2ops(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BC(llvm::MCInst &insn) {}

static int IsAdd64bitOverflow(int64_t a, int64_t b) {}

/*
    Emulate below MIPS branch instructions.
    BEQC, BNEC, BLTC, BGEC, BLTUC, BGEUC, BOVC, BNVC: Compact branch
   instructions with no delay slot
*/
bool EmulateInstructionMIPS64::Emulate_BXX_3ops_C(llvm::MCInst &insn) {}

/*
    Emulate below MIPS branch instructions.
    BLTZC, BLEZC, BGEZC, BGTZC, BEQZC, BNEZC : Compact Branches
*/
bool EmulateInstructionMIPS64::Emulate_BXX_2ops_C(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_J(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_JAL(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_JALR(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_JIALC(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_JIC(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_JR(llvm::MCInst &insn) {}

/*
    Emulate Branch on FP True/False
    BC1F, BC1FL :   Branch on FP False (L stands for branch likely)
    BC1T, BC1TL :   Branch on FP True  (L stands for branch likely)
*/
bool EmulateInstructionMIPS64::Emulate_FP_branch(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BC1EQZ(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BC1NEZ(llvm::MCInst &insn) {}

/*
    Emulate MIPS-3D Branch instructions
    BC1ANY2F, BC1ANY2T  : Branch on Any of Two Floating Point Condition Codes
   False/True
    BC1ANY4F, BC1ANY4T  : Branch on Any of Four Floating Point Condition Codes
   False/True
*/
bool EmulateInstructionMIPS64::Emulate_3D_branch(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BNZB(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BNZH(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BNZW(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BNZD(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BZB(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BZH(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BZW(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BZD(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_MSA_Branch_DF(llvm::MCInst &insn,
                                                     int element_byte_size,
                                                     bool bnz) {}

bool EmulateInstructionMIPS64::Emulate_BNZV(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_BZV(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_MSA_Branch_V(llvm::MCInst &insn,
                                                    bool bnz) {}

bool EmulateInstructionMIPS64::Emulate_LDST_Imm(llvm::MCInst &insn) {}

bool EmulateInstructionMIPS64::Emulate_LDST_Reg(llvm::MCInst &insn) {}