mie: implement sub/mul/div instruction generation
This commit is contained in:
@@ -382,15 +382,33 @@ static b_status write_instr(
|
||||
write_operand(converter, op->op_right, 0);
|
||||
break;
|
||||
}
|
||||
case MIE_INSTR_SUB:
|
||||
write_string(converter, "sub");
|
||||
case MIE_INSTR_SUB: {
|
||||
struct mie_binary_op *op = (struct mie_binary_op *)instr;
|
||||
mie_type_to_string(op->op_type, type, sizeof type);
|
||||
write_string_f(converter, "sub %s ", type);
|
||||
write_operand(converter, op->op_left, 0);
|
||||
write_string(converter, ", ");
|
||||
write_operand(converter, op->op_right, 0);
|
||||
break;
|
||||
case MIE_INSTR_MUL:
|
||||
write_string(converter, "mul");
|
||||
}
|
||||
case MIE_INSTR_MUL: {
|
||||
struct mie_binary_op *op = (struct mie_binary_op *)instr;
|
||||
mie_type_to_string(op->op_type, type, sizeof type);
|
||||
write_string_f(converter, "mul %s ", type);
|
||||
write_operand(converter, op->op_left, 0);
|
||||
write_string(converter, ", ");
|
||||
write_operand(converter, op->op_right, 0);
|
||||
break;
|
||||
case MIE_INSTR_DIV:
|
||||
write_string(converter, "div");
|
||||
}
|
||||
case MIE_INSTR_DIV: {
|
||||
struct mie_binary_op *op = (struct mie_binary_op *)instr;
|
||||
mie_type_to_string(op->op_type, type, sizeof type);
|
||||
write_string_f(converter, "div %s ", type);
|
||||
write_operand(converter, op->op_left, 0);
|
||||
write_string(converter, ", ");
|
||||
write_operand(converter, op->op_right, 0);
|
||||
break;
|
||||
}
|
||||
case MIE_INSTR_LOAD: {
|
||||
struct mie_load *load = (struct mie_load *)instr;
|
||||
mie_type_to_string(load->l_type, type, sizeof type);
|
||||
|
||||
Reference in New Issue
Block a user