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

@@ -90,6 +90,9 @@ extern struct mie_value *mie_builder_msg(
extern struct mie_value *mie_builder_cmp_eq(
struct mie_builder *builder, struct mie_value *left,
struct mie_value *right, const char *name);
extern struct mie_value *mie_builder_cmp_neq(
struct mie_builder *builder, struct mie_value *left,
struct mie_value *right, const char *name);
extern struct mie_value *mie_builder_cmp_lt(
struct mie_builder *builder, struct mie_value *left,
struct mie_value *right, const char *name);

View File

@@ -17,8 +17,10 @@ enum mie_instr_type {
MIE_INSTR_ALLOCA,
MIE_INSTR_SWITCH,
MIE_INSTR_BR,
MIE_INSTR_BR_IF,
MIE_INSTR_MSG,
MIE_INSTR_CMP_EQ,
MIE_INSTR_CMP_NEQ,
MIE_INSTR_CMP_LT,
MIE_INSTR_CMP_GT,
MIE_INSTR_CMP_LEQ,