Next: , Previous: ARC Floating Point, Up: ARC-Dependent

9.3.4 ARC Machine Directives

The ARC version of as supports the following additional machine directives:

.2byte expressions

.3byte expressions

.4byte expressions

.extAuxRegister name,address,mode
The ARCtangent A4 has extensible auxiliary register space. The auxiliary registers can be defined in the assembler source code by using this directive. The first parameter is the name of the new auxiallry register. The second parameter is the address of the register in the auxiliary register memory map for the variant of the ARC. The third parameter specifies the mode in which the register can be operated is and it can be one of:
r (readonly)
w (write only)
r|w (read or write)

For example:

            .extAuxRegister mulhi,0x12,w

This specifies an extension auxiliary register called mulhi which is at address 0x12 in the memory space and which is only writable.

.extCondCode suffix,value
The condition codes on the ARCtangent A4 are extensible and can be specified by means of this assembler directive. They are specified by the suffix and the value for the condition code. They can be used to specify extra condition codes with any values. For example:
            .extCondCode is_busy,0x14
             add.is_busy  r1,r2,r3
             bis_busy     _main

.extCoreRegister name,regnum,mode,shortcut
Specifies an extension core register name for the application. This allows a register name with a valid regnum between 0 and 60, with the following as valid values for mode
`r (readonly)'
`w (write only)'
`r|w (read or write)'

The other parameter gives a description of the register having a shortcut in the pipeline. The valid values are:


For example:

            .extCoreRegister mlo,57,r,can_shortcut

This defines an extension core register mlo with the value 57 which can shortcut the pipeline.

.extInstruction name,opcode,subopcode,suffixclass,syntaxclass
The ARCtangent A4 allows the user to specify extension instructions. The extension instructions are not macros. The assembler creates encodings for use of these instructions according to the specification by the user. The parameters are:

For example, defining 64-bit multiplier with immediate operands:

          .extInstruction mp64,0x14,0x0,SUFFIX_COND | SUFFIX_FLAG ,

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.

.half expressions

.long expressions

.option arc|arc5|arc6|arc7|arc8
The .option directive must be followed by the desired core version. Again arc is an alias for arc6.

Note: the .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 (arc6).

.short expressions

.word expressions