mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-30 08:50:42 +00:00
95966a1393
* Initial auto-sync LoongArch support - Accompanied llvm changes: https://github.com/capstone-engine/llvm-capstone/pull/45 - MC Tests are generated from llvm - Instruction groups are implemented - Register accesses are implemented - Memory operands are handled for memory instructions - Code are formatted using clang-format of LLVM 17 - Import tests from LLVM MC - Collect operand type and access - Collect registers read/modified --------- Co-authored-by: CoA <1109673069@qq.com> * Ensure same indent for all patched lines. * Emit upper case OP_GROUP enum * Spell all enum values in capital letters. * Capticalize enums in loongarch_detail.c * Add test which contains now a tab. * Run clang-format on test_loongarch.c --------- Co-authored-by: CoA <1109673069@qq.com> Co-authored-by: Rot127 <unisono@quyllur.org>
55 lines
2.0 KiB
C
55 lines
2.0 KiB
C
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
|
|
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2022, */
|
|
/* Rot127 <unisono@quyllur.org> 2022-2023 */
|
|
/* Automatically translated source file from LLVM. */
|
|
|
|
/* LLVM-commit: <commit> */
|
|
/* LLVM-tag: <tag> */
|
|
|
|
/* Only small edits allowed. */
|
|
/* For multiple similar edits, please create a Patch for the translator. */
|
|
|
|
/* Capstone's C++ file translator: */
|
|
/* https://github.com/capstone-engine/capstone/tree/next/suite/auto-sync */
|
|
|
|
//===-- LoongArchInstPrinter.h - Convert LoongArch MCInst to asm syntax ---===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This class prints a LoongArch MCInst to a .s file.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H
|
|
#define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <capstone/platform.h>
|
|
|
|
#include "../../MCInstPrinter.h"
|
|
#include "../../cs_priv.h"
|
|
#define CONCAT(a, b) CONCAT_(a, b)
|
|
#define CONCAT_(a, b) a##_##b
|
|
|
|
static void printInst(MCInst *MI, uint64_t Address, const char *Annot,
|
|
SStream *O);
|
|
static void printRegName(SStream *O, MCRegister Reg);
|
|
static void printAtomicMemOp(MCInst *MI, unsigned OpNo, SStream *O);
|
|
// Autogenerated by tblgen.
|
|
static void printInstruction(MCInst *MI, uint64_t Address, SStream *O);
|
|
static bool printAliasInstr(MCInst *MI, uint64_t Address, SStream *O);
|
|
static void printCustomAliasOperand(MCInst *MI, uint64_t Address,
|
|
unsigned OpIdx, unsigned PrintMethodIdx,
|
|
SStream *O);
|
|
static void printOperand(MCInst *MI, unsigned OpNo, SStream *O);
|
|
;
|
|
// end namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_LOONGARCHINSTPRINTER_H
|