The ARC version of
as supports the following additional
w (write only)
r|w (read or write)
This specifies an extension auxiliary register called mulhi which is at address 0x12 in the memory space and which is only writable.
.extCondCode is_busy,0x14 add.is_busy r1,r2,r3 bis_busy _main
The other parameter gives a description of the register having a shortcut in the pipeline. The valid values are:
This defines an extension core register mlo with the value 57 which can shortcut the pipeline.
SUFFIX_FLAGwhich indicates the absence or presence of conditional suffixes and flag setting by the extension instruction. It is also possible to specify that an instruction sets the flags and is condtional by using
In addition there could be modifiers for the syntax class as described below:
OP1_MUST_BE_IMM: Modifies syntax class SYNTAX_3OP, specifying that the first operand of a three-operand instruction must be an immediate (i.e., the result is discarded). OP1_MUST_BE_IMM is used by bitwise ORing it with SYNTAX_3OP as given in the example below. This could usually be used to set the flags using specific instructions and not retain results.
OP1_IMM_IMPLIED: Modifies syntax class SYNTAX_20P, it specifies that there is an implied immediate destination operand which does not appear in the syntax. For example, if the source code contains an instruction like:
it really means that the first argument is an implied immediate (that is, the result is discarded). This is the same as though the source code were: inst 0,r1,r2. You use OP1_IMM_IMPLIED by bitwise ORing it with SYNTAX_20P.
For example, defining 64-bit multiplier with immediate operands:
.extInstruction mp64,0x14,0x0,SUFFIX_COND | SUFFIX_FLAG , SYNTAX_3OP|OP1_MUST_BE_IMM
The above specifies an extension instruction called mp64 which has 3 operands, sets the flags, can be used with a condition code, for which the first operand is an immediate. (Equivalent to discarding the result of the operation).
.extInstruction mul64,0x14,0x00,SUFFIX_COND, SYNTAX_2OP|OP1_IMM_IMPLIED
This describes a 2 operand instruction with an implicit first immediate operand. The result of this operation would be discarded.
.optiondirective must be followed by the desired core version. Again
arcis an alias for
.option directive overrides the command line option
-marc; a warning is emitted when the version is not consistent
between the two - even for the implicit default core version