| Skip Navigation Links | |
| Exit Print View | |
|
SPARC Assembly Language Reference Manual Oracle Solaris 11.1 Information Library |
2. Executable and Linking Format
3. Directives and Pseudo-Operations
6. Writing Functions -- The SPARC ABI
7. Assembler Inline Functions and __asm Code
7.1 Inline Function Templates in C and C++
7.1.1 Compiling C/C++ with Inline Templates
7.1.2 Layout of Code in Inline Templates
7.1.3 Guidelines for Coding Inline Templates
7.1.5 Compiler Calling Convention
7.1.6 Improving Efficiency of Inlined Functions
7.1.7.1 C++ Inline Templates and Exceptions
A. Using the Assembler Command Line
The Oracle Solaris Studio C and C++ compilers support the __ asm statement:
__asm(string);
__asm{
...block of instructions...
}
The string may be a single assembler instruction, or a block of instructions, as in the following examples:
The statement
__asm("lzd ccx %o0");
does something.
The block of instructions
__asm{
ldd ccx %f0
ldd ccy %f1
fadd %f0 %f1 %f0
st ccz %f0
}
The Oracle Solaris Studio C and C++ compilers also support the GCC Extended ASM Statement syntax. See the GCC compiler documentation at gcc.gnu.org for details.