2016-09-24 20:46:08 +00:00
|
|
|
#include "mcg.h"
|
|
|
|
#include "mcgg.h"
|
2016-09-24 15:20:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define PANIC printf
|
|
|
|
|
2016-09-24 20:46:08 +00:00
|
|
|
static int OP_LABEL(struct ir* ir)
|
|
|
|
{
|
2016-09-29 20:06:04 +00:00
|
|
|
if (ir->is_root && ir->is_generated)
|
2016-09-25 20:17:14 +00:00
|
|
|
{
|
2016-09-24 20:46:08 +00:00
|
|
|
return ir_to_esn(IR_REG, ir->size);
|
2016-09-25 20:17:14 +00:00
|
|
|
}
|
2016-09-24 20:46:08 +00:00
|
|
|
return ir_to_esn(ir->opcode, ir->size);
|
2016-09-24 15:20:40 +00:00
|
|
|
}
|
|
|
|
|
2016-09-24 20:46:08 +00:00
|
|
|
#define LEFT_CHILD(p) ((p)->left)
|
|
|
|
#define RIGHT_CHILD(p) ((p)->right)
|
|
|
|
|
|
|
|
#define burm_assert(b, s) assert(b)
|
|
|
|
|
|
|
|
extern void burm_panic_cannot_match(struct ir* ir);
|
2016-09-24 15:20:40 +00:00
|
|
|
|
2016-10-01 11:56:52 +00:00
|
|
|
static bool burm_predicate_int(struct ir* ir)
|
|
|
|
{
|
|
|
|
return ir->goal_no == 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool burm_predicate_float(struct ir* ir)
|
|
|
|
{
|
|
|
|
return ir->goal_no == 5;
|
|
|
|
}
|
|
|
|
|