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

performs a backend-specific builtin. More...

Enumerations

enum  ir_builtin_kind {
  ir_bk_trap, ir_bk_debugbreak, ir_bk_return_address, ir_bk_frame_address,
  ir_bk_prefetch, ir_bk_ffs, ir_bk_clz, ir_bk_ctz,
  ir_bk_popcount, ir_bk_parity, ir_bk_bswap, ir_bk_inport,
  ir_bk_outport, ir_bk_saturating_increment, ir_bk_compare_swap, ir_bk_may_alias,
  ir_bk_va_start, ir_bk_va_arg, ir_bk_last = ir_bk_va_arg
}
 Supported libFirm builtins. More...
 
enum  n_Builtin { n_Builtin_mem, n_Builtin_max = n_Builtin_mem }
 Input numbers for Builtin node. More...
 
enum  pn_Builtin { pn_Builtin_M, pn_Builtin_max = pn_Builtin_M }
 Projection numbers for result of Builtin node (use for Proj nodes) More...
 

Functions

ir_nodenew_rd_Builtin (dbg_info *dbgi, ir_node *block, ir_node *irn_mem, int arity, ir_node *const *in, ir_builtin_kind kind, ir_type *type)
 Construct a Builtin node. More...
 
ir_nodenew_r_Builtin (ir_node *block, ir_node *irn_mem, int arity, ir_node *const *in, ir_builtin_kind kind, ir_type *type)
 Construct a Builtin node. More...
 
ir_nodenew_d_Builtin (dbg_info *dbgi, ir_node *irn_mem, int arity, ir_node *const *in, ir_builtin_kind kind, ir_type *type)
 Construct a Builtin node. More...
 
ir_nodenew_Builtin (ir_node *irn_mem, int arity, ir_node *const *in, ir_builtin_kind kind, ir_type *type)
 Construct a Builtin node. More...
 
int is_Builtin (const ir_node *node)
 Test if node is a Builtin. More...
 
ir_nodeget_Builtin_mem (const ir_node *node)
 Returns mem input of a Builtin node. More...
 
void set_Builtin_mem (ir_node *node, ir_node *mem)
 Sets mem input of a Builtin node. More...
 
int get_Builtin_n_params (ir_node const *node)
 Get the number of Builtin params. More...
 
ir_nodeget_Builtin_param (ir_node const *node, int pos)
 Get the Builtin param with index pos. More...
 
void set_Builtin_param (ir_node *node, int pos, ir_node *param)
 Set the Builtin param with index pos. More...
 
ir_node ** get_Builtin_param_arr (ir_node *node)
 Get an array of all Builtin params. More...
 
ir_builtin_kind get_Builtin_kind (const ir_node *node)
 Returns kind attribute of a Builtin node. More...
 
void set_Builtin_kind (ir_node *node, ir_builtin_kind kind)
 Sets kind attribute of a Builtin node. More...
 
ir_typeget_Builtin_type (const ir_node *node)
 Returns type attribute of a Builtin node. More...
 
void set_Builtin_type (ir_node *node, ir_type *type)
 Sets type attribute of a Builtin node. More...
 
ir_opget_op_Builtin (void)
 Returns opcode for Builtin nodes. More...
 

Variables

ir_opop_Builtin
 Builtin opcode. More...
 

Detailed Description

performs a backend-specific builtin.

Enumeration Type Documentation

Supported libFirm builtins.

Enumerator
ir_bk_trap 

GCC __builtin_trap(): insert trap.

ir_bk_debugbreak 

MS __debugbreak(): insert debug break.

ir_bk_return_address 

GCC __builtin_return_address()

ir_bk_frame_address 

GCC __builtin_frame_address()

ir_bk_prefetch 

GCC __builtin_prefetch()

ir_bk_ffs 

GCC __builtin_ffs(): find first (least) significant 1 bit.

ir_bk_clz 

GCC __builtin_clz(): count leading zero.

ir_bk_ctz 

GCC __builtin_ctz(): count trailing zero.

ir_bk_popcount 

GCC __builtin_popcount(): population count.

ir_bk_parity 

GCC __builtin_parity(): parity.

ir_bk_bswap 

byte swap

ir_bk_inport 

in port

ir_bk_outport 

out port

ir_bk_saturating_increment 

saturating increment

ir_bk_compare_swap 

compare exchange (aka.

compare and swap)

ir_bk_may_alias 

replaced by 0 if args cannot alias, 1 otherwise

ir_bk_va_start 

va_start from <stdarg.h>

ir_bk_va_arg 

va_arg from <stdarg.h>

ir_bk_last 

Definition at line 276 of file firm_types.h.

enum n_Builtin

Input numbers for Builtin node.

Enumerator
n_Builtin_mem 

memory dependency

n_Builtin_max 

Definition at line 829 of file nodes.h.

enum pn_Builtin

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

Enumerator
pn_Builtin_M 

memory result

pn_Builtin_max 

Definition at line 837 of file nodes.h.

Function Documentation

ir_builtin_kind get_Builtin_kind ( const ir_node node)

Returns kind attribute of a Builtin node.

Definition at line 3034 of file gen_irnode.c.

ir_node* get_Builtin_mem ( const ir_node node)

Returns mem input of a Builtin node.

Definition at line 570 of file gen_irnode.c.

int get_Builtin_n_params ( ir_node const *  node)

Get the number of Builtin params.

Definition at line 580 of file gen_irnode.c.

ir_node* get_Builtin_param ( ir_node const *  node,
int  pos 
)

Get the Builtin param with index pos.

Definition at line 585 of file gen_irnode.c.

ir_node** get_Builtin_param_arr ( ir_node node)

Get an array of all Builtin params.

Definition at line 595 of file gen_irnode.c.

ir_type* get_Builtin_type ( const ir_node node)

Returns type attribute of a Builtin node.

Definition at line 3044 of file gen_irnode.c.

ir_op* get_op_Builtin ( void  )

Returns opcode for Builtin nodes.

Definition at line 600 of file gen_irnode.c.

References op_Builtin.

int is_Builtin ( const ir_node node)

Test if node is a Builtin.

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

Definition at line 3029 of file gen_irnode.c.

ir_node* new_Builtin ( ir_node irn_mem,
int  arity,
ir_node *const *  in,
ir_builtin_kind  kind,
ir_type type 
)

Construct a Builtin node.

Parameters
irn_memmem
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call

Definition at line 565 of file gen_irnode.c.

References new_d_Builtin().

ir_node* new_d_Builtin ( dbg_info dbgi,
ir_node irn_mem,
int  arity,
ir_node *const *  in,
ir_builtin_kind  kind,
ir_type type 
)

Construct a Builtin node.

Parameters
dbgiA pointer to debug information.
irn_memmem
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call

Definition at line 558 of file gen_irnode.c.

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

Referenced by new_Builtin().

ir_node* new_r_Builtin ( ir_node block,
ir_node irn_mem,
int  arity,
ir_node *const *  in,
ir_builtin_kind  kind,
ir_type type 
)

Construct a Builtin node.

Parameters
blockThe IR block the node belongs to.
irn_memmem
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call

Definition at line 553 of file gen_irnode.c.

References new_rd_Builtin().

ir_node* new_rd_Builtin ( dbg_info dbgi,
ir_node block,
ir_node irn_mem,
int  arity,
ir_node *const *  in,
ir_builtin_kind  kind,
ir_type type 
)

Construct a Builtin node.

Parameters
dbgiA pointer to debug information.
blockThe IR block the node belongs to.
irn_memmem
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call

Definition at line 530 of file gen_irnode.c.

References ALLOCAN, get_irn_irg(), get_unknown_type(), is_Method_type(), mode_T, new_ir_node(), op_Builtin, op_pin_state_pinned, optimize_node(), and verify_new_node().

Referenced by new_d_Builtin(), and new_r_Builtin().

void set_Builtin_kind ( ir_node node,
ir_builtin_kind  kind 
)

Sets kind attribute of a Builtin node.

Definition at line 3039 of file gen_irnode.c.

void set_Builtin_mem ( ir_node node,
ir_node mem 
)

Sets mem input of a Builtin node.

Definition at line 575 of file gen_irnode.c.

void set_Builtin_param ( ir_node node,
int  pos,
ir_node param 
)

Set the Builtin param with index pos.

Definition at line 590 of file gen_irnode.c.

void set_Builtin_type ( ir_node node,
ir_type type 
)

Sets type attribute of a Builtin node.

Definition at line 3049 of file gen_irnode.c.

Variable Documentation

ir_op* op_Builtin

Builtin opcode.

Definition at line 919 of file nodes.h.

Referenced by get_op_Builtin(), and new_rd_Builtin().