|
size_t | get_ASM_n_constraints (const ir_node *node) |
| Returns the number of output constraints for an ASM node.
|
|
size_t | get_ASM_n_clobbers (const ir_node *node) |
| Returns the number of clobbered registers for an ASM node.
|
|
ir_node * | new_rd_ASM (dbg_info *dbgi, ir_node *block, ir_node *irn_mem, int arity, ir_node *const *in, ident *text, size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobbers, ident **clobbers, ir_cons_flags flags) |
| Construct an ASM node.
|
|
ir_node * | new_r_ASM (ir_node *block, ir_node *irn_mem, int arity, ir_node *const *in, ident *text, size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobbers, ident **clobbers, ir_cons_flags flags) |
| Construct an ASM node.
|
|
ir_node * | new_d_ASM (dbg_info *dbgi, ir_node *irn_mem, int arity, ir_node *const *in, ident *text, size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobbers, ident **clobbers, ir_cons_flags flags) |
| Construct an ASM node.
|
|
ir_node * | new_ASM (ir_node *irn_mem, int arity, ir_node *const *in, ident *text, size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobbers, ident **clobbers, ir_cons_flags flags) |
| Construct an ASM node.
|
|
int | is_ASM (const ir_node *node) |
| Test if node is a ASM.
|
|
ir_node * | get_ASM_mem (const ir_node *node) |
| Returns mem input of an ASM node.
|
|
void | set_ASM_mem (ir_node *node, ir_node *mem) |
| Sets mem input of an ASM node.
|
|
int | get_ASM_n_inputs (ir_node const *node) |
| Get the number of ASM inputs.
|
|
ir_node * | get_ASM_input (ir_node const *node, int pos) |
| Get the ASM input with index pos .
|
|
void | set_ASM_input (ir_node *node, int pos, ir_node *input) |
| Set the ASM input with index pos .
|
|
ir_node ** | get_ASM_input_arr (ir_node *node) |
| Get an array of all ASM inputs.
|
|
ir_asm_constraint * | get_ASM_constraints (const ir_node *node) |
| Returns constraints attribute of an ASM node.
|
|
void | set_ASM_constraints (ir_node *node, ir_asm_constraint *constraints) |
| Sets constraints attribute of an ASM node.
|
|
ident ** | get_ASM_clobbers (const ir_node *node) |
| Returns clobbers attribute of an ASM node.
|
|
void | set_ASM_clobbers (ir_node *node, ident **clobbers) |
| Sets clobbers attribute of an ASM node.
|
|
ident * | get_ASM_text (const ir_node *node) |
| Returns text attribute of an ASM node.
|
|
void | set_ASM_text (ir_node *node, ident *text) |
| Sets text attribute of an ASM node.
|
|
ir_op * | get_op_ASM (void) |
| Returns opcode for ASM nodes.
|
|
executes assembler fragments of the target machine.
The node contains a template for an assembler snippet. The compiler will replace occurrences of %0, %1, ... with input/output operands, %% with a single % char. Some backends allow additional specifiers (for example w3, b3, 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 implicitly set cc on all ASM statements).
Example (an i386 instruction):
ASM(text="btsl %1, %0",
constraints = ["+m", "r"],
clobbers = ["cc"])
%0 references a memory reference which the operation both reads and writes. For this the node has an address input operand. %1 references 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)
◆ ir_asm_constraint
A input/output constraint attribute.
Definition at line 272 of file firm_types.h.
Data Fields |
ident * |
constraint |
The constraint for this input/output. |
int |
in_pos |
The input position for this constraint. |
ir_mode * |
mode |
The mode of the constraint. |
int |
out_pos |
The output position for this constraint. |
◆ n_ASM
Input numbers for ASM node.
Enumerator |
---|
n_ASM_mem | memory dependency
|
n_ASM_max | |
Definition at line 116 of file nodes.h.
◆ pn_ASM
Projection numbers for result of ASM node (use for Proj nodes)
Enumerator |
---|
pn_ASM_M | memory result
|
pn_ASM_X_regular | control flow when no jump occurs
|
pn_ASM_first_out | first output
|
pn_ASM_max | |
Definition at line 124 of file nodes.h.
◆ get_ASM_clobbers()
Returns clobbers attribute of an ASM node.
◆ get_ASM_constraints()
Returns constraints attribute of an ASM node.
◆ get_ASM_input()
Get the ASM input with index pos
.
◆ get_ASM_input_arr()
Get an array of all ASM inputs.
◆ get_ASM_mem()
Returns mem input of an ASM node.
◆ get_ASM_n_clobbers()
size_t get_ASM_n_clobbers |
( |
const ir_node * | node | ) |
|
Returns the number of clobbered registers for an ASM node.
◆ get_ASM_n_constraints()
size_t get_ASM_n_constraints |
( |
const ir_node * | node | ) |
|
Returns the number of output constraints for an ASM node.
◆ get_ASM_n_inputs()
int get_ASM_n_inputs |
( |
ir_node const * | node | ) |
|
Get the number of ASM inputs.
◆ get_ASM_text()
Returns text attribute of an ASM node.
◆ get_op_ASM()
ir_op * get_op_ASM |
( |
void | | ) |
|
Returns opcode for ASM nodes.
◆ is_ASM()
Test if node is a ASM.
- Returns
- 1 if the node is a ASM node, 0 otherwise
◆ new_ASM()
Construct an ASM node.
- Parameters
-
irn_mem | mem |
arity | size of additional inputs array |
in | additional inputs |
text | assembler text |
n_constraints | number of constraints |
constraints | constraints |
n_clobbers | number of clobbered registers/memory |
clobbers | list of clobbered registers/memory |
flags | specifies alignment, volatility and pin state |
◆ new_d_ASM()
Construct an ASM node.
- Parameters
-
dbgi | A pointer to debug information. |
irn_mem | mem |
arity | size of additional inputs array |
in | additional inputs |
text | assembler text |
n_constraints | number of constraints |
constraints | constraints |
n_clobbers | number of clobbered registers/memory |
clobbers | list of clobbered registers/memory |
flags | specifies alignment, volatility and pin state |
◆ new_r_ASM()
Construct an ASM node.
- Parameters
-
block | The IR block the node belongs to. |
irn_mem | mem |
arity | size of additional inputs array |
in | additional inputs |
text | assembler text |
n_constraints | number of constraints |
constraints | constraints |
n_clobbers | number of clobbered registers/memory |
clobbers | list of clobbered registers/memory |
flags | specifies alignment, volatility and pin state |
◆ new_rd_ASM()
ir_node * new_rd_ASM |
( |
dbg_info * | dbgi, |
|
|
ir_node * | block, |
|
|
ir_node * | irn_mem, |
|
|
int | arity, |
|
|
ir_node *const * | in, |
|
|
ident * | text, |
|
|
size_t | n_constraints, |
|
|
ir_asm_constraint * | constraints, |
|
|
size_t | n_clobbers, |
|
|
ident ** | clobbers, |
|
|
ir_cons_flags | flags ) |
Construct an ASM node.
- Parameters
-
dbgi | A pointer to debug information. |
block | The IR block the node belongs to. |
irn_mem | mem |
arity | size of additional inputs array |
in | additional inputs |
text | assembler text |
n_constraints | number of constraints |
constraints | constraints |
n_clobbers | number of clobbered registers/memory |
clobbers | list of clobbered registers/memory |
flags | specifies alignment, volatility and pin state |
◆ set_ASM_clobbers()
Sets clobbers attribute of an ASM node.
◆ set_ASM_constraints()
Sets constraints attribute of an ASM node.
◆ set_ASM_input()
Set the ASM input with index pos
.
◆ set_ASM_mem()
Sets mem input of an ASM node.
◆ set_ASM_text()
Sets text attribute of an ASM node.
◆ op_ASM
ASM opcode.
Definition at line 229 of file nodes.h.