libFirm
|
executes assembler fragments of the target machine. More...
Data Structures | |
struct | ir_asm_constraint |
A input/output constraint attribute. More... | |
Enumerations | |
enum | n_ASM { n_ASM_mem, n_ASM_max = n_ASM_mem } |
Input numbers for ASM node. More... | |
Functions | |
ir_node * | new_rd_ASM (dbg_info *db, ir_node *block, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text) |
Constructor for an ASM pseudo node. More... | |
ir_node * | new_r_ASM (ir_node *block, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text) |
Constructor for an ASM pseudo node. More... | |
ir_node * | new_d_ASM (dbg_info *db, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text) |
Constructor for an ASM pseudo node. More... | |
ir_node * | new_ASM (ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text) |
Constructor for an ASM pseudo node. More... | |
size_t | get_ASM_n_output_constraints (const ir_node *node) |
Returns the number of output constraints for an ASM node. More... | |
size_t | get_ASM_n_clobbers (const ir_node *node) |
Returns the number of clobbered registers for an ASM node. More... | |
int | is_ASM (const ir_node *node) |
Test if node is a ASM. More... | |
ir_node * | get_ASM_mem (const ir_node *node) |
Returns mem input of an ASM node. More... | |
void | set_ASM_mem (ir_node *node, ir_node *mem) |
Sets mem input of an ASM node. More... | |
int | get_ASM_n_inputs (ir_node const *node) |
Get the number of ASM inputs. More... | |
ir_node * | get_ASM_input (ir_node const *node, int pos) |
Get the ASM input with index pos . More... | |
void | set_ASM_input (ir_node *node, int pos, ir_node *input) |
Set the ASM input with index pos . More... | |
ir_node ** | get_ASM_input_arr (ir_node *node) |
Get an array of all ASM inputs. More... | |
ir_asm_constraint * | get_ASM_input_constraints (const ir_node *node) |
Returns input_constraints attribute of an ASM node. More... | |
void | set_ASM_input_constraints (ir_node *node, ir_asm_constraint *input_constraints) |
Sets input_constraints attribute of an ASM node. More... | |
ir_asm_constraint * | get_ASM_output_constraints (const ir_node *node) |
Returns output_constraints attribute of an ASM node. More... | |
void | set_ASM_output_constraints (ir_node *node, ir_asm_constraint *output_constraints) |
Sets output_constraints attribute of an ASM node. More... | |
ident ** | get_ASM_clobbers (const ir_node *node) |
Returns clobbers attribute of an ASM node. More... | |
void | set_ASM_clobbers (ir_node *node, ident **clobbers) |
Sets clobbers attribute of an ASM node. More... | |
ident * | get_ASM_text (const ir_node *node) |
Returns text attribute of an ASM node. More... | |
void | set_ASM_text (ir_node *node, ident *text) |
Sets text attribute of an ASM node. More... | |
ir_op * | get_op_ASM (void) |
Returns opcode for ASM nodes. More... | |
Variables | |
ir_op * | op_ASM |
ASM opcode. More... | |
executes assembler fragments of the target machine.
The node contains a template for an assembler snippet. The compiler will replace occurences of %0 to %9 with input/output registers, %% with a single % char. Some backends allow additional specifiers (for example w3, l3, h3 on x86 to get a 16bit, 8hit low, 8bit high part of a register). After the replacements the text is emitted into the final assembly.
The clobber list contains names of registers which have an undefined value after the assembler instruction is executed; it may also contain 'memory' or 'cc' if global state/memory changes or the condition code registers (some backends implicitely set cc, memory clobbers on all ASM statements).
Example (an i386 instruction)::
ASM(text="btsl %1, %0", input_constraints = ["=m", "r"], clobbers = ["cc"])
As there are no output, the %0 references the first input which is just an address which the asm operation writes to. %1 references to an input which is passed as a register. The condition code register has an unknown value after the instruction.
(This format is inspired by the gcc extended asm syntax)
struct ir_asm_constraint |
A input/output constraint attribute.
Definition at line 267 of file firm_types.h.
Data Fields | ||
---|---|---|
ident * | constraint | The constraint for this input/output. |
ir_mode * | mode | The mode of the constraint. |
unsigned | pos | The input/output position for this constraint. |
enum n_ASM |
Returns clobbers attribute of an ASM node.
Definition at line 2925 of file gen_irnode.c.
Get the ASM input with index pos
.
Definition at line 33 of file gen_irnode.c.
ir_asm_constraint* get_ASM_input_constraints | ( | const ir_node * | node | ) |
Returns input_constraints attribute of an ASM node.
Definition at line 2905 of file gen_irnode.c.
Returns mem input of an ASM node.
Definition at line 18 of file gen_irnode.c.
size_t get_ASM_n_clobbers | ( | const ir_node * | node | ) |
Returns the number of clobbered registers for an ASM node.
int get_ASM_n_inputs | ( | ir_node const * | node | ) |
Get the number of ASM inputs.
Definition at line 28 of file gen_irnode.c.
size_t get_ASM_n_output_constraints | ( | const ir_node * | node | ) |
Returns the number of output constraints for an ASM node.
ir_asm_constraint* get_ASM_output_constraints | ( | const ir_node * | node | ) |
Returns output_constraints attribute of an ASM node.
Definition at line 2915 of file gen_irnode.c.
Returns text attribute of an ASM node.
Definition at line 2935 of file gen_irnode.c.
ir_op* get_op_ASM | ( | void | ) |
int is_ASM | ( | const ir_node * | node | ) |
Test if node is a ASM.
Definition at line 2900 of file gen_irnode.c.
ir_node* new_ASM | ( | ir_node * | mem, |
int | arity, | ||
ir_node * | in[], | ||
ir_asm_constraint * | inputs, | ||
size_t | n_outs, | ||
ir_asm_constraint * | outputs, | ||
size_t | n_clobber, | ||
ident * | clobber[], | ||
ident * | asm_text | ||
) |
Constructor for an ASM pseudo node.
*mem | memory dependency |
arity | The number of data inputs to the node. |
*in | The array of length arity of data inputs. |
*inputs | The array of length arity of input constraints. |
n_outs | The number of data outputs to the node. |
*outputs | The array of length n_outs of output constraints. |
n_clobber | The number of clobbered registers. |
*clobber | The array of length n_clobber of clobbered registers. |
*asm_text | The assembler text. |
ir_node* new_d_ASM | ( | dbg_info * | db, |
ir_node * | mem, | ||
int | arity, | ||
ir_node * | in[], | ||
ir_asm_constraint * | inputs, | ||
size_t | n_outs, | ||
ir_asm_constraint * | outputs, | ||
size_t | n_clobber, | ||
ident * | clobber[], | ||
ident * | asm_text | ||
) |
Constructor for an ASM pseudo node.
*db | A pointer for debug information. |
*mem | memory dependency |
arity | The number of data inputs to the node. |
*in | The array of length arity of data inputs. |
*inputs | The array of length arity of input constraints. |
n_outs | The number of data outputs to the node. |
*outputs | The array of length n_outs of output constraints. |
n_clobber | The number of clobbered registers. |
*clobber | The array of length n_clobber of clobbered registers. |
*asm_text | The assembler text. |
ir_node* new_r_ASM | ( | ir_node * | block, |
ir_node * | mem, | ||
int | arity, | ||
ir_node * | in[], | ||
ir_asm_constraint * | inputs, | ||
size_t | n_outs, | ||
ir_asm_constraint * | outputs, | ||
size_t | n_clobber, | ||
ident * | clobber[], | ||
ident * | asm_text | ||
) |
Constructor for an ASM pseudo node.
*block | The block the node belong to. |
*mem | memory dependency |
arity | The number of data inputs to the node. |
*in | The array of length arity of data inputs. |
*inputs | The array of length arity of input constraints. |
n_outs | The number of data outputs to the node. |
*outputs | The array of length n_outs of output constraints. |
n_clobber | The number of clobbered registers. |
*clobber | The array of length n_clobber of clobbered registers. |
*asm_text | The assembler text. |
ir_node* new_rd_ASM | ( | dbg_info * | db, |
ir_node * | block, | ||
ir_node * | mem, | ||
int | arity, | ||
ir_node * | in[], | ||
ir_asm_constraint * | inputs, | ||
size_t | n_outs, | ||
ir_asm_constraint * | outputs, | ||
size_t | n_clobber, | ||
ident * | clobber[], | ||
ident * | asm_text | ||
) |
Constructor for an ASM pseudo node.
*db | A pointer for debug information. |
*block | The block the node belong to. |
*mem | memory dependency |
arity | The number of data inputs to the node. |
*in | The array of length arity of data inputs. |
*inputs | The array of length arity of input constraints. |
n_outs | The number of data outputs to the node. |
*outputs | The array of length n_outs of output constraints. |
n_clobber | The number of clobbered registers. |
*clobber | The array of length n_clobber of clobbered registers. |
*asm_text | The assembler text. |
Sets clobbers attribute of an ASM node.
Definition at line 2930 of file gen_irnode.c.
Set the ASM input with index pos
.
Definition at line 38 of file gen_irnode.c.
void set_ASM_input_constraints | ( | ir_node * | node, |
ir_asm_constraint * | input_constraints | ||
) |
Sets input_constraints attribute of an ASM node.
Definition at line 2910 of file gen_irnode.c.
Sets mem input of an ASM node.
Definition at line 23 of file gen_irnode.c.
void set_ASM_output_constraints | ( | ir_node * | node, |
ir_asm_constraint * | output_constraints | ||
) |
Sets output_constraints attribute of an ASM node.
Definition at line 2920 of file gen_irnode.c.
Sets text attribute of an ASM node.
Definition at line 2940 of file gen_irnode.c.
ir_op* op_ASM |
ASM opcode.
Definition at line 158 of file nodes.h.
Referenced by get_ASM_input_arr(), get_op_ASM(), and set_typeconst_type().