mie: implement comparison and branch instruction generation

This commit is contained in:
2025-04-28 15:41:31 +01:00
parent 1431cb7b47
commit 6af9b62b88
5 changed files with 286 additions and 16 deletions

View File

@@ -27,6 +27,13 @@ static struct mie_type *get_type(struct mie_value *v, struct mie_ctx *ctx)
struct mie_binary_op *op = (struct mie_binary_op *)instr;
return op->op_type;
}
case MIE_INSTR_CMP_EQ:
case MIE_INSTR_CMP_NEQ:
case MIE_INSTR_CMP_LT:
case MIE_INSTR_CMP_LEQ:
case MIE_INSTR_CMP_GT:
case MIE_INSTR_CMP_GEQ:
return mie_ctx_get_int_type(ctx, 1);
case MIE_INSTR_LOAD: {
struct mie_load *load = (struct mie_load *)instr;
return load->l_type;