From 6ce54897086db42a2f4a59d946e9895954cc9ef3 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 4 Apr 2006 13:00:53 +0000 Subject: [PATCH] Add test functions for machine, machine_operand and machine_user bits [r7572] --- ir/ir/irnode.c | 16 ++++++++++++++++ ir/ir/irnode.h | 15 +++++++++++++++ ir/ir/irnode_t.h | 15 +++++++++++++++ ir/ir/irop_t.h | 5 +++++ 4 files changed, 51 insertions(+) diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 5db3b33c8..3389ab67e 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -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) { diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index 0e5861674..d327f51b5 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -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. */ diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index bc2e5266b..817071a75 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -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) diff --git a/ir/ir/irop_t.h b/ir/ir/irop_t.h index 61b20e781..aa67a72c8 100644 --- a/ir/ir/irop_t.h +++ b/ir/ir/irop_t.h @@ -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); -- 2.20.1