Commit bcf1aede authored by Moritz Kroll's avatar Moritz Kroll
Browse files

Added gen_ir.py support for Bound, CopyB, InstOf and Raise

[r25777]
parent d6d1fb04
......@@ -772,7 +772,6 @@ new_bd_Mux(dbg_info *db, ir_node *block,
IRN_VRFY_IRG(res, irg);
return res;
} /* new_bd_Mux */
#endif
static ir_node *
new_bd_CopyB(dbg_info *db, ir_node *block,
......@@ -843,7 +842,6 @@ new_bd_Bound(dbg_info *db, ir_node *block,
return res;
} /* new_bd_Bound */
#ifdef USE_ORIGINAL
static ir_node *
new_bd_Pin(dbg_info *db, ir_node *block, ir_node *node) {
ir_node *res;
......@@ -1428,7 +1426,6 @@ new_rd_Mux(dbg_info *db, ir_graph *irg, ir_node *block,
return res;
} /* new_rd_Mux */
#endif
ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type) {
......@@ -1479,7 +1476,6 @@ ir_node *new_rd_Bound(dbg_info *db, ir_graph *irg, ir_node *block,
return res;
} /* new_rd_Bound */
#ifdef USE_ORIGINAL
ir_node *new_rd_Pin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *node) {
ir_node *res;
ir_graph *rem = current_ir_graph;
......@@ -1746,7 +1742,6 @@ ir_node *new_r_Mux(ir_graph *irg, ir_node *block,
ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode) {
return new_rd_Mux(NULL, irg, block, sel, ir_false, ir_true, mode);
}
#endif
ir_node *new_r_CopyB(ir_graph *irg, ir_node *block,
ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type) {
return new_rd_CopyB(NULL, irg, block, store, dst, src, data_type);
......@@ -1763,7 +1758,6 @@ ir_node *new_r_Bound(ir_graph *irg, ir_node *block,
ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper) {
return new_rd_Bound(NULL, irg, block, store, idx, lower, upper);
}
#ifdef USE_ORIGINAL
ir_node *new_r_Pin(ir_graph *irg, ir_node *block, ir_node *node) {
return new_rd_Pin(NULL, irg, block, node);
}
......@@ -2698,7 +2692,6 @@ new_d_Mux(dbg_info *db, ir_node *sel, ir_node *ir_false,
return new_bd_Mux(db, current_ir_graph->current_block,
sel, ir_false, ir_true, mode);
} /* new_d_Mux */
#endif
ir_node *new_d_CopyB(dbg_info *db,ir_node *store,
ir_node *dst, ir_node *src, ir_type *data_type) {
......@@ -2733,7 +2726,6 @@ ir_node *new_d_Bound(dbg_info *db,ir_node *store,
return res;
} /* new_d_Bound */
#ifdef USE_ORIGINAL
ir_node *
new_d_Pin(dbg_info *db, ir_node *node) {
return new_bd_Pin(db, current_ir_graph->current_block, node);
......@@ -3174,7 +3166,6 @@ ir_node *new_NoMem(void) {
ir_node *new_Mux(ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode) {
return new_d_Mux(NULL, sel, ir_false, ir_true, mode);
}
#endif
ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type) {
return new_d_CopyB(NULL, store, dst, src, data_type);
}
......@@ -3187,7 +3178,6 @@ ir_node *new_Raise(ir_node *store, ir_node *obj) {
ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper) {
return new_d_Bound(NULL, store, idx, lower, upper);
}
#ifdef USE_ORIGINAL
ir_node *new_Pin(ir_node *node) {
return new_d_Pin(NULL, node);
}
......
......@@ -284,10 +284,10 @@ def main(argv):
gendir = argv[2]
# List of TODOs
niymap = ["Anchor", "ASM", "Bad", "Bound",
"CallBegin", "Const", "Const_type", "Const_long", "CopyB",
niymap = ["Anchor", "ASM", "Bad",
"CallBegin", "Const", "Const_type", "Const_long",
"defaultProj", "Dummy", "EndReg", "EndExcept",
"InstOf", "NoMem", "Phi", "Raise",
"NoMem", "Phi",
"simpleSel", "SymConst", "SymConst_type", "Sync"]
file = open(gendir + "/gen_ir_cons.c.inl", "w")
......
......@@ -149,6 +149,25 @@ Borrow = dict(
is_a = "binop"
),
Bound = dict(
ins = [ "mem", "index", "lower", "upper" ],
outs = [ "M", "X_regular", "X_except", "res" ],
attrs = [
dict(
name = "state",
type = "op_pin_state",
initname = ".exc.pin_state",
init = "op_pin_state_pinned"
)
],
d_post = '''
#if PRECISE_EXC_CONTEXT
firm_alloc_frag_arr(res, op_Bound, &res->attr.bound.exc.frag_arr);
#endif
'''
),
Break = dict(
mode = "mode_X"
),
......@@ -301,7 +320,12 @@ CopyB = dict(
name = "type",
type = "ir_type*"
)
]
],
d_post = '''
#if PRECISE_EXC_CONTEXT
firm_alloc_frag_arr(res, op_CopyB, &res->attr.copyb.exc.frag_arr);
#endif
'''
),
Div = dict(
......@@ -410,6 +434,25 @@ IJmp = dict(
ins = [ "target" ],
),
InstOf = dict(
ins = [ "store", "objptr" ],
outs = [ "M", "X_regular", "X_except", "res", "M_except" ],
attrs = [
dict(
name = "state",
type = "op_pin_state",
initname = ".exc.pin_state",
init = "op_pin_state_floats"
),
dict(
name = "type",
type = "ir_type*"
)
]
# TODO: No firm_alloc_frag_arr???
),
Jmp = dict(
mode = "mode_X",
op_flags = "cfopcode",
......@@ -535,6 +578,11 @@ Quot = dict(
'''
),
Raise = dict(
ins = [ "mem", "exo_ptr" ],
outs = [ "M", "X" ]
),
Return = dict(
ins = [ "mem" ],
arity = "variable",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment