Commit 6ce54897 authored by Michael Beck's avatar Michael Beck
Browse files

Add test functions for machine, machine_operand and machine_user bits

[r7572]
parent 79f98a60
......@@ -2498,6 +2498,22 @@ int (is_irn_keep)(const ir_node *node) {
return _is_irn_keep(node);
}
/* Returns non-zero for nodes that are machine operations. */
int (is_irn_machine_op)(const ir_node *node) {
return _is_irn_machine_op(node);
}
/* Returns non-zero for nodes that are machine operands. */
int (is_irn_machine_operand)(const ir_node *node) {
return _is_irn_machine_operand(node);
}
/* Returns non-zero for nodes that have the n'th user machine flag set. */
int (is_irn_machine_user)(const ir_node *node, unsigned n) {
return _is_irn_machine_user(node, n);
}
/* Gets the string representation of the jump prediction .*/
const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred)
{
......
......@@ -1093,6 +1093,21 @@ int is_irn_constlike(const ir_node *node);
*/
int is_irn_keep(const ir_node *node);
/**
* Returns non-zero for nodes that are machine operations.
*/
int is_irn_machine_op(const ir_node *node);
/**
* Returns non-zero for nodes that are machine operands.
*/
int is_irn_machine_operand(const ir_node *node);
/**
* Returns non-zero for nodes that have the n'th user machine flag set.
*/
int is_irn_machine_user(const ir_node *node, unsigned n);
/**
* A type to express conditional jump predictions.
*/
......
......@@ -769,6 +769,18 @@ static INLINE int _is_irn_keep(const ir_node *node) {
return is_op_keep(_get_irn_op(node));
}
static INLINE int _is_irn_machine_op(const ir_node *node) {
return is_op_machine(_get_irn_op(node));
}
static INLINE int _is_irn_machine_operand(const ir_node *node) {
return is_op_machine_operand(_get_irn_op(node));
}
static INLINE int _is_irn_machine_user(const ir_node *node, unsigned n) {
return is_op_machine_user(_get_irn_op(node), n);
}
static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) {
assert (_get_irn_op(node) == op_Cond);
return node->attr.c.pred;
......@@ -834,6 +846,9 @@ static INLINE int _get_Psi_n_conds(ir_node *node) {
#define get_irn_entity_attr(node) _get_irn_entity_attr(node)
#define is_irn_constlike(node) _is_irn_constlike(node)
#define is_irn_keep(node) _is_irn_keep(node)
#define is_irn_machine_op(node) _is_irn_machine_op(node)
#define is_irn_machine_operand(node) _is_irn_machine_operand(node)
#define is_irn_machine_user(node, n) _is_irn_machine_user(node, n)
#define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
#define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)
#define get_Psi_n_conds(node) _get_Psi_n_conds(node)
......
......@@ -111,6 +111,11 @@ static INLINE int is_op_machine(const ir_op *op) {
return op->flags & irop_flag_machine;
}
/** Returns non-zero if operation is a machine operand */
static INLINE int is_op_machine_operand(const ir_op *op) {
return op->flags & irop_flag_machine_op;
}
/** Returns non-zero if operation is a machine user op number n */
static INLINE int is_op_machine_user(const ir_op *op, unsigned n) {
return op->flags & (irop_flag_user << n);
......
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