libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Mod node

returns the remainder of its operands from an implied division. More...

Enumerations

enum  n_Mod { n_Mod_mem, n_Mod_left, n_Mod_right, n_Mod_max = n_Mod_right }
 Input numbers for Mod node. More...
 
enum  pn_Mod {
  pn_Mod_M, pn_Mod_res, pn_Mod_X_regular, pn_Mod_X_except,
  pn_Mod_max = pn_Mod_X_except
}
 Projection numbers for result of Mod node (use for Proj nodes) More...
 

Functions

ir_nodenew_rd_Mod (dbg_info *dbgi, ir_node *block, ir_node *irn_mem, ir_node *irn_left, ir_node *irn_right, ir_mode *resmode, int pinned)
 Construct a Mod node. More...
 
ir_nodenew_r_Mod (ir_node *block, ir_node *irn_mem, ir_node *irn_left, ir_node *irn_right, ir_mode *resmode, int pinned)
 Construct a Mod node. More...
 
ir_nodenew_d_Mod (dbg_info *dbgi, ir_node *irn_mem, ir_node *irn_left, ir_node *irn_right, ir_mode *resmode, int pinned)
 Construct a Mod node. More...
 
ir_nodenew_Mod (ir_node *irn_mem, ir_node *irn_left, ir_node *irn_right, ir_mode *resmode, int pinned)
 Construct a Mod node. More...
 
int is_Mod (const ir_node *node)
 Test if node is a Mod. More...
 
ir_nodeget_Mod_mem (const ir_node *node)
 Returns mem input of a Mod node. More...
 
void set_Mod_mem (ir_node *node, ir_node *mem)
 Sets mem input of a Mod node. More...
 
ir_nodeget_Mod_left (const ir_node *node)
 Returns left input of a Mod node. More...
 
void set_Mod_left (ir_node *node, ir_node *left)
 Sets left input of a Mod node. More...
 
ir_nodeget_Mod_right (const ir_node *node)
 Returns right input of a Mod node. More...
 
void set_Mod_right (ir_node *node, ir_node *right)
 Sets right input of a Mod node. More...
 
ir_modeget_Mod_resmode (const ir_node *node)
 Returns resmode attribute of a Mod node. More...
 
void set_Mod_resmode (ir_node *node, ir_mode *resmode)
 Sets resmode attribute of a Mod node. More...
 
ir_opget_op_Mod (void)
 Returns opcode for Mod nodes. More...
 

Variables

ir_opop_Mod
 Mod opcode. More...
 

Detailed Description

returns the remainder of its operands from an implied division.

Examples:

mod(5,3) produces 2 mod(5,-3) produces 2 mod(-5,3) produces -2 mod(-5,-3) produces -2

Enumeration Type Documentation

enum n_Mod

Input numbers for Mod node.

Enumerator
n_Mod_mem 

memory dependency

n_Mod_left 

first operand

n_Mod_right 

second operand

n_Mod_max 

Definition at line 2364 of file nodes.h.

enum pn_Mod

Projection numbers for result of Mod node (use for Proj nodes)

Enumerator
pn_Mod_M 

memory result

pn_Mod_res 

result of computation

pn_Mod_X_regular 

control flow when no exception occurs

pn_Mod_X_except 

control flow when exception occured

pn_Mod_max 

Definition at line 2374 of file nodes.h.

Function Documentation

ir_node* get_Mod_left ( const ir_node node)

Returns left input of a Mod node.

Definition at line 1599 of file gen_irnode.c.

ir_node* get_Mod_mem ( const ir_node node)

Returns mem input of a Mod node.

Definition at line 1589 of file gen_irnode.c.

ir_mode* get_Mod_resmode ( const ir_node node)

Returns resmode attribute of a Mod node.

Definition at line 3294 of file gen_irnode.c.

ir_node* get_Mod_right ( const ir_node node)

Returns right input of a Mod node.

Definition at line 1609 of file gen_irnode.c.

ir_op* get_op_Mod ( void  )

Returns opcode for Mod nodes.

Definition at line 1619 of file gen_irnode.c.

References op_Mod.

int is_Mod ( const ir_node node)

Test if node is a Mod.

Returns
1 if the node is a Mod node, 0 otherwise

Definition at line 3289 of file gen_irnode.c.

ir_node* new_d_Mod ( dbg_info dbgi,
ir_node irn_mem,
ir_node irn_left,
ir_node irn_right,
ir_mode resmode,
int  pinned 
)

Construct a Mod node.

Parameters
dbgiA pointer to debug information.
irn_memmem
irn_leftleft
irn_rightright
resmodemode of the result
pinnedpinned state

Definition at line 1577 of file gen_irnode.c.

References current_ir_graph, get_cur_block(), IR_GRAPH_CONSTRAINT_CONSTRUCTION, irg_is_constrained(), and new_rd_Mod().

Referenced by new_Mod().

ir_node* new_Mod ( ir_node irn_mem,
ir_node irn_left,
ir_node irn_right,
ir_mode resmode,
int  pinned 
)

Construct a Mod node.

Parameters
irn_memmem
irn_leftleft
irn_rightright
resmodemode of the result
pinnedpinned state

Definition at line 1584 of file gen_irnode.c.

References new_d_Mod().

ir_node* new_r_Mod ( ir_node block,
ir_node irn_mem,
ir_node irn_left,
ir_node irn_right,
ir_mode resmode,
int  pinned 
)

Construct a Mod node.

Parameters
blockThe IR block the node belongs to.
irn_memmem
irn_leftleft
irn_rightright
resmodemode of the result
pinnedpinned state

Definition at line 1572 of file gen_irnode.c.

References new_rd_Mod().

ir_node* new_rd_Mod ( dbg_info dbgi,
ir_node block,
ir_node irn_mem,
ir_node irn_left,
ir_node irn_right,
ir_mode resmode,
int  pinned 
)

Construct a Mod node.

Parameters
dbgiA pointer to debug information.
blockThe IR block the node belongs to.
irn_memmem
irn_leftleft
irn_rightright
resmodemode of the result
pinnedpinned state

Definition at line 1552 of file gen_irnode.c.

References get_irn_irg(), mode_T, new_ir_node(), op_Mod, optimize_node(), and verify_new_node().

Referenced by new_d_Mod(), and new_r_Mod().

void set_Mod_left ( ir_node node,
ir_node left 
)

Sets left input of a Mod node.

Definition at line 1604 of file gen_irnode.c.

void set_Mod_mem ( ir_node node,
ir_node mem 
)

Sets mem input of a Mod node.

Definition at line 1594 of file gen_irnode.c.

void set_Mod_resmode ( ir_node node,
ir_mode resmode 
)

Sets resmode attribute of a Mod node.

Definition at line 3299 of file gen_irnode.c.

void set_Mod_right ( ir_node node,
ir_node right 
)

Sets right input of a Mod node.

Definition at line 1614 of file gen_irnode.c.

Variable Documentation

ir_op* op_Mod

Mod opcode.

Definition at line 2454 of file nodes.h.

Referenced by get_op_Mod(), and new_rd_Mod().