Commit cc412420 authored by Michael Beck's avatar Michael Beck
Browse files

Add result mode to Division operations.

[r13995]
parent 5447bfad
......@@ -104,7 +104,7 @@ new_bd_##instr(dbg_info *db, ir_node *block, \
#define NEW_BD_DIVOP(instr) \
static ir_node * \
new_bd_##instr(dbg_info *db, ir_node *block, \
ir_node *memop, ir_node *op1, ir_node *op2) \
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) \
{ \
ir_node *in[3]; \
ir_node *res; \
......@@ -113,6 +113,8 @@ new_bd_##instr(dbg_info *db, ir_node *block, \
in[1] = op1; \
in[2] = op2; \
res = new_ir_node(db, irg, block, op_##instr, mode_T, 3, in); \
res->attr.divmod.exc.pin_state = op_pin_state_pinned; \
res->attr.divmod.res_mode = mode; \
res = optimize_node(res); \
IRN_VRFY_IRG(res, irg); \
return res; \
......@@ -150,12 +152,12 @@ new_rd_##instr(dbg_info *db, ir_graph *irg, ir_node *block, \
#define NEW_RD_DIVOP(instr) \
ir_node * \
new_rd_##instr(dbg_info *db, ir_graph *irg, ir_node *block, \
ir_node *memop, ir_node *op1, ir_node *op2) \
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) \
{ \
ir_node *res; \
ir_graph *rem = current_ir_graph; \
current_ir_graph = irg; \
res = new_bd_##instr(db, block, memop, op1, op2); \
res = new_bd_##instr(db, block, memop, op1, op2, mode); \
current_ir_graph = rem; \
return res; \
}
......@@ -189,8 +191,6 @@ new_bd_Block(dbg_info *db, int arity, ir_node **in) {
set_Block_matured(res, 1);
set_Block_block_visited(res, 0);
/* res->attr.block.exc = exc_normal; */
/* res->attr.block.handler_entry = 0; */
res->attr.block.dead = 0;
res->attr.block.irg = irg;
res->attr.block.backedge = new_backedge_arr(irg->obst, arity);
......@@ -208,7 +208,6 @@ new_bd_Start(dbg_info *db, ir_node *block) {
ir_graph *irg = current_ir_graph;
res = new_ir_node(db, irg, block, op_Start, mode_T, 0, NULL);
/* res->attr.start.irg = irg; */
IRN_VRFY_IRG(res, irg);
return res;
......@@ -1482,20 +1481,20 @@ ir_node *new_r_Mul(ir_graph *irg, ir_node *block,
return new_rd_Mul(NULL, irg, block, op1, op2, mode);
}
ir_node *new_r_Quot(ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2) {
return new_rd_Quot(NULL, irg, block, memop, op1, op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_rd_Quot(NULL, irg, block, memop, op1, op2, mode);
}
ir_node *new_r_DivMod(ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2) {
return new_rd_DivMod(NULL, irg, block, memop, op1, op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_rd_DivMod(NULL, irg, block, memop, op1, op2, mode);
}
ir_node *new_r_Div(ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2) {
return new_rd_Div(NULL, irg, block, memop, op1, op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_rd_Div(NULL, irg, block, memop, op1, op2, mode);
}
ir_node *new_r_Mod(ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2) {
return new_rd_Mod(NULL, irg, block, memop, op1, op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_rd_Mod(NULL, irg, block, memop, op1, op2, mode);
}
ir_node *new_r_Abs(ir_graph *irg, ir_node *block,
ir_node *op, ir_mode *mode) {
......@@ -2612,10 +2611,9 @@ static void allocate_frag_arr(ir_node *res, ir_op *op, ir_node ***frag_store) {
} /* allocate_frag_arr */
ir_node *
new_d_Quot(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
new_d_Quot(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *res;
res = new_bd_Quot(db, current_ir_graph->current_block, memop, op1, op2);
res->attr.except.pin_state = op_pin_state_pinned;
res = new_bd_Quot(db, current_ir_graph->current_block, memop, op1, op2, mode);
#if PRECISE_EXC_CONTEXT
allocate_frag_arr(res, op_Quot, &res->attr.except.frag_arr); /* Could be optimized away. */
#endif
......@@ -2624,10 +2622,9 @@ new_d_Quot(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
} /* new_d_Quot */
ir_node *
new_d_DivMod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
new_d_DivMod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *res;
res = new_bd_DivMod(db, current_ir_graph->current_block, memop, op1, op2);
res->attr.except.pin_state = op_pin_state_pinned;
res = new_bd_DivMod(db, current_ir_graph->current_block, memop, op1, op2, mode);
#if PRECISE_EXC_CONTEXT
allocate_frag_arr(res, op_DivMod, &res->attr.except.frag_arr); /* Could be optimized away. */
#endif
......@@ -2636,10 +2633,9 @@ new_d_DivMod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
} /* new_d_DivMod */
ir_node *
new_d_Div(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
new_d_Div(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *res;
res = new_bd_Div(db, current_ir_graph->current_block, memop, op1, op2);
res->attr.except.pin_state = op_pin_state_pinned;
res = new_bd_Div(db, current_ir_graph->current_block, memop, op1, op2, mode);
#if PRECISE_EXC_CONTEXT
allocate_frag_arr(res, op_Div, &res->attr.except.frag_arr); /* Could be optimized away. */
#endif
......@@ -2648,10 +2644,9 @@ new_d_Div(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
}
ir_node *
new_d_Mod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2) {
new_d_Mod(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *res;
res = new_bd_Mod(db, current_ir_graph->current_block, memop, op1, op2);
res->attr.except.pin_state = op_pin_state_pinned;
res = new_bd_Mod(db, current_ir_graph->current_block, memop, op1, op2, mode);
#if PRECISE_EXC_CONTEXT
allocate_frag_arr(res, op_Mod, &res->attr.except.frag_arr); /* Could be optimized away. */
#endif
......@@ -3134,17 +3129,17 @@ ir_node *new_Minus(ir_node *op, ir_mode *mode) {
ir_node *new_Mul(ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Mul(NULL, op1, op2, mode);
}
ir_node *new_Quot(ir_node *memop, ir_node *op1, ir_node *op2) {
return new_d_Quot(NULL, memop, op1, op2);
ir_node *new_Quot(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Quot(NULL, memop, op1, op2, mode);
}
ir_node *new_DivMod(ir_node *memop, ir_node *op1, ir_node *op2) {
return new_d_DivMod(NULL, memop, op1, op2);
ir_node *new_DivMod(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_DivMod(NULL, memop, op1, op2, mode);
}
ir_node *new_Div(ir_node *memop, ir_node *op1, ir_node *op2) {
return new_d_Div(NULL, memop, op1, op2);
ir_node *new_Div(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Div(NULL, memop, op1, op2, mode);
}
ir_node *new_Mod(ir_node *memop, ir_node *op1, ir_node *op2) {
return new_d_Mod(NULL, memop, op1, op2);
ir_node *new_Mod(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Mod(NULL, memop, op1, op2, mode);
}
ir_node *new_Abs(ir_node *op, ir_mode *mode) {
return new_d_Abs(NULL, op, mode);
......
......@@ -244,9 +244,9 @@
* mature_immBlock(this_block);
* a_val = get_value(42, mode_Iu);
* mem = get_store();
* div = new_Div(mem, a_val, a_val);
* mem = new_Proj(div, mode_M, 0); * for the numbers for Proj see docu *
* res = new_Proj(div, mode_Iu, 2);
* div = new_Div(mem, a_val, a_val, mode_Iu);
* mem = new_Proj(div, mode_M, pn_Div_M); * for the numbers for Proj see docu *
* res = new_Proj(div, mode_Iu, pn_Div_res);
* set_store(mem);
* set_value(res, 42);
* cf_op = new_Jmp();
......@@ -276,10 +276,10 @@
* ir_node *new_Sub (ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Minus (ir_node *op, ir_mode *mode);
* ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2);
* ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2);
* ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2);
* ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2);
* ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Abs (ir_node *op, ir_mode *mode);
* ir_node *new_And (ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Or (ir_node *op1, ir_node *op2, ir_mode *mode);
......@@ -678,35 +678,35 @@
*
* Trivial.
*
* ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2)
* --------------------------------------------------------------
* ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode)
* -----------------------------------------------------------------------------
*
* Quot performs exact division of floating point numbers. It's mode
* is Tuple, the mode of the result must be annotated to the Proj
* is Tuple, the mode of the result must match the Proj mode
* that extracts the result of the arithmetic operations.
*
* Inputs:
* The store needed to model exceptions and the two operands.
* Output:
* A tuple contaning a memory and a execution for modeling exceptions
* A tuple containing a memory and a execution for modeling exceptions
* and the result of the arithmetic operation.
*
* ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2)
* ----------------------------------------------------------------
* ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode)
* -------------------------------------------------------------------------------
*
* Performs Div and Mod on interger values.
* Performs Div and Mod on integer values.
*
* Output:
* A tuple contaning a memory and a execution for modeling exceptions
* A tuple containing a memory and a execution for modeling exceptions
* and the two result of the arithmetic operations.
*
* ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2)
* -------------------------------------------------------------
* ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode)
* ----------------------------------------------------------------------------
*
* Trivial.
*
* ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2)
* -------------------------------------------------------------
* ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode)
* ----------------------------------------------------------------------------
*
* Trivial.
*
......@@ -1451,9 +1451,10 @@ ir_node *new_rd_Mul (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_rd_Quot (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a DivMod node.
*
......@@ -1463,9 +1464,10 @@ ir_node *new_rd_Quot (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the results.
*/
ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Div node.
*
......@@ -1475,9 +1477,10 @@ ir_node *new_rd_DivMod (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_rd_Div (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mod node.
*
......@@ -1487,9 +1490,10 @@ ir_node *new_rd_Div (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_rd_Mod (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Abs node.
*
......@@ -2247,9 +2251,10 @@ ir_node *new_r_Mul (ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_r_Quot (ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a DivMod node.
*
......@@ -2258,9 +2263,10 @@ ir_node *new_r_Quot (ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the results.
*/
ir_node *new_r_DivMod (ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Div node.
*
......@@ -2269,9 +2275,10 @@ ir_node *new_r_DivMod (ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_r_Div (ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mod node.
*
......@@ -2280,9 +2287,10 @@ ir_node *new_r_Div (ir_graph *irg, ir_node *block,
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_r_Mod (ir_graph *irg, ir_node *block,
ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Abs node.
*
......@@ -3025,8 +3033,9 @@ ir_node *new_d_Mul (dbg_info *db, ir_node *op1, ir_node *op2, ir_mode *mode);
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_d_Quot (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_d_Quot (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a DivMod node.
*
......@@ -3036,8 +3045,9 @@ ir_node *new_d_Quot (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2)
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the results.
*/
ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Div node.
*
......@@ -3047,8 +3057,9 @@ ir_node *new_d_DivMod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2)
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_d_Div (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_d_Div (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mod node.
*
......@@ -3058,8 +3069,9 @@ ir_node *new_d_Div (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2)
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_d_Mod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_d_Mod (dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Abs node.
*
......@@ -3814,8 +3826,9 @@ ir_node *new_Mul (ir_node *op1, ir_node *op2, ir_mode *mode);
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a DivMod node.
*
......@@ -3824,8 +3837,9 @@ ir_node *new_Quot (ir_node *memop, ir_node *op1, ir_node *op2);
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the results.
*/
ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Div node.
*
......@@ -3834,8 +3848,9 @@ ir_node *new_DivMod (ir_node *memop, ir_node *op1, ir_node *op2);
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Mod node.
*
......@@ -3844,8 +3859,9 @@ ir_node *new_Div (ir_node *memop, ir_node *op1, ir_node *op2);
* @param *memop The store needed to model exceptions
* @param *op1 The first operand.
* @param *op2 The second operand.
* @param *mode The mode of the result.
*/
ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2);
ir_node *new_Mod (ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode);
/** Constructor for a Abs node.
*
......
......@@ -1397,14 +1397,28 @@ set_##OP##_mem(ir_node *node, ir_node *mem) { \
set_irn_n(node, 0, mem); \
}
#define DIVOP(OP) \
BINOP_MEM(OP) \
\
ir_mode *get_##OP##_resmode(const ir_node *node) { \
assert(node->op == op_##OP); \
return node->attr.divmod.res_mode; \
} \
\
void set_##OP##_resmode(ir_node *node, ir_mode *mode) { \
assert(node->op == op_##OP); \
node->attr.divmod.res_mode = mode; \
}
BINOP(Add)
BINOP(Sub)
UNOP(Minus)
BINOP(Mul)
BINOP_MEM(Quot)
BINOP_MEM(DivMod)
BINOP_MEM(Div)
BINOP_MEM(Mod)
DIVOP(Quot)
DIVOP(DivMod)
DIVOP(Div)
DIVOP(Mod)
UNOP(Abs)
BINOP(And)
BINOP(Or)
......
......@@ -594,12 +594,12 @@ void set_Sel_entity (ir_node *node, ir_entity *ent);
*/
typedef enum {
pn_Call_M_regular = 0, /**< The memory result. */
pn_Call_T_result = 2, /**< The tuple containing all (0, 1, 2, ...) results */
pn_Call_P_value_res_base = 4,/**< A pointer to the memory region containing copied results
passed by value (for compound result types). */
pn_Call_X_except = 1, /**< The control flow result branching to the exception handler */
pn_Call_T_result = 2, /**< The tuple containing all (0, 1, 2, ...) results */
pn_Call_M_except = 3, /**< The memory result in case the called method terminated with
an exception */
pn_Call_P_value_res_base = 4,/**< A pointer to the memory region containing copied results
passed by value (for compound result types). */
pn_Call_max = 5 /**< number of projections from a Call */
} pn_Call; /* Projection numbers for Call. */
#define pn_Call_M pn_Call_M_regular
......@@ -693,6 +693,8 @@ ir_node *get_Quot_right(const ir_node *node);
void set_Quot_right(ir_node *node, ir_node *right);
ir_node *get_Quot_mem(ir_node *node);
void set_Quot_mem(ir_node *node, ir_node *mem);
ir_mode *get_Quot_resmode(const ir_node *node);
void set_Quot_resmode(ir_node *node, ir_mode *mode);
/**
* Projection numbers for Quot: use for Proj nodes!
......@@ -710,6 +712,8 @@ ir_node *get_DivMod_right(const ir_node *node);
void set_DivMod_right(ir_node *node, ir_node *right);
ir_node *get_DivMod_mem(ir_node *node);
void set_DivMod_mem(ir_node *node, ir_node *mem);
ir_mode *get_DivMod_resmode(const ir_node *node);
void set_DivMod_resmode(ir_node *node, ir_mode *mode);
/**
* Projection numbers for DivMod: use for Proj nodes!
......@@ -728,6 +732,8 @@ ir_node *get_Div_right(const ir_node *node);
void set_Div_right(ir_node *node, ir_node *right);
ir_node *get_Div_mem(ir_node *node);
void set_Div_mem(ir_node *node, ir_node *mem);
ir_mode *get_Div_resmode(const ir_node *node);
void set_Div_resmode(ir_node *node, ir_mode *mode);
/**
* Projection numbers for Div: use for Proj nodes!
......@@ -745,6 +751,8 @@ ir_node *get_Mod_right(const ir_node *node);
void set_Mod_right(ir_node *node, ir_node *right);
ir_node *get_Mod_mem(ir_node *node);
void set_Mod_mem(ir_node *node, ir_node *mem);
ir_mode *get_Mod_resmode(const ir_node *node);
void set_Mod_resmode(ir_node *node, ir_mode *mode);
/**
* Projection numbers for Mod: use for Proj nodes!
......
......@@ -146,11 +146,6 @@ typedef struct {
@todo Ev. replace by bitfield! */
} filter_attr;
/** EndReg/EndExcept attributes. */
typedef struct {
char dummy;
} end_attr;
/** CallBegin attributes. */
typedef struct {
ir_node * call; /**< Associated Call-operation. */
......@@ -192,6 +187,12 @@ typedef struct {
char strict; /**< If set, this is a strict Conv that cannot be removed. */
} conv_attr;
/** Div/Mod/DivMod/Quot attribute. */
typedef struct {
except_attr exc; /**< the exception attribute. MUST be the first one. */
ir_mode *res_mode; /**< Result mode for the division. */
} divmod_attr;
/** Some IR-nodes just have one attribute, these are stored here,
some have more. Their name is 'irnodename_attr' */
typedef union {
......@@ -220,11 +221,11 @@ typedef union {
long proj; /**< For Proj: contains the result position to project */
confirm_attr confirm_cmp; /**< For Confirm: compare operation */
filter_attr filter; /**< For Filter */
end_attr end; /**< For EndReg, EndExcept */
except_attr except; /**< For Phi node construction in case of exceptions */
copyb_attr copyb; /**< For CopyB operation */
bound_attr bound; /**< For Bound operation */
conv_attr conv; /**< For Conv operation */
divmod_attr divmod; /**< For Div/Mod/DivMod operation */
} attr;
/**
......
This diff is collapsed.
Supports Markdown
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