Skip to content

Commit

Permalink
xtensa: fix details
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Nov 3, 2024
1 parent 67244a8 commit 3adb13e
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 72 deletions.
1 change: 1 addition & 0 deletions arch/Xtensa/XtensaInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static void printRegName(SStream *O, MCRegister Reg)

static void printOperand(MCInst *MI, const int op_num, SStream *O)
{
Xtensa_add_cs_detail_0(MI, Xtensa_OP_GROUP_Operand, op_num);
MCOperand *MC = MCInst_getOperand(MI, (op_num));
if (MCOperand_isReg(MC))
SStream_concat0(O, getRegisterName(MCOperand_getReg(MC)));
Expand Down
5 changes: 5 additions & 0 deletions suite/cstest/include/test_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "test_detail_wasm.h"
#include "test_detail_x86.h"
#include "test_detail_m68k.h"
#include "test_detail_xtensa.h"
#include "test_compare.h"
#include <capstone/capstone.h>
#include <cyaml/cyaml.h>
Expand Down Expand Up @@ -59,6 +60,7 @@ typedef struct {
TestDetailWASM *wasm;
TestDetailX86 *x86;
TestDetailM68K *m68k;
TestDetailXtensa *xtensa;

char **regs_read;
uint8_t regs_read_count;
Expand Down Expand Up @@ -145,6 +147,9 @@ static const cyaml_schema_field_t test_detail_mapping_schema[] = {
CYAML_FIELD_MAPPING_PTR(
"m68k", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL, TestDetail,
m68k, test_detail_m68k_mapping_schema),
CYAML_FIELD_MAPPING_PTR(
"xtensa", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL, TestDetail,
xtensa, test_detail_xtensa_mapping_schema),
CYAML_FIELD_SEQUENCE("regs_read",
CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetail, regs_read, &single_string_schema, 0, 255),
Expand Down
68 changes: 68 additions & 0 deletions suite/cstest/include/test_detail_xtensa.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright © 2024 Rot127 <[email protected]>
// SPDX-License-Identifier: BSD-3

#ifndef TEST_DETAIL_XTENSA_H
#define TEST_DETAIL_XTENSA_H

#include "test_compare.h"
#include <cyaml/cyaml.h>
#include <capstone/capstone.h>

typedef struct {
char *type;
char *access;

char *reg;
int32_t imm;
char *mem_base;
uint8_t mem_disp;
} TestDetailXtensaOp;

static const cyaml_schema_field_t test_detail_xtensa_op_mapping_schema[] = {
CYAML_FIELD_STRING_PTR("type", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetailXtensaOp, type, 0, CYAML_UNLIMITED),
CYAML_FIELD_STRING_PTR("access",
CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetailXtensaOp, access, 0, CYAML_UNLIMITED),
CYAML_FIELD_STRING_PTR("reg", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetailXtensaOp, reg, 0, CYAML_UNLIMITED),
CYAML_FIELD_INT("imm", CYAML_FLAG_OPTIONAL, TestDetailXtensaOp, imm),
CYAML_FIELD_STRING_PTR(
"mem_base", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetailXtensaOp, mem_base, 0, CYAML_UNLIMITED),
CYAML_FIELD_INT("mem_disp", CYAML_FLAG_OPTIONAL, TestDetailXtensaOp,
mem_disp),
CYAML_FIELD_END
};

static const cyaml_schema_value_t test_detail_xtensa_op_schema = {
CYAML_VALUE_MAPPING(CYAML_FLAG_POINTER, TestDetailXtensaOp,
test_detail_xtensa_op_mapping_schema),
};

typedef struct {
TestDetailXtensaOp **operands;
uint32_t operands_count;
} TestDetailXtensa;

static const cyaml_schema_field_t test_detail_xtensa_mapping_schema[] = {
CYAML_FIELD_SEQUENCE(
"operands", CYAML_FLAG_POINTER | CYAML_FLAG_OPTIONAL,
TestDetailXtensa, operands, &test_detail_xtensa_op_schema, 0,
CYAML_UNLIMITED), // 0-MAX options
CYAML_FIELD_END
};

TestDetailXtensa *test_detail_xtensa_new();
TestDetailXtensa *test_detail_xtensa_clone(const TestDetailXtensa *detail);
void test_detail_xtensa_free(TestDetailXtensa *detail);

TestDetailXtensaOp *test_detail_xtensa_op_new();
TestDetailXtensaOp *
test_detail_xtensa_op_clone(const TestDetailXtensaOp *detail);
void test_detail_xtensa_op_free(TestDetailXtensaOp *detail);

bool test_expected_xtensa(csh *handle, const cs_xtensa *actual,
const TestDetailXtensa *expected);

#endif // TEST_DETAIL_XTENSA_H
220 changes: 148 additions & 72 deletions suite/cstest/include/test_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -1191,81 +1191,153 @@ static const cs_enum_id_map cs_enum_map[] = {
{ .str = "SYSTEMZ_INSN_FORM_INSTE", .val = SYSTEMZ_INSN_FORM_INSTE },
{ .str = "SYSTEMZ_INSN_FORM_INSTI", .val = SYSTEMZ_INSN_FORM_INSTI },
{ .str = "SYSTEMZ_INSN_FORM_INSTIE", .val = SYSTEMZ_INSN_FORM_INSTIE },
{ .str = "SYSTEMZ_INSN_FORM_INSTMII", .val = SYSTEMZ_INSN_FORM_INSTMII },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIA", .val = SYSTEMZ_INSN_FORM_INSTRIA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIB", .val = SYSTEMZ_INSN_FORM_INSTRIB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIC", .val = SYSTEMZ_INSN_FORM_INSTRIC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEA", .val = SYSTEMZ_INSN_FORM_INSTRIEA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEB", .val = SYSTEMZ_INSN_FORM_INSTRIEB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEC", .val = SYSTEMZ_INSN_FORM_INSTRIEC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIED", .val = SYSTEMZ_INSN_FORM_INSTRIED },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEE", .val = SYSTEMZ_INSN_FORM_INSTRIEE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEF", .val = SYSTEMZ_INSN_FORM_INSTRIEF },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEG", .val = SYSTEMZ_INSN_FORM_INSTRIEG },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILA", .val = SYSTEMZ_INSN_FORM_INSTRILA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILB", .val = SYSTEMZ_INSN_FORM_INSTRILB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILC", .val = SYSTEMZ_INSN_FORM_INSTRILC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIS", .val = SYSTEMZ_INSN_FORM_INSTRIS },
{ .str = "SYSTEMZ_INSN_FORM_INSTMII",
.val = SYSTEMZ_INSN_FORM_INSTMII },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIA",
.val = SYSTEMZ_INSN_FORM_INSTRIA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIB",
.val = SYSTEMZ_INSN_FORM_INSTRIB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIC",
.val = SYSTEMZ_INSN_FORM_INSTRIC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEA",
.val = SYSTEMZ_INSN_FORM_INSTRIEA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEB",
.val = SYSTEMZ_INSN_FORM_INSTRIEB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEC",
.val = SYSTEMZ_INSN_FORM_INSTRIEC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIED",
.val = SYSTEMZ_INSN_FORM_INSTRIED },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEE",
.val = SYSTEMZ_INSN_FORM_INSTRIEE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEF",
.val = SYSTEMZ_INSN_FORM_INSTRIEF },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIEG",
.val = SYSTEMZ_INSN_FORM_INSTRIEG },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILA",
.val = SYSTEMZ_INSN_FORM_INSTRILA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILB",
.val = SYSTEMZ_INSN_FORM_INSTRILB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRILC",
.val = SYSTEMZ_INSN_FORM_INSTRILC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRIS",
.val = SYSTEMZ_INSN_FORM_INSTRIS },
{ .str = "SYSTEMZ_INSN_FORM_INSTRR", .val = SYSTEMZ_INSN_FORM_INSTRR },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRD", .val = SYSTEMZ_INSN_FORM_INSTRRD },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRE", .val = SYSTEMZ_INSN_FORM_INSTRRE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFA", .val = SYSTEMZ_INSN_FORM_INSTRRFA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFB", .val = SYSTEMZ_INSN_FORM_INSTRRFB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFC", .val = SYSTEMZ_INSN_FORM_INSTRRFC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFD", .val = SYSTEMZ_INSN_FORM_INSTRRFD },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFE", .val = SYSTEMZ_INSN_FORM_INSTRRFE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRS", .val = SYSTEMZ_INSN_FORM_INSTRRS },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSA", .val = SYSTEMZ_INSN_FORM_INSTRSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSB", .val = SYSTEMZ_INSN_FORM_INSTRSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSI", .val = SYSTEMZ_INSN_FORM_INSTRSI },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSLA", .val = SYSTEMZ_INSN_FORM_INSTRSLA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSLB", .val = SYSTEMZ_INSN_FORM_INSTRSLB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSYA", .val = SYSTEMZ_INSN_FORM_INSTRSYA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSYB", .val = SYSTEMZ_INSN_FORM_INSTRSYB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXA", .val = SYSTEMZ_INSN_FORM_INSTRXA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXB", .val = SYSTEMZ_INSN_FORM_INSTRXB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXE", .val = SYSTEMZ_INSN_FORM_INSTRXE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXF", .val = SYSTEMZ_INSN_FORM_INSTRXF },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXYA", .val = SYSTEMZ_INSN_FORM_INSTRXYA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXYB", .val = SYSTEMZ_INSN_FORM_INSTRXYB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRD",
.val = SYSTEMZ_INSN_FORM_INSTRRD },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRE",
.val = SYSTEMZ_INSN_FORM_INSTRRE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFA",
.val = SYSTEMZ_INSN_FORM_INSTRRFA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFB",
.val = SYSTEMZ_INSN_FORM_INSTRRFB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFC",
.val = SYSTEMZ_INSN_FORM_INSTRRFC },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFD",
.val = SYSTEMZ_INSN_FORM_INSTRRFD },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRFE",
.val = SYSTEMZ_INSN_FORM_INSTRRFE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRRS",
.val = SYSTEMZ_INSN_FORM_INSTRRS },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSA",
.val = SYSTEMZ_INSN_FORM_INSTRSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSB",
.val = SYSTEMZ_INSN_FORM_INSTRSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSI",
.val = SYSTEMZ_INSN_FORM_INSTRSI },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSLA",
.val = SYSTEMZ_INSN_FORM_INSTRSLA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSLB",
.val = SYSTEMZ_INSN_FORM_INSTRSLB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSYA",
.val = SYSTEMZ_INSN_FORM_INSTRSYA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRSYB",
.val = SYSTEMZ_INSN_FORM_INSTRSYB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXA",
.val = SYSTEMZ_INSN_FORM_INSTRXA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXB",
.val = SYSTEMZ_INSN_FORM_INSTRXB },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXE",
.val = SYSTEMZ_INSN_FORM_INSTRXE },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXF",
.val = SYSTEMZ_INSN_FORM_INSTRXF },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXYA",
.val = SYSTEMZ_INSN_FORM_INSTRXYA },
{ .str = "SYSTEMZ_INSN_FORM_INSTRXYB",
.val = SYSTEMZ_INSN_FORM_INSTRXYB },
{ .str = "SYSTEMZ_INSN_FORM_INSTS", .val = SYSTEMZ_INSN_FORM_INSTS },
{ .str = "SYSTEMZ_INSN_FORM_INSTSI", .val = SYSTEMZ_INSN_FORM_INSTSI },
{ .str = "SYSTEMZ_INSN_FORM_INSTSIL", .val = SYSTEMZ_INSN_FORM_INSTSIL },
{ .str = "SYSTEMZ_INSN_FORM_INSTSIY", .val = SYSTEMZ_INSN_FORM_INSTSIY },
{ .str = "SYSTEMZ_INSN_FORM_INSTSMI", .val = SYSTEMZ_INSN_FORM_INSTSMI },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSA", .val = SYSTEMZ_INSN_FORM_INSTSSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSB", .val = SYSTEMZ_INSN_FORM_INSTSSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSC", .val = SYSTEMZ_INSN_FORM_INSTSSC },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSD", .val = SYSTEMZ_INSN_FORM_INSTSSD },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSE", .val = SYSTEMZ_INSN_FORM_INSTSSE },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSF", .val = SYSTEMZ_INSN_FORM_INSTSSF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIA", .val = SYSTEMZ_INSN_FORM_INSTVRIA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIB", .val = SYSTEMZ_INSN_FORM_INSTVRIB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIC", .val = SYSTEMZ_INSN_FORM_INSTVRIC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRID", .val = SYSTEMZ_INSN_FORM_INSTVRID },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIE", .val = SYSTEMZ_INSN_FORM_INSTVRIE },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIF", .val = SYSTEMZ_INSN_FORM_INSTVRIF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIG", .val = SYSTEMZ_INSN_FORM_INSTVRIG },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIH", .val = SYSTEMZ_INSN_FORM_INSTVRIH },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRII", .val = SYSTEMZ_INSN_FORM_INSTVRII },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRA", .val = SYSTEMZ_INSN_FORM_INSTVRRA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRB", .val = SYSTEMZ_INSN_FORM_INSTVRRB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRC", .val = SYSTEMZ_INSN_FORM_INSTVRRC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRD", .val = SYSTEMZ_INSN_FORM_INSTVRRD },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRE", .val = SYSTEMZ_INSN_FORM_INSTVRRE },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRF", .val = SYSTEMZ_INSN_FORM_INSTVRRF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRG", .val = SYSTEMZ_INSN_FORM_INSTVRRG },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRH", .val = SYSTEMZ_INSN_FORM_INSTVRRH },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRI", .val = SYSTEMZ_INSN_FORM_INSTVRRI },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRJ", .val = SYSTEMZ_INSN_FORM_INSTVRRJ },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRK", .val = SYSTEMZ_INSN_FORM_INSTVRRK },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSA", .val = SYSTEMZ_INSN_FORM_INSTVRSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSB", .val = SYSTEMZ_INSN_FORM_INSTVRSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSC", .val = SYSTEMZ_INSN_FORM_INSTVRSC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSD", .val = SYSTEMZ_INSN_FORM_INSTVRSD },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRV", .val = SYSTEMZ_INSN_FORM_INSTVRV },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRX", .val = SYSTEMZ_INSN_FORM_INSTVRX },
{ .str = "SYSTEMZ_INSN_FORM_INSTVSI", .val = SYSTEMZ_INSN_FORM_INSTVSI },
{ .str = "SYSTEMZ_INSN_FORM_INSTSIL",
.val = SYSTEMZ_INSN_FORM_INSTSIL },
{ .str = "SYSTEMZ_INSN_FORM_INSTSIY",
.val = SYSTEMZ_INSN_FORM_INSTSIY },
{ .str = "SYSTEMZ_INSN_FORM_INSTSMI",
.val = SYSTEMZ_INSN_FORM_INSTSMI },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSA",
.val = SYSTEMZ_INSN_FORM_INSTSSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSB",
.val = SYSTEMZ_INSN_FORM_INSTSSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSC",
.val = SYSTEMZ_INSN_FORM_INSTSSC },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSD",
.val = SYSTEMZ_INSN_FORM_INSTSSD },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSE",
.val = SYSTEMZ_INSN_FORM_INSTSSE },
{ .str = "SYSTEMZ_INSN_FORM_INSTSSF",
.val = SYSTEMZ_INSN_FORM_INSTSSF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIA",
.val = SYSTEMZ_INSN_FORM_INSTVRIA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIB",
.val = SYSTEMZ_INSN_FORM_INSTVRIB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIC",
.val = SYSTEMZ_INSN_FORM_INSTVRIC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRID",
.val = SYSTEMZ_INSN_FORM_INSTVRID },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIE",
.val = SYSTEMZ_INSN_FORM_INSTVRIE },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIF",
.val = SYSTEMZ_INSN_FORM_INSTVRIF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIG",
.val = SYSTEMZ_INSN_FORM_INSTVRIG },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRIH",
.val = SYSTEMZ_INSN_FORM_INSTVRIH },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRII",
.val = SYSTEMZ_INSN_FORM_INSTVRII },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRA",
.val = SYSTEMZ_INSN_FORM_INSTVRRA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRB",
.val = SYSTEMZ_INSN_FORM_INSTVRRB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRC",
.val = SYSTEMZ_INSN_FORM_INSTVRRC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRD",
.val = SYSTEMZ_INSN_FORM_INSTVRRD },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRE",
.val = SYSTEMZ_INSN_FORM_INSTVRRE },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRF",
.val = SYSTEMZ_INSN_FORM_INSTVRRF },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRG",
.val = SYSTEMZ_INSN_FORM_INSTVRRG },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRH",
.val = SYSTEMZ_INSN_FORM_INSTVRRH },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRI",
.val = SYSTEMZ_INSN_FORM_INSTVRRI },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRJ",
.val = SYSTEMZ_INSN_FORM_INSTVRRJ },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRRK",
.val = SYSTEMZ_INSN_FORM_INSTVRRK },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSA",
.val = SYSTEMZ_INSN_FORM_INSTVRSA },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSB",
.val = SYSTEMZ_INSN_FORM_INSTVRSB },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSC",
.val = SYSTEMZ_INSN_FORM_INSTVRSC },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRSD",
.val = SYSTEMZ_INSN_FORM_INSTVRSD },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRV",
.val = SYSTEMZ_INSN_FORM_INSTVRV },
{ .str = "SYSTEMZ_INSN_FORM_INSTVRX",
.val = SYSTEMZ_INSN_FORM_INSTVRX },
{ .str = "SYSTEMZ_INSN_FORM_INSTVSI",
.val = SYSTEMZ_INSN_FORM_INSTVSI },
{ .str = "SYSTEMZ_OP_IMM", .val = SYSTEMZ_OP_IMM },
{ .str = "SYSTEMZ_OP_MEM", .val = SYSTEMZ_OP_MEM },
{ .str = "SYSTEMZ_OP_REG", .val = SYSTEMZ_OP_REG },
Expand Down Expand Up @@ -1467,6 +1539,10 @@ static const cs_enum_id_map cs_enum_map[] = {
{ .str = "XCORE_OP_IMM", .val = XCORE_OP_IMM },
{ .str = "XCORE_OP_MEM", .val = XCORE_OP_MEM },
{ .str = "XCORE_OP_REG", .val = XCORE_OP_REG },
{ .str = "XTENSA_OP_IMM", .val = XTENSA_OP_IMM },
{ .str = "XTENSA_OP_L32R", .val = XTENSA_OP_L32R },
{ .str = "XTENSA_OP_MEM", .val = XTENSA_OP_MEM },
{ .str = "XTENSA_OP_REG", .val = XTENSA_OP_REG },
{ .str = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzx",
.val = 0xffffff }, // For testing
{ .str = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
Expand Down
7 changes: 7 additions & 0 deletions suite/cstest/src/test_detail.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ TestDetail *test_detail_clone(TestDetail *detail)
if (detail->m68k) {
clone->m68k = test_detail_m68k_clone(detail->m68k);
}
if (detail->xtensa) {
clone->xtensa = test_detail_xtensa_clone(detail->xtensa);
}

return clone;
}
Expand Down Expand Up @@ -404,5 +407,9 @@ bool test_expected_detail(csh *handle, const cs_insn *insn,
return test_expected_m68k(handle, &actual->m68k,
expected->m68k);
}
if (expected->xtensa) {
return test_expected_xtensa(handle, &actual->xtensa,
expected->xtensa);
}
return true;
}
Loading

0 comments on commit 3adb13e

Please sign in to comment.