mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-26 17:30:09 +00:00
fix set-space ir extension instruction; expand ctrlbits to u16, so that it can encode modern register sized decodes
This commit is contained in:
@@ -67,14 +67,14 @@ e_interpret(String8 bytecode)
|
||||
{
|
||||
// rjf: consume next opcode
|
||||
RDI_EvalOp op = (RDI_EvalOp)*ptr;
|
||||
U8 ctrlbits = 0;
|
||||
U16 ctrlbits = 0;
|
||||
if(op < RDI_EvalOp_COUNT)
|
||||
{
|
||||
ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
}
|
||||
else switch(op)
|
||||
{
|
||||
case E_IRExtKind_SetSpace:{ctrlbits = RDI_EVAL_CTRLBITS(16, 0, 0);}break;
|
||||
case E_IRExtKind_SetSpace:{ctrlbits = RDI_EVAL_CTRLBITS(32, 0, 0);}break;
|
||||
default:
|
||||
{
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
|
||||
+4
-4
@@ -78,7 +78,7 @@ e_select_ir_ctx(E_IRCtx *ctx)
|
||||
internal void
|
||||
e_oplist_push_op(Arena *arena, E_OpList *list, RDI_EvalOp opcode, E_Value value)
|
||||
{
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U16 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U32 p_size = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
E_Op *node = push_array_no_zero(arena, E_Op, 1);
|
||||
node->opcode = opcode;
|
||||
@@ -149,7 +149,7 @@ internal void
|
||||
e_oplist_push_string_literal(Arena *arena, E_OpList *list, String8 string)
|
||||
{
|
||||
RDI_EvalOp opcode = RDI_EvalOp_ConstString;
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U16 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U32 p_size = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
E_Op *node = push_array_no_zero(arena, E_Op, 1);
|
||||
node->opcode = opcode;
|
||||
@@ -1383,7 +1383,7 @@ e_append_oplist_from_irtree(Arena *arena, E_IRNode *root, E_OpList *out)
|
||||
else
|
||||
{
|
||||
// rjf: append ops for all children
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U16 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U64 child_count = RDI_POPN_FROM_CTRLBITS(ctrlbits);
|
||||
U64 idx = 0;
|
||||
for(E_IRNode *child = root->first;
|
||||
@@ -1428,7 +1428,7 @@ e_bytecode_from_oplist(Arena *arena, E_OpList *oplist)
|
||||
default:
|
||||
{
|
||||
// rjf: compute bytecode advance
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U16 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U64 extra_byte_count = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
U8 *next_ptr = ptr + 1 + extra_byte_count;
|
||||
Assert(next_ptr <= opl);
|
||||
|
||||
@@ -1385,7 +1385,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
{
|
||||
break;
|
||||
}
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U16 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U32 p_size = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
bytecode_size += 1+p_size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user