return 1;
}
+/**
+ * Check if the pinned state is right.
+ */
+static int verify_right_pinned(ir_node *n) {
+ ir_node *mem;
+
+ if (get_irn_pinned(n) == op_pin_state_pinned)
+ return 1;
+ mem = get_Call_mem(n);
+
+ /* if it's not pinned, its memory predecessor must be NoMem or Pin */
+ if (is_NoMem(mem) || is_Pin(mem))
+ return 1;
+ return 0;
+}
+
/**
* verify a Call node
*/
ASSERT_AND_RET( op1mode == mode_M && mode_is_reference(op2mode), "Call node", 0 ); /* operand M x ref */
/* NoMem nodes are only allowed as memory input if the Call is NOT pinned */
- ASSERT_AND_RET(
- (get_irn_op(get_Call_mem(n)) == op_NoMem) ||
- (get_irn_op(get_Call_mem(n)) != op_NoMem && get_irn_pinned(n) == op_pin_state_pinned),
- "Call node with wrong memory input", 0 );
+ ASSERT_AND_RET(verify_right_pinned(n),"Call node with wrong memory input", 0 );
mt = get_Call_type(n);
if(get_unknown_type() == mt) {
ASSERT_AND_RET_DBG(
(
- /* Mul: BB x int1 x int1 --> int2 */
- (mode_is_int(op1mode) && op2mode == op1mode && mode_is_int(mymode)) ||
+ /* Mul: BB x int_n x int_n --> int_n|int_2n */
+ (mode_is_int(op1mode) && op2mode == op1mode && mode_is_int(mymode) &&
+ (op1mode == mymode || get_mode_size_bits(op1mode) * 2 == get_mode_size_bits(mymode))) ||
/* Mul: BB x float x float --> float */
(mode_is_float(op1mode) && op2mode == op1mode && mymode == op1mode)
),
"Mul node",0,
- show_binop_failure(n, "/* Mul: BB x int1 x int1 --> int2 */ |\n"
+ show_binop_failure(n, "/* Mul: BB x int_n x int_n --> int_n|int_2n */ |\n"
"/* Mul: BB x float x float --> float */");
);
return 1;
}
+/**
+ * verify a Mulh node
+ */
+static int verify_node_Mulh(ir_node *n, ir_graph *irg) {
+ ir_mode *mymode = get_irn_mode(n);
+ ir_mode *op1mode = get_irn_mode(get_Mulh_left(n));
+ ir_mode *op2mode = get_irn_mode(get_Mulh_right(n));
+ (void) irg;
+
+ ASSERT_AND_RET_DBG(
+ (
+ /* Mulh: BB x int x int --> int */
+ (mode_is_int(op1mode) && op2mode == op1mode && op1mode == mymode)
+ ),
+ "Mulh node",0,
+ show_binop_failure(n, "/* Mulh: BB x int x int --> int */");
+ );
+ return 1;
+}
+
/**
* verify a Quot node
*/
ASSERT_AND_RET_DBG(
/* Cmp: BB x datab x datab --> b16 */
- mode_is_data (op1mode) &&
+ mode_is_datab(op1mode) &&
op2mode == op1mode &&
mymode == mode_T,
"Cmp node", 0,
/* NoMem nodes are only allowed as memory input if the CopyB is NOT pinned.
This should happen RARELY, as CopyB COPIES MEMORY */
- ASSERT_AND_RET(
- (get_irn_op(get_CopyB_mem(n)) == op_NoMem) ||
- (get_irn_op(get_CopyB_mem(n)) != op_NoMem && get_irn_pinned(n) == op_pin_state_pinned),
- "CopyB node with wrong memory input", 0 );
+ ASSERT_AND_RET(verify_right_pinned(n), "CopyB node with wrong memory input", 0 );
return 1;
}
CASE(Sub);
CASE(Minus);
CASE(Mul);
+ CASE(Mulh);
CASE(Quot);
CASE(DivMod);
CASE(Div);