libFirm 1.20
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_inner_trampoline, ir_bk_last = ir_bk_inner_trampoline
}
 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_node ** get_Builtin_param_arr (ir_node *node)
 Returns the parameter inputs of Builtin node node as array.
int get_Builtin_n_params (const ir_node *node)
 Returns the number of parameters of a Builtin.
ir_nodeget_Builtin_param (const ir_node *node, int pos)
 Returns the Builtin parameter at position pos.
void set_Builtin_param (ir_node *node, int pos, ir_node *param)
 Sets the Builtin parameter at position pos.
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.
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.
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.
ir_nodenew_Builtin (ir_node *irn_mem, int arity, ir_node *const *in, ir_builtin_kind kind, ir_type *type)
 Construct a Builtin node.
int is_Builtin (const ir_node *node)
 Test if node is a Builtin.
ir_nodeget_Builtin_mem (const ir_node *node)
 Returns mem input of a Builtin node.
void set_Builtin_mem (ir_node *node, ir_node *mem)
 Sets mem input of a Builtin node.
ir_builtin_kind get_Builtin_kind (const ir_node *node)
 Returns kind attribute of a Builtin node.
void set_Builtin_kind (ir_node *node, ir_builtin_kind kind)
 Sets kind attribute of a Builtin node.
ir_typeget_Builtin_type (const ir_node *node)
 Returns type attribute of a Builtin node.
void set_Builtin_type (ir_node *node, ir_type *type)
 Sets type attribute of a Builtin node.
ir_opget_op_Builtin (void)
 Returns opcode for Builtin nodes.

Variables

ir_opop_Builtin
 Builtin opcode.

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_inner_trampoline 

address of a trampoline for GCC inner functions

Definition at line 346 of file firm_types.h.

enum n_Builtin

Input numbers for Builtin node.

Definition at line 619 of file nodeops.h.

enum pn_Builtin

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

Enumerator:
pn_Builtin_M 

memory result

Definition at line 628 of file nodeops.h.


Function Documentation

ir_builtin_kind get_Builtin_kind ( const ir_node node)

Returns kind attribute of a Builtin node.

ir_node* get_Builtin_mem ( const ir_node node)

Returns mem input of a Builtin node.

int get_Builtin_n_params ( const ir_node node)

Returns the number of parameters of a Builtin.

ir_node* get_Builtin_param ( const ir_node node,
int  pos 
)

Returns the Builtin parameter at position pos.

ir_node** get_Builtin_param_arr ( ir_node node)

Returns the parameter inputs of Builtin node node as array.

ir_type* get_Builtin_type ( const ir_node node)

Returns type attribute of a Builtin node.

ir_op* get_op_Builtin ( void  )

Returns opcode for Builtin nodes.

int is_Builtin ( const ir_node node)

Test if node is a Builtin.

Returns:
1 if the node is a Builtin node, 0 otherwise
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_memmemory dependency
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call
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_memmemory dependency
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call
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_memmemory dependency
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call
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_memmemory dependency
aritysize of additional inputs array
inadditional inputs
kindkind of builtin
typemethod type for the builtin call
void set_Builtin_kind ( ir_node node,
ir_builtin_kind  kind 
)

Sets kind attribute of a Builtin node.

void set_Builtin_mem ( ir_node node,
ir_node mem 
)

Sets mem input of a Builtin node.

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

Sets the Builtin parameter at position pos.

void set_Builtin_type ( ir_node node,
ir_type type 
)

Sets type attribute of a Builtin node.


Variable Documentation

Builtin opcode.

Definition at line 139 of file opcodes.h.