From b26ec8839992ade8363674f767c74f4a1d93e949 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 6 Sep 2023 21:54:40 +0300 Subject: [PATCH] libsvp64: introduce API sketch --- src/libsvp64/svp64.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/libsvp64/svp64.h diff --git a/src/libsvp64/svp64.h b/src/libsvp64/svp64.h new file mode 100644 index 00000000..1b7033c1 --- /dev/null +++ b/src/libsvp64/svp64.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include + +enum svp64_state { + SVP64_SUCCESS, + SVP64_ERROR_LOOKUP, + SVP64_ERROR_OPERAND_0, + SVP64_ERROR_OPERAND_1, + SVP64_ERROR_OPERAND_2, + SVP64_ERROR_OPERAND_3, + SVP64_ERROR_OPERAND_4, + SVP64_ERROR_OPERAND_5, + SVP64_ERROR_OPERAND_6, + SVP64_ERROR_OPERAND_7, +}; + +struct svp64_opcode { + uint32_t value; + uint32_t mask; +}; + +struct svp64_record { + struct svp64_opcode opcode; + uint8_t operands[8]; + char name[16]; +}; + +struct svp64_ctx { + struct svp64_record const *record; + int64_t operands[8]; +}; + +enum svp64_state +svp64_disassemble(struct svp64_ctx *ctx, uint32_t insn); + +struct svp64_record const * +svp64_lookup_insn(uint32_t insn); -- 2.30.2