SPRUI04F july 2015 – april 2023
Assembly optimizer directives supply data for and control the assembly optimization process. The assembly optimizer optimizes linear assembly code that is contained within procedures; that is, code within the .proc and .endproc directives or within the .cproc and .endproc directives. If you do not use .cproc/.proc directives in your linear assembly file, your code will not be optimized by the assembly optimizer. This section describes these directives and others that you can use with the assembly optimizer.
Table 5-2 summarizes the assembly optimizer directives. It provides the syntax for each directive, a description of each directive, and any restrictions that you should keep in mind. See the specific directive topic for more detail.
In Table 5-2 and the detailed directive topics, the following terms for parameters are used:
Symbolic variable name or machine register
Symbol used for a memory reference (not a register)
Machine (hardware) register
Symbolic user name or symbolic register name
Symbolic variable name or machine register
Syntax | Description | Restrictions |
---|---|---|
.call [ret_reg =] func_name (argument1 , argument2 , ...) | Calls a function | Valid only within procedures |
.circ symbol1 / register1 [,symbol2 / register2] | Declares circular addressing | Must manually insert setup/teardown code for circular addressing. Valid only within procedures |
label .cproc [argument1 [, argument2 , …]] | Start a C/C++ callable procedure | Must use with .endproc |
.endproc | End a C/C++ callable procedure | Must use with .cproc |
.endproc [variable1 [, variable2,…]] | End a procedure | Must use with .proc |
.map symbol1 / register1 [,symbol2 / register2 ] | Assigns a symbol to a register | Must use an actual machine register |
.mdep [memref1[, memref2 ]] | Indicates a memory dependence | Valid only within procedures |
.mptr {variable|memref}, base [+ offset] [, stride] | Avoid memory bank conflicts | Valid only within procedures |
.no_mdep | No memory aliases in the function | Valid only within procedures |
.pref symbol / register1[/register2 /...] | Assigns a symbol to a register in a set | Must use actual machine registers |
label .proc [variable1 [, variable2 , …]] | Start a procedure | Must use with .endproc |
.reg symbol1[, symbol2 ,…] | Declare variables | Valid only within procedures |
.rega symbol1[, symbol2 ,…] | Partition symbol to A-side register | Valid only within procedures |
.regb symbol1[, symbol2 ,…] | Partition symbol to B-side register | Valid only within procedures |
.reserve [register1 [, register2 ,…]] | Prevents the compiler from allocating a register | Valid only within procedures |
.return [argument] | Return a value to a procedure | Valid only within .cproc procedures |
label .trip min | Specify trip count value | Valid only within procedures |
.volatile memref1[, memref2 ,…] | Designate memory reference volatile | Use --interrupt_threshold=1 if reference may be modified during an interrupt |