#include "decode.h"
#include "feature_flags.h"
int decode_spec(context* ctx, Instruction* dec); int decode_scratchpad(context* ctx, Instruction* dec);
int aarch64_decompose(uint32_t instructionValue, Instruction* instr, uint64_t address)
{
context ctx = {0};
ctx.halted = 1; ctx.insword = instructionValue;
ctx.address = address;
ARCH_FEATURES_ENABLE_ALL(ctx.decode_features);
ARCH_FEATURES_ENABLE_ALL(ctx.pcode_features);
ctx.EDSCR_HDE = 1;
int rc = decode_spec(&ctx, instr);
if (rc != DECODE_STATUS_OK)
{
if (rc == DECODE_STATUS_END_OF_INSTRUCTION && instr->encoding == ENC_HINT_HM_HINTS)
{
while (0)
;
}
else
return rc;
}
return decode_scratchpad(&ctx, instr);
}