Skip to content

Commit

Permalink
Xtensa: add XtensaReg XtensaInsn
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Jun 6, 2024
1 parent 9779022 commit d2d3a05
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 154 deletions.
6 changes: 3 additions & 3 deletions arch/Xtensa/XtensaGenAsmWriter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ static MnemonicBitsInfo getMnemonic(MCInst *MI, SStream *O) {

/// printInstruction - This method is automatically generated by tablegen
/// from the instruction set description.
void printInstruction(MCInst *MI, uint64_t Address, SStream *O) {
static void printInstruction(MCInst *MI, uint64_t Address, SStream *O) {
SStream_concat0(O, "");
MnemonicBitsInfo MnemonicInfo = getMnemonic(MI, O);

Expand Down Expand Up @@ -1043,8 +1043,8 @@ static const char *getRegisterName(unsigned RegNo) {
/* 54 */ "sar\0"
};
static const uint8_t RegAsmOffset[] = {
54, 11, 4, 18, 25, 32, 39, 42, 45, 48, 51, 0, 7, 14,
21, 28, 35,
54, 11, 4, 18, 25, 32, 39, 42, 45, 48, 51, 0, 7, 14,
21, 28, 35,
};

assert (*(AsmStrs+RegAsmOffset[RegNo-1]) &&
Expand Down
13 changes: 0 additions & 13 deletions arch/Xtensa/XtensaGenCSAliasEnum.inc

This file was deleted.

13 changes: 0 additions & 13 deletions arch/Xtensa/XtensaGenCSAliasMnemMap.inc

This file was deleted.

93 changes: 0 additions & 93 deletions arch/Xtensa/XtensaGenCSInsnEnum.inc

This file was deleted.

32 changes: 0 additions & 32 deletions arch/Xtensa/XtensaGenCSRegEnum.inc

This file was deleted.

131 changes: 131 additions & 0 deletions include/capstone/xtensa.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#ifndef CAPSTONE_XTENSA_H
#define CAPSTONE_XTENSA_H

#ifdef __cplusplus
extern "C" {
#endif

/// Xtensa registers
typedef enum xtensa_reg {
// generated content <XtensaGenCSRegEnum.inc> begin
// clang-format off

Xtensa_REG_INVALID = 0,
Xtensa_REG_SAR = 1,
Xtensa_REG_SP = 2,
Xtensa_REG_A0 = 3,
Xtensa_REG_A2 = 4,
Xtensa_REG_A3 = 5,
Xtensa_REG_A4 = 6,
Xtensa_REG_A5 = 7,
Xtensa_REG_A6 = 8,
Xtensa_REG_A7 = 9,
Xtensa_REG_A8 = 10,
Xtensa_REG_A9 = 11,
Xtensa_REG_A10 = 12,
Xtensa_REG_A11 = 13,
Xtensa_REG_A12 = 14,
Xtensa_REG_A13 = 15,
Xtensa_REG_A14 = 16,
Xtensa_REG_A15 = 17,
Xtensa_REG_ENDING, // 18

// clang-format on
// generated content <XtensaGenCSRegEnum.inc> end
} XtensaReg;

/// Xtensa registers
typedef enum xtensa_insn {
// generated content <XtensaGenCSInsnEnum.inc> begin
// clang-format off

Xtensa_INS_INVALID,
Xtensa_INS_ABS,
Xtensa_INS_ADD,
Xtensa_INS_ADDI,
Xtensa_INS_ADDMI,
Xtensa_INS_ADDX2,
Xtensa_INS_ADDX4,
Xtensa_INS_ADDX8,
Xtensa_INS_AND,
Xtensa_INS_BALL,
Xtensa_INS_BANY,
Xtensa_INS_BBC,
Xtensa_INS_BBCI,
Xtensa_INS_BBS,
Xtensa_INS_BBSI,
Xtensa_INS_BEQ,
Xtensa_INS_BEQI,
Xtensa_INS_BEQZ,
Xtensa_INS_BGE,
Xtensa_INS_BGEI,
Xtensa_INS_BGEU,
Xtensa_INS_BGEUI,
Xtensa_INS_BGEZ,
Xtensa_INS_BLT,
Xtensa_INS_BLTI,
Xtensa_INS_BLTU,
Xtensa_INS_BLTUI,
Xtensa_INS_BLTZ,
Xtensa_INS_BNALL,
Xtensa_INS_BNE,
Xtensa_INS_BNEI,
Xtensa_INS_BNEZ,
Xtensa_INS_BNONE,
Xtensa_INS_CALL0,
Xtensa_INS_CALLX0,
Xtensa_INS_DSYNC,
Xtensa_INS_ESYNC,
Xtensa_INS_EXTUI,
Xtensa_INS_EXTW,
Xtensa_INS_ISYNC,
Xtensa_INS_J,
Xtensa_INS_JX,
Xtensa_INS_L16SI,
Xtensa_INS_L16UI,
Xtensa_INS_L32I,
Xtensa_INS_L32R,
Xtensa_INS_L8UI,
Xtensa_INS_MEMW,
Xtensa_INS_MOVEQZ,
Xtensa_INS_MOVGEZ,
Xtensa_INS_MOVI,
Xtensa_INS_MOVLTZ,
Xtensa_INS_MOVNEZ,
Xtensa_INS_NEG,
Xtensa_INS_NOP,
Xtensa_INS_OR,
Xtensa_INS_RET,
Xtensa_INS_RSR,
Xtensa_INS_RSYNC,
Xtensa_INS_S16I,
Xtensa_INS_S32I,
Xtensa_INS_S8I,
Xtensa_INS_SLL,
Xtensa_INS_SLLI,
Xtensa_INS_SRA,
Xtensa_INS_SRAI,
Xtensa_INS_SRC,
Xtensa_INS_SRL,
Xtensa_INS_SRLI,
Xtensa_INS_SSA8L,
Xtensa_INS_SSAI,
Xtensa_INS_SSL,
Xtensa_INS_SSR,
Xtensa_INS_SUB,
Xtensa_INS_SUBX2,
Xtensa_INS_SUBX4,
Xtensa_INS_SUBX8,
Xtensa_INS_WSR,
Xtensa_INS_XOR,
Xtensa_INS_XSR,

// clang-format on
// generated content <XtensaGenCSInsnEnum.inc> end
} XtensaInsn;

#ifdef __cplusplus
}
#endif

#endif

0 comments on commit d2d3a05

Please sign in to comment.