From: Dmitry Selyutin Date: Wed, 6 Sep 2023 18:54:40 +0000 (+0300) Subject: libsvp64: introduce API sketch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b26ec8839992ade8363674f767c74f4a1d93e949;p=openpower-isa.git libsvp64: introduce API sketch --- 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);