This chapter provides a general mapping between the Solaris x86 assembly language mnemonics and the Intel or Advanced Micro Devices (AMD) mnemonics.
It is beyond the scope of this manual to document the x86 architecture instruction set. This chapter provides a general mapping between the Solaris x86 assembly language mnemonics and the Intel or AMD mnemonics to enable you to refer to your vendor's documentation for detailed information about a specific instruction. Instructions are grouped by functionality in tables with the following sections:
Solaris mnemonic
Intel/AMD mnemonic
Description (short)
Notes
For certain Solaris mnemonics, the allowed data type suffixes for that mnemonic are indicated in braces ({}) following the mnemonic. For example, bswap{lq} indicates that the following mnemonics are valid: bswap, bswapl (which is the default and equivalent to bswap), and bswapq. See Instructions for information on data type suffixes.
To locate a specific Solaris x86 mnemonic, look up the mnemonic in the index.
The general-purpose instructions perform basic data movement, memory addressing, arithmetic and logical operations, program flow control, input/output, and string operations on integer, pointer, and BCD data types.
The data transfer instructions move data between memory and the general-purpose and segment registers, and perform operations such as conditional moves, stack access, and data conversion.
Table 3–1 Data Transfer Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
BSWAP |
byte swap |
bswapq valid only under -xarch=amd64 |
|
CBW |
convert byte to word | ||
CDQ |
convert doubleword to quadword |
%eax -> %edx:%eax |
|
CDQE |
convert doubleword to quadword |
%eax -> %rax cltq valid only under -xarch=amd64 |
|
CMOVA |
conditional move if above |
cmovaq valid only under -xarch=amd64 |
|
CMOVAE |
conditional move if above or equal |
cmovaeq valid only under -xarch=amd64 |
|
CMOVB |
conditional move if below |
cmovbq valid only under -xarch=amd64 |
|
CMOVBE |
conditional move if below or equal |
cmovbeq valid only under -xarch=amd64 |
|
CMOVC |
conditional move if carry |
cmovcq valid only under -xarch=amd64 |
|
CMOVE |
conditional move if equal |
cmoveq valid only under -xarch=amd64 |
|
CMOVG |
conditional move if greater |
cmovgq valid only under -xarch=amd64 |
|
CMOVGE |
conditional move if greater or equal |
cmovgeq valid only under -xarch=amd64 |
|
CMOVL |
conditional move if less |
cmovlq valid only under -xarch=amd64 |
|
COMVLE |
conditional move if less or equal |
cmovleq valid only under -xarch=amd64 |
|
CMOVNA |
conditional move if not above |
cmovnaq valid only under -xarch=amd64 |
|
CMOVNAE |
conditional move if not above or equal |
cmovnaeq valid only under -xarch=amd64 |
|
CMOVNB |
conditional move if not below |
cmovnbq valid only under -xarch=amd64 |
|
CMOVNBE |
conditional move if not below or equal |
cmovnbeq valid only under -xarch=amd64 |
|
CMOVNC |
conditional move if not carry |
cmovncq valid only under -xarch=amd64 |
|
CMOVNE |
conditional move if not equal |
cmovneq valid only under -xarch=amd64 |
|
CMOVNG |
conditional move if greater |
cmovngq valid only under -xarch=amd64 |
|
CMOVNGE |
conditional move if not greater or equal |
cmovngeq valid only under -xarch=amd64 |
|
CMOVNL |
conditional move if not less |
cmovnlq valid only under -xarch=amd64 |
|
CMOVNLE |
conditional move if not above or equal |
cmovnleq valid only under -xarch=amd64 |
|
CMOVNO |
conditional move if not overflow |
cmovnoq valid only under -xarch=amd64 |
|
CMOVNP |
conditional move if not parity |
cmovnpq valid only under -xarch=amd64 |
|
CMOVNS |
conditional move if not sign (non-negative) |
cmovnsq valid only under -xarch=amd64 |
|
CMOVNZ |
conditional move if not zero |
cmovnzq valid only under -xarch=amd64 |
|
CMOVO |
conditional move if overflow |
cmovoq valid only under -xarch=amd64 |
|
CMOVP |
conditional move if parity |
cmovpq valid only under -xarch=amd64 |
|
CMOVPE |
conditional move if parity even |
cmovpeq valid only under -xarch=amd64 |
|
CMOVPO |
conditional move if parity odd |
cmovpoq valid only under -xarch=amd64 |
|
CMOVS |
conditional move if sign (negative) |
cmovsq valid only under -xarch=amd64 |
|
CMOVZ |
conditional move if zero |
cmovzq valid only under -xarch=amd64 |
|
CMPXCHG |
compare and exchange |
cmpxchgq valid only under -xarch=amd64 |
|
CMPXCHG8B |
compare and exchange 8 bytes | ||
CQO |
convert quadword to octword |
%rax -> %rdx:%rax cqtd valid only under -xarch=amd64 |
|
CQO |
convert quadword to octword |
%rax -> %rdx:%rax cqto valid only under -xarch=amd64 |
|
CWD |
convert word to doubleword |
%ax -> %dx:%ax |
|
CWDE |
convert word to doubleword in %eax register |
%ax -> %eax |
|
MOV |
move data between immediate values, general purpose registers, segment registers, and memory |
movq valid only under -xarch=amd64 |
|
MOVABS |
move immediate value to register |
movabs valid only under -xarch=amd64 |
|
MOVABS |
move immediate value to register {AL, AX, GAX, RAX} |
movabs valid only under -xarch=amd64 |
|
MOVSX |
move and sign extend |
movsbq and movswq valid only under -xarch=amd64 |
|
MOVZX |
move and zero extend |
movzbq and movzwq valid only under -xarch=amd64 |
|
POP |
pop stack |
popq valid only under -xarch=amd64 |
|
POPA |
pop general-purpose registers from stack |
popaw invalid under -xarch=amd64 |
|
POPAD |
pop general-purpose registers from stack |
invalid under -xarch=amd64 |
|
PUSH |
push onto stack |
pushq valid only under -xarch=amd64 |
|
PUSHA |
push general-purpose registers onto stack |
pushaw invalid under -xarch=amd64 |
|
PUSHAD |
push general-purpose registers onto stack |
invalid under -xarch=amd64 |
|
XADD |
exchange and add |
xaddq valid only under -xarch=amd64 |
|
XCHG |
exchange |
xchgq valid only under -xarch=amd64 |
|
XCHG |
exchange |
xchgqA valid only under -xarch=amd64 |
The binary arithmetic instructions perform basic integer computions on operands in memory or the general-purpose registers.
Table 3–2 Binary Arithmetic Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ADC |
add with carry |
adcq valid only under -xarch=amd64 |
|
ADD |
integer add |
addq valid only under -xarch=amd64 |
|
CMP |
compare |
cmpq valid only under -xarch=amd64 |
|
DEC |
decrement |
decq valid only under -xarch=amd64 |
|
DIV |
divide (unsigned) |
divq valid only under -xarch=amd64 |
|
IDIV |
divide (signed) |
idivq valid only under -xarch=amd64 |
|
IMUL |
multiply (signed) |
imulq valid only under -xarch=amd64 |
|
INC |
increment |
incq valid only under -xarch=amd64 |
|
MUL |
multiply (unsigned) |
mulq valid only under -xarch=amd64 |
|
NEG |
negate |
negq valid only under -xarch=amd64 |
|
SBB |
subtract with borrow |
sbbq valid only under -xarch=amd64 |
|
SUB |
subtract |
subq valid only under -xarch=amd64 |
The decimal arithmetic instructions perform decimal arithmetic on binary coded decimal (BCD) data.
Table 3–3 Decimal Arithmetic Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
AAA |
ASCII adjust after addition |
invalid under -xarch=amd64 |
|
AAD |
ASCII adjust before division |
invalid under -xarch=amd64 |
|
AAM |
ASCII adjust after multiplication |
invalid under -xarch=amd64 |
|
AAS |
ASCII adjust after subtraction |
invalid under -xarch=amd64 |
|
DAA |
decimal adjust after addition |
invalid under -xarch=amd64 |
|
DAS |
decimal adjust after subtraction |
invalid under -xarch=amd64 |
The logical instructions perform basic logical operations on their operands.
Table 3–4 Logical Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
AND |
bitwise logical AND |
andq valid only under -xarch=amd64 |
|
NOT |
bitwise logical NOT |
notq valid only under -xarch=amd64 |
|
OR |
bitwise logical OR |
orq valid only under -xarch=amd64 |
|
XOR |
bitwise logical exclusive OR |
xorq valid only under -xarch=amd64 |
The shift and rotate instructions shift and rotate the bits in their operands.
Table 3–5 Shift and Rotate Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
RCL |
rotate through carry left |
rclq valid only under -xarch=amd64 |
|
RCR |
rotate through carry right |
rcrq valid only under -xarch=amd64 |
|
ROL |
rotate left |
rolq valid only under -xarch=amd64 |
|
ROR |
rotate right |
rorq valid only under -xarch=amd64 |
|
SAL |
shift arithmetic left |
salq valid only under -xarch=amd64 |
|
SAR |
shift arithmetic right |
sarq valid only under -xarch=amd64 |
|
SHL |
shift logical left |
shlq valid only under -xarch=amd64 |
|
SHLD |
shift left double |
shldq valid only under -xarch=amd64 |
|
SHR |
shift logical right |
shrq valid only under -xarch=amd64 |
|
SHRD |
shift right double |
shrdq valid only under -xarch=amd64 |
The bit instructions test and modify individual bits in operands. The byte instructions set the value of a byte operand to indicate the status of flags in the %eflags register.
Table 3–6 Bit and Byte Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
BSF |
bit scan forward |
bsfq valid only under -xarch=amd64 |
|
BSR |
bit scan reverse |
bsrq valid only under -xarch=amd64 |
|
BT |
bit test |
btq valid only under -xarch=amd64 |
|
BTC |
bit test and complement |
btcq valid only under -xarch=amd64 |
|
BTR |
bit test and reset |
btrq valid only under -xarch=amd64 |
|
BTS |
bit test and set |
btsq valid only under -xarch=amd64 |
|
SETA |
set byte if above | ||
SETAE |
set byte if above or equal | ||
SETB |
set byte if below | ||
SETBE |
set byte if below or equal | ||
SETC |
set byte if carry | ||
SETE |
set byte if equal | ||
SETG |
set byte if greater | ||
SETGE |
set byte if greater or equal | ||
SETL |
set byte if less | ||
SETLE |
set byte if less or equal | ||
SETNA |
set byte if not above | ||
SETNAE |
set byte if not above or equal | ||
SETNB |
set byte if not below | ||
SETNBE |
set byte if not below or equal | ||
SETNC |
set byte if not carry | ||
SETNE |
set byte if not equal | ||
SETNG |
set byte if not greater | ||
SETNGE |
set byte if not greater or equal | ||
SETNL |
set byte if not less | ||
SETNLE |
set byte if not less or equal | ||
SETNO |
set byte if not overflow | ||
SETNP |
set byte if not parity | ||
SETNS |
set byte if not sign (non-negative) | ||
SETNZ |
set byte if not zero | ||
SETO |
set byte if overflow | ||
SETP |
set byte if parity | ||
SETPE |
set byte if parity even | ||
SETPO |
set byte if parity odd | ||
SETS |
set byte if sign (negative) | ||
SETZ |
set byte if zero | ||
test{bwlq} |
logical compare |
testq valid only under -xarch=amd64 |
The control transfer instructions control the flow of program execution.
Table 3–7 Control Transfer Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
BOUND |
detect value out of range |
boundw invalid under -xarch=amd64 |
|
CALL |
call procedure | ||
ENTER |
high-level procedure entry | ||
INT |
software interrupt | ||
INTO |
interrupt on overflow |
invalid under -xarch=amd64 |
|
IRET |
return from interrupt | ||
JA |
jump if above | ||
JAE |
jump if above or equal | ||
JB |
jump if below | ||
JBE |
jump if below or equal | ||
JC |
jump if carry | ||
JCXZ |
jump register %cx zero | ||
JE |
jump if equal | ||
JECXZ |
jump register %ecx zero |
invalid under -xarch=amd64 |
|
JG |
jump if greater | ||
JGE |
jump if greater or equal | ||
JL |
jump if less | ||
JLE |
jump if less or equal | ||
JMP |
jump | ||
JNAE |
jump if not above or equal | ||
JNB |
jump if not below | ||
JNBE |
jump if not below or equal | ||
JNC |
jump if not carry | ||
JNE |
jump if not equal | ||
JNG |
jump if not greater | ||
JNGE |
jump if not greater or equal | ||
JNL |
jump if not less | ||
JNLE |
jump if not less or equal | ||
JNO |
jump if not overflow | ||
JNP |
jump if not parity | ||
JNS |
jump if not sign (non-negative) | ||
JNZ |
jump if not zero | ||
JO |
jump if overflow | ||
JP |
jump if parity | ||
JPE |
jump if parity even | ||
JPO |
jump if parity odd | ||
JS |
jump if sign (negative) | ||
JZ |
jump if zero |
|
|
CALL |
call far procedure |
valid as indirect only for -xarg=amd64 |
|
LEAVE |
high-level procedure exit | ||
LOOP |
loop with %ecx counter | ||
LOOPE |
loop with %ecx and equal | ||
LOOPNE |
loop with %ecx and not equal | ||
LOOPNZ |
loop with %ecx and not zero | ||
LOOPZ |
loop with %ecx and zero | ||
RET |
return from far procedure |
valid as indirect only for -xarg=amd64 |
|
RET |
return |
The string instructions operate on strings of bytes. Operations include storing strings in memory, loading strings from memory, comparing strings, and scanning strings for substrings.
The Solaris mnemonics for certain instructions differ slightly from the Intel/AMD mnemonics. Alphabetization of the table below is by the Solaris mnemonic. All string operations default to long (doubleword).
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CMPS |
compare string |
cmpsq valid only under -xarch=amd64 |
|
CMPSB |
compare byte string | ||
CMPSD |
compare doubleword string | ||
CMPSW |
compare word string | ||
LODS |
load string |
lodsq valid only under -xarch=amd64 |
|
LODSB |
load byte string | ||
LODSD |
load doubleword string | ||
LODSW |
load word string | ||
MOVS |
move string |
movsq valid only under -xarch=amd64 |
|
MOVSB |
move byte string |
movsb is not movsb{wlq}. See Table 3–1 |
|
MOVSD |
move doubleword string | ||
MOVSW |
move word string |
movsw is not movsw{lq}. See Table 3–1 |
|
REP |
repeat while %ecx not zero | ||
REPNE |
repeat while not equal | ||
repnz |
REPNZ |
repeat while not zero | |
REPE |
repeat while equal | ||
repz |
REPZ |
repeat while zero | |
SCAS |
scan string |
scasq valid only under -xarch=amd64 |
|
SCASB |
scan byte string | ||
SCASD |
scan doubleword string | ||
SCASW |
scan word string | ||
STOS |
store string |
stosq valid only under -xarch=amd64 |
|
STOSB |
store byte string | ||
STOSD |
store doubleword string | ||
STOSW |
store word string |
The input/output instructions transfer data between the processor's I/O ports, registers, and memory.
Table 3–9 I/O Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
IN |
read from a port | ||
INS |
input string from a port | ||
INSB |
input byte string from port | ||
INSD |
input doubleword string from port | ||
INSW |
input word string from port | ||
OUT |
write to a port | ||
OUTS |
output string to port | ||
OUTSB |
output byte string to port | ||
OUTSD |
output doubleword string to port | ||
OUTSW |
output word string to port |
The status flag control instructions operate on the bits in the %eflags register.
Table 3–10 Flag Control Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CLC |
clear carry flag | ||
CLD |
clear direction flag | ||
CLI |
clear interrupt flag | ||
CMC |
complement carry flag | ||
LAHF |
load flags into %ah register | ||
POPF |
pop %eflags from stack | ||
POPFL |
pop %eflags from stack |
popfq valid only under -xarch=amd64 |
|
PUSHF |
push %eflags onto stack | ||
PUSHFL |
push %eflags onto stack |
pushfq valid only under -xarch=amd64 |
|
SAHF |
store %ah register into flags | ||
STC |
set carry flag | ||
STD |
set direction flag | ||
STI |
set interrupt flag |
The segment register instructions load far pointers (segment addresses) into the segment registers.
Table 3–11 Segment Register Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
LDS |
load far pointer using %ds |
ldsl and ldsw invalid under -xarch=amd64 |
|
LES |
load far pointer using %es |
lesl and lesw invalid under -xarch=amd64 |
|
LFS |
load far pointer using %fs | ||
LGS |
load far pointer using %gs | ||
LSS |
load far pointer using %ss |
The instructions documented in this section provide a number of useful functions.
Table 3–12 Miscellaneous Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
cpuid |
CPUID |
processor identification | |
lea{wlq} |
LEA |
load effective address |
leaq valid only under -xarch=amd64 |
nop |
NOP |
no operation | |
ud2 |
UD2 |
undefined instruction | |
xlat |
XLAT |
table lookup translation | |
xlatb |
XLATB |
table lookup translation |
The floating point instructions operate on floating-point, integer, and binary coded decimal (BCD) operands.
The data transfer instructions move floating-point, integer, and BCD values between memory and the floating point registers.
Table 3–13 Data Transfer Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FBLD |
load BCD | ||
FBSTP |
store BCD and pop | ||
FCMOVB |
floating-point conditional move if below | ||
FCMOVBE |
floating-point conditional move if below or equal | ||
FCMOVE |
floating-point conditional move if equal | ||
FCMOVNB |
floating-point conditional move if not below | ||
FCMOVNBE |
floating-point conditional move if not below or equal | ||
FCMOVNE |
floating-point conditional move if not equal | ||
FCMOVNU |
floating-point conditional move if unordered | ||
FCMOVU |
floating-point conditional move if unordered | ||
FILD |
load integer | ||
FIST |
store integer | ||
FISTP |
store integer and pop | ||
FLD |
load floating-point value | ||
FST |
store floating-point value | ||
FSTP |
store floating-point value and pop | ||
FXCH |
exchange registers |
The basic arithmetic instructions perform basic arithmetic operations on floating-point and integer operands.
Table 3–14 Basic Arithmetic Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FABS |
absolute value | ||
FADD |
add floating-point | ||
FADDP |
add floating-point and pop | ||
FCHS |
change sign | ||
FDIV |
divide floating-point | ||
FDIVP |
divide floating-point and pop | ||
FDIVR |
divide floating-point reverse | ||
FDIVRP |
divide floating-point reverse and pop | ||
FIADD |
add integer | ||
FIDIV |
divide integer | ||
FIDIVR |
divide integer reverse | ||
FIMUL |
multiply integer | ||
FISUB |
subtract integer | ||
FISUBR |
subtract integer reverse | ||
FMUL |
multiply floating-point | ||
FMULP |
multiply floating-point and pop | ||
FPREM |
partial remainder | ||
FPREM1 |
IEEE partial remainder | ||
FRNDINT |
round to integer | ||
FSCALE |
scale by power of two | ||
FSQRT |
square root | ||
FSUB |
subtract floating-point | ||
FSUBP |
subtract floating-point and pop | ||
FSUBR |
subtract floating-point reverse | ||
FSUBRP |
subtract floating-point reverse and pop | ||
FXTRACT |
extract exponent and significand |
The floating-point comparison instructions operate on floating-point or integer operands.
Table 3–15 Comparison Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FCOM |
compare floating-point | ||
FCOMI |
compare floating-point and set %eflags | ||
FCOMIP |
compare floating-point, set %eflags, and pop | ||
FCOMP |
compare floating-point and pop | ||
FCOMPP |
compare floating-point and pop twice | ||
FICOM |
compare integer | ||
FICOMP |
compare integer and pop | ||
FTST |
test floating-point (compare with 0.0) | ||
FUCOM |
unordered compare floating-point | ||
FUCOMI |
unordered compare floating-point and set %eflags | ||
FUCOMIP |
unordered compare floating-point, set %eflags, and pop | ||
FUCOMP |
unordered compare floating-point and pop | ||
FUCOMPP |
compare floating-point and pop twice | ||
FXAM |
examine floating-point |
The transcendental instructions perform trigonometric and logarithmic operations on floating-point operands.
Table 3–16 Transcendental Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
F2XM1 |
computes 2x-1 | ||
FCOS |
cosine | ||
FPATAN |
partial arctangent | ||
FPTAN |
partial tangent | ||
FSIN |
sine | ||
FSINCOS |
sine and cosine | ||
FYL2X |
computes y * log2x | ||
FYL2XP1 |
computes y * log2(x+1) |
The load constants instructions load common constants, such as Ļ, into the floating-point registers.
Table 3–17 Load Constants Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FLD1 |
load +1.0 | ||
FLDL2E |
load log2e | ||
FLDL2T |
load log210 | ||
FLDLG2 |
load log102 | ||
FLDLN2 |
load loge2 | ||
FLDPI |
load Ļ | ||
FLDZ |
load +0.0 |
The floating-point control instructions operate on the floating-point register stack and save and restore the floating-point state.
Table 3–18 Control Instructions (Floating-Point)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FCLEX |
clear floating-point exception flags after checking for error conditions | ||
FDECSTP |
decrement floating-point register stack pointer | ||
FFREE |
free floating-point register | ||
FINCSTP |
increment floating-point register stack pointer | ||
FINIT |
initialize floating-point unit after checking error conditions | ||
FLDCW |
load floating-point unit control word | ||
FLDENV |
load floating-point unit environment | ||
FNCLEX |
clear floating-point exception flags without checking for error conditions | ||
FNINIT |
initialize floating-point unit without checking error conditions | ||
FNOP |
floating-point no operation | ||
FNSAVE |
save floating-point unit state without checking error conditions | ||
FNSTCW |
store floating-point unit control word without checking error conditions | ||
FNSTENV |
store floating-point unit environment without checking error conditions | ||
FNSTSW |
store floating-point unit status word without checking error conditions | ||
FRSTOR |
restore floating-point unit state | ||
FSAVE |
save floating-point unit state after checking error conditions | ||
FSTCW |
store floating-point unit control word after checking error conditions | ||
FSTENV |
store floating-point unit environment after checking error conditions | ||
FSTSW |
store floating-point unit status word after checking error conditions | ||
FWAIT |
wait for floating-point unit | ||
WAIT |
wait for floating-point unit |
The fxsave and fxrstor instructions save and restore the state of the floating-point unit and the MMX, XMM, and MXCSR registers.
Table 3–19 SIMD State Management Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
FXRSTOR |
restore floating-point unit and SIMD state | ||
FXSAVE |
save floating-point unit and SIMD state |
The MMX instructions enable x86 processors to perform single-instruction, multiple-data(SIMD) operations on packed byte, word, doubleword, or quadword integer operands contained in memory, in MMX registers, or in general-purpose registers.
The data transfer instructions move doubleword and quadword operands between MMX registers and between MMX registers and memory.
Table 3–20 Data Transfer Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
MOVD |
move doubleword |
movdq valid only under -xarch=amd64 |
|
MOVQ |
move quadword |
valid only under -xarch=amd64 |
The conversion instructions pack and unpack bytes, words, and doublewords.
Table 3–21 Conversion Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
PACKSSDW |
pack doublewords into words with signed saturation | ||
PACKSSWB |
pack words into bytes with signed saturation | ||
PACKUSWB |
pack words into bytes with unsigned saturation | ||
PUNPCKHBW |
unpack high-order bytes | ||
PUNPCKHDQ |
unpack high-order doublewords | ||
PUNPCKHWD |
unpack high-order words | ||
PUNPCKLBW |
unpack low-order bytes | ||
PUNPCKLDQ |
unpack low-order doublewords | ||
PUNPCKLWD |
unpack low-order words |
The packed arithmetic instructions perform packed integer arithmetic on packed byte, word, and doubleword integers.
Table 3–22 Packed Arithmetic Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
PADDB |
add packed byte integers | ||
PADDD |
add packed doubleword integers | ||
PADDSB |
add packed signed byte integers with signed saturation | ||
PADDSW |
add packed signed word integers with signed saturation | ||
PADDUSB |
add packed unsigned byte integers with unsigned saturation | ||
PADDUSW |
add packed unsigned word integers with unsigned saturation | ||
PADDW |
add packed word integers | ||
PMADDWD |
multiply and add packed word integers | ||
PMULHW |
multiply packed signed word integers and store high result | ||
PMULLW |
multiply packed signed word integers and store low result | ||
PSUBB |
subtract packed byte integers | ||
PSUBD |
subtract packed doubleword integers | ||
PSUBSB |
subtract packed signed byte integers with signed saturation | ||
PSUBSW |
subtract packed signed word integers with signed saturation | ||
PSUBUSB |
subtract packed unsigned byte integers with unsigned saturation | ||
PSUBUSW |
subtract packed unsigned word integers with unsigned saturation | ||
PSUBW |
subtract packed word integers |
The compare instructions compare packed bytes, words, or doublewords.
Table 3–23 Comparison Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
PCMPEQB |
compare packed bytes for equal | ||
PCMPEQD |
compare packed doublewords for equal | ||
PCMPEQW |
compare packed words for equal | ||
PCMPGTB |
compare packed signed byte integers for greater than | ||
PCMPGTD |
compare packed signed doubleword integers for greater than | ||
PCMPGTW |
compare packed signed word integers for greater than |
The logical instructions perform logical operations on quadword operands.
Table 3–24 Logical Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
PAND |
bitwise logical AND | ||
PANDN |
bitwise logical AND NOT | ||
POR |
bitwise logical OR | ||
PXOR |
bitwise logical XOR |
The shift and rotate instructions operate on packed bytes, words, doublewords, or quadwords in 64–bit operands.
Table 3–25 Shift and Rotate Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
pslld |
PSLLD |
shift packed doublewords left logical | |
psllq |
PSLLQ |
shift packed quadword left logical | |
psllw |
PSLLW |
shift packed words left logical | |
psrad |
PSRAD |
shift packed doublewords right arithmetic | |
psraw |
PSRAW |
shift packed words right arithmetic | |
psrld |
PSRLD |
shift packed doublewords right logical | |
psrlq |
PSRLQ |
shift packed quadword right logical | |
psrlw |
PSRLW |
shift packed words right logical |
The emms (EMMS) instruction clears the MMX state from the MMX registers.
Table 3–26 State Management Instructions (MMX)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
emms |
EMMS |
empty MMX state |
SSE instructions are an extension of the SIMD execution model introduced with the MMX technology. SSE instructions are divided into four subgroups:
SIMD single-precision floating-point instructions that operate on the XMM registers
MXSCR state management instructions
64–bit SIMD integer instructions that operate on the MMX registers
Instructions that provide cache control, prefetch, and instruction ordering functionality
The SSE SIMD instructions operate on packed and scalar single-precision floating-point values located in the XMM registers or memory.
The SSE data transfer instructions move packed and scalar single-precision floating-point operands between XMM registers and between XMM registers and memory.
Table 3–27 Data Transfer Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
MOVAPS |
move four aligned packed single-precision floating-point values between XMM registers or memory | ||
MOVHLPS |
move two packed single-precision floating-point values from the high quadword of an XMM register to the low quadword of another XMM register | ||
MOVHPS |
move two packed single-precision floating-point values to or from the high quadword of an XMM register or memory | ||
MOVLHPS |
move two packed single-precision floating-point values from the low quadword of an XMM register to the high quadword of another XMM register | ||
MOVLPS |
move two packed single-precision floating-point values to or from the low quadword of an XMM register or memory | ||
MOVMSKPS |
extract sign mask from four packed single-precision floating-point values | ||
MOVSS |
move scalar single-precision floating-point value between XMM registers or memory | ||
MOVUPS |
move four unaligned packed single-precision floating-point values between XMM registers or memory |
SSE packed arithmetic instructions perform packed and scalar arithmetic operations on packed and scalar single-precision floating-point operands.
Table 3–28 Packed Arithmetic Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ADDPS |
add packed single-precision floating-point values | ||
ADDSS |
add scalar single-precision floating-point values | ||
DIVPS |
divide packed single-precision floating-point values | ||
DIVSS |
divide scalar single-precision floating-point values | ||
MAXPS |
return maximum packed single-precision floating-point values | ||
MAXSS |
return maximum scalar single-precision floating-point values | ||
MINPS |
return minimum packed single-precision floating-point values | ||
MINSS |
return minimum scalar single-precision floating-point values. | ||
MULPS |
multiply packed single-precision floating-point values | ||
MULSS |
multiply scalar single-precision floating-point values | ||
RCPPS |
compute reciprocals of packed single-precision floating-point values | ||
RCPSS |
compute reciprocal of scalar single-precision floating-point values | ||
RSQRTPS |
compute reciprocals of square roots of packed single-precision floating-point values | ||
RSQRTSS |
compute reciprocal of square root of scalar single-precision floating-point values | ||
SQRTPS |
compute square roots of packed single-precision floating-point values | ||
SQRTSS |
compute square root of scalar single-precision floating-point values | ||
SUBPS |
subtract packed single-precision floating-point values | ||
SUBSS |
subtract scalar single-precision floating-point values |
The SEE compare instructions compare packed and scalar single-precision floating-point operands.
Table 3–29 Comparison Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CMPPS |
compare packed single-precision floating-point values | ||
CMPSS |
compare scalar single-precision floating-point values | ||
COMISS |
perform ordered comparison of scalar single-precision floating-point values and set flags in EFLAGS register | ||
UCOMISS |
perform unordered comparison of scalar single-precision floating-point values and set flags in EFLAGS register |
The SSE logical instructions perform bitwise AND, AND NOT, OR, and XOR operations on packed single-precision floating-point operands.
Table 3–30 Logical Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ANDNPS |
perform bitwise logical AND NOT of packed single-precision floating-point values | ||
ANDPS |
perform bitwise logical AND of packed single-precision floating-point values | ||
ORPS |
perform bitwise logical OR of packed single-precision floating-point values | ||
XORPS |
perform bitwise logical XOR of packed single-precision floating-point values |
The SSE shuffle and unpack instructions shuffle or interleave single-precision floating-point values in packed single-precision floating-point operands.
Table 3–31 Shuffle and Unpack Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
SHUFPS |
shuffles values in packed single-precision floating-point operands | ||
UNPCKHPS |
unpacks and interleaves the two high-order values from two single-precision floating-point operands | ||
UNPCKLPS |
unpacks and interleaves the two low-order values from two single-precision floating-point operands |
The SSE conversion instructions convert packed and individual doubleword integers into packed and scalar single-precision floating-point values.
Table 3–32 Conversion Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CVTPI2PS |
convert packed doubleword integers to packed single-precision floating-point values | ||
CVTPS2PI |
convert packed single-precision floating-point values to packed doubleword integers | ||
CVTSI2SS |
convert doubleword integer to scalar single-precision floating-point value | ||
CVTSS2SI |
convert scalar single-precision floating-point value to a doubleword integer | ||
CVTTPS2PI |
convert with truncation packed single-precision floating-point values to packed doubleword integers | ||
CVTTSS2SI |
convert with truncation scalar single-precision floating-point value to scalar doubleword integer |
The MXCSR state management instructions save and restore the state of the MXCSR control and status register.
Table 3–33 MXCSR State Management Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
LDMXCSR |
load %mxcsr register | ||
STMXCSR |
save %mxcsr register state |
The SSE 64–bit SIMD integer instructions perform operations on packed bytes, words, or doublewords in MMX registers.
Table 3–34 64–Bit SIMD Integer Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
PAVGB |
compute average of packed unsigned byte integers | ||
PAVGW |
compute average of packed unsigned byte integers | ||
PEXTRW |
extract word | ||
PINSRW |
insert word | ||
PMAXSW |
maximum of packed signed word integers | ||
PMAXUB |
maximum of packed unsigned byte integers | ||
PMINSW |
minimum of packed signed word integers | ||
PMINUB |
minimum of packed unsigned byte integers | ||
PMOVMSKB |
move byte mask | ||
PMULHUW |
multiply packed unsigned integers and store high result | ||
PSADBW |
compute sum of absolute differences | ||
PSHUFW |
shuffle packed integer word in MMX register |
The following instructions control caching, prefetching, and instruction ordering.
Table 3–35 Miscellaneous Instructions (SSE)
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
MASKMOVQ |
non-temporal store of selected bytes from an MMX register into memory | ||
MOVNTPS |
non-temporal store of four packed single-precision floating-point values from an XMM register into memory | ||
MOVNTQ |
non-temporal store of quadword from an MMX register into memory | ||
PREFETCHNTA |
prefetch data into non-temporal cache structure and into a location close to the processor | ||
PREFETCHT0 |
prefetch data into all levels of the cache hierarchy | ||
PREFETCHT1 |
prefetch data into level 2 cache and higher | ||
PREFETCHT2 |
prefetch data into level 2 cache and higher | ||
SFENCE |
serialize store operations |
SSE2 instructions are an extension of the SIMD execution model introduced with the MMX technology and the SSE extensions. SSE2 instructions are divided into four subgroups:
Packed and scalar double-precision floating-point instructions
Packed single-precision floating-point conversion instructions
128–bit SIMD integer instructions
Instructions that provide cache control and instruction ordering functionality
The SSE2 packed and scalar double-precision floating-point instructions operate on double-precision floating-point operands.
The SSE2 data movement instructions move double-precision floating-point data between XMM registers and memory.
Table 3–36 SSE2 Data Movement Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
MOVAPD |
move two aligned packed double-precision floating-point values between XMM registers and memory | ||
MOVHPD |
move high packed double-precision floating-point value to or from the high quadword of an XMM register and memory | ||
MOVLPD |
move low packed single-precision floating-point value to or from the low quadword of an XMM register and memory | ||
MOVMSKPD |
extract sign mask from two packed double-precision floating-point values | ||
MOVSD |
move scalar double-precision floating-point value between XMM registers and memory. | ||
MOVUPD |
move two unaligned packed double-precision floating-point values between XMM registers and memory |
The SSE2 arithmetic instructions operate on packed and scalar double-precision floating-point operands.
Table 3–37 SSE2 Packed Arithmetic Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ADDPD |
add packed double-precision floating-point values | ||
ADDSD |
add scalar double-precision floating-point values | ||
DIVPD |
divide packed double-precision floating-point values | ||
DIVSD |
divide scalar double-precision floating-point values | ||
MAXPD |
return maximum packed double-precision floating-point values | ||
MAXSD |
return maximum scalar double-precision floating-point value | ||
MINPD |
return minimum packed double-precision floating-point values | ||
MINSD |
return minimum scalar double-precision floating-point value | ||
MULPD |
multiply packed double-precision floating-point values | ||
MULSD |
multiply scalar double-precision floating-point values | ||
SQRTPD |
compute packed square roots of packed double-precision floating-point values | ||
SQRTSD |
compute scalar square root of scalar double-precision floating-point value | ||
SUBPD |
subtract packed double-precision floating-point values | ||
SUBSD |
subtract scalar double-precision floating-point values |
The SSE2 logical instructions operate on packed double-precision floating-point values.
Table 3–38 SSE2 Logical Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ANDNPD |
perform bitwise logical AND NOT of packed double-precision floating-point values | ||
ANDPD |
perform bitwise logical AND of packed double-precision floating-point values | ||
ORPD |
perform bitwise logical OR of packed double-precision floating-point values | ||
XORPD |
perform bitwise logical XOR of packed double-precision floating-point values |
The SSE2 compare instructions compare packed and scalar double-precision floating-point values and return the results of the comparison to either the destination operand or to the EFLAGS register.
Table 3–39 SSE2 Compare Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CMPPD |
compare packed double-precision floating-point values | ||
CMPSD |
compare scalar double-precision floating-point values | ||
COMISD |
perform ordered comparison of scalar double-precision floating-point values and set flags in EFLAGS register | ||
UCOMISD |
perform unordered comparison of scalar double-precision floating-point values and set flags in EFLAGS register |
The SSE2 shuffle and unpack instructions operate on packed double-precision floating-point operands.
Table 3–40 SSE2 Shuffle and Unpack Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
SHUFPD |
shuffle values in packed double-precision floating-point operands | ||
UNPCKHPD |
unpack and interleave the high values from two packed double-precision floating-point operands | ||
UNPCKLPD |
unpack and interleave the low values from two packed double-precision floating-point operands |
The SSE2 conversion instructions convert packed and individual doubleword integers into packed and scalar double-precision floating-point values (and vice versa). These instructions also convert between packed and scalar single-precision and double-precision floating-point values.
Table 3–41 SSE2 Conversion Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CVTDQ2PD |
convert packed doubleword integers to packed double-precision floating-point values | ||
CVTPD2DQ |
convert packed double-precision floating-point values to packed doubleword integers | ||
CVTPD2PI |
convert packed double-precision floating-point values to packed doubleword integers | ||
CVTPD2PS |
convert packed double-precision floating-point values to packed single-precision floating-point values | ||
CVTPI2PD |
convert packed doubleword integers to packed double-precision floating-point values | ||
CVTPS2PD |
convert packed single-precision floating-point values to packed double-precision floating-point values | ||
CVTSD2SI |
convert scalar double-precision floating-point values to a doubleword integer | ||
CVTSD2SS |
convert scalar double-precision floating-point values to scalar single-precision floating-point values | ||
CVTSI2SD |
convert doubleword integer to scalar double-precision floating-point value | ||
CVTSS2SD |
convert scalar single-precision floating-point values to scalar double-precision floating-point values | ||
CVTTPD2DQ |
convert with truncation packed double-precision floating-point values to packed doubleword integers | ||
CVTTPD2PI |
convert with truncation packed double-precision floating-point values to packed doubleword integers | ||
CVTTSD2SI |
convert with truncation scalar double-precision floating-point values to scalar doubleword integers |
The SSE2 packed single-precision floating-point instructions operate on single-precision floating-point and integer operands.
Table 3–42 SSE2 Packed Single-Precision Floating-Point Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CVTDQ2PS |
convert packed doubleword integers to packed single-precision floating-point values | ||
CVTPS2DQ |
convert packed single-precision floating-point values to packed doubleword integers | ||
CVTTPS2DQ |
convert with truncation packed single-precision floating-point values to packed doubleword integers |
The SSE2 SIMD integer instructions operate on packed words, doublewords, and quadwords contained in XMM and MMX registers.
Table 3–43 SSE2 128–Bit SIMD Integer Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
MOVDQ2Q |
move quadword integer from XMM to MMX registers | ||
MOVDQA |
move aligned double quadword | ||
MOVDQU |
move unaligned double quadword | ||
MOVQ2DQ |
move quadword integer from MMX to XMM registers | ||
PADDQ |
add packed quadword integers | ||
PMULUDQ |
multiply packed unsigned doubleword integers | ||
PSHUFD |
shuffle packed doublewords | ||
PSHUFHW |
shuffle packed high words | ||
PSHUFLW |
shuffle packed low words | ||
PSLLDQ |
shift double quadword left logical | ||
PSRLDQ |
shift double quadword right logical | ||
PSUBQ |
subtract packed quadword integers | ||
PUNPCKHQDQ |
unpack high quadwords | ||
PUNPCKLQDQ |
unpack low quadwords |
The SSE2 instructions described below provide additional functionality for caching non-temporal data when storing data from XMM registers to memory, and provide additional control of instruction ordering on store operations.
Table 3–44 SSE2 Miscellaneous Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
CLFLUSH |
flushes and invalidates a memory operand and its associated cache line from all levels of the processor's cache hierarchy | ||
LFENCE |
serializes load operations | ||
MASKMOVDQU |
non-temporal store of selected bytes from an XMM register into memory | ||
MFENCE |
serializes load and store operations | ||
MOVNTDQ |
non-temporal store of double quadword from an XMM register into memory | ||
MOVNTI |
non-temporal store of a doubleword from a general-purpose register into memory |
movntiq valid only under -xarch=amd64 |
|
MOVNTPD |
non-temporal store of two packed double-precision floating-point values from an XMM register into memory | ||
PAUSE |
improves the performance of spin-wait loops |
The operating system support instructions provide functionality for process management, performance monitoring, debugging, and other systems tasks.
Table 3–45 Operating System Support Instructions
Solaris Mnemonic |
Intel/AMD Mnemonic |
Description |
Notes |
---|---|---|---|
ARPL |
adjust requested privilege level | ||
CLTS |
clear the task-switched flag | ||
HLT |
halt processor | ||
INVD |
invalidate cache, no writeback | ||
INVLPG |
invalidate TLB entry | ||
LAR |
load access rights |
larq valid only under -xarch=amd64 |
|
LGDT |
load global descriptor table (GDT) register | ||
LIDT |
load interrupt descriptor table (IDT) register | ||
LLDT |
load local descriptor table (LDT) register | ||
LMSW |
load machine status word | ||
LOCK |
lock bus | ||
LSL |
load segment limit |
lslq valid only under -xarch=amd64 |
|
LTR |
load task register | ||
RDMSR |
read model-specific register | ||
RDPMC |
read performance monitoring counters | ||
RDTSC |
read time stamp counter | ||
RSM |
return from system management mode (SMM) | ||
SGDT |
store global descriptor table (GDT) register | ||
SIDT |
store interrupt descriptor table (IDT) register | ||
SLDT |
store local descriptor table (LDT) register |
sldtq valid only under -xarch=amd64 |
|
SMSW |
store machine status word |
smswq valid only under -xarch=amd64 |
|
STR |
store task register |
strq valid only under -xarch=amd64 |
|
SYSENTER |
fast system call, transfers to a flat protected model kernel at CPL=0 | ||
SYSEXIT |
fast system call, transfers to a flat protected mode kernal at CPL=3 | ||
VERR |
verify segment for reading | ||
VERW |
verify segment for writing | ||
WBINVD |
invalidate cache, with writeback | ||
WRMSR |
write model-specific register |
To assemble code for the AMD Opteron CPU, invoke the assembler with the -xarch=amd64 command line option. See the as(1) man page for additional information.
The following Solaris mnemonics are only valid when the -xarch=amd64 command line option is specified:
adcq |
cmovnoq |
mulq |
addq |
cmovnpq |
negq |
andq |
cmovnsq |
notq |
bsfq |
cmovnzq |
orq |
bsrq |
cmovoq |
popfq |
bswapq |
cmovpeq |
popq |
btcq |
cmovpoq |
pushfq |
btq |
cmovpq |
pushq |
btrq |
cmovsq |
rclq |
btsq |
cmovzq |
rcrq |
cltq |
cmpq |
rolq |
cmovaeq |
cmpsq |
rorq |
cmovaq |
cmpxchgq |
salq |
cmovbeq |
cqtd |
sarq |
cmovbq |
cqto |
sbbq |
cmovcq |
decq |
scasq |
cmoveq |
divq |
shldq |
cmovgeq |
idivq |
shlq |
cmovgq |
imulq |
shrdq |
cmovleq |
incq |
shrq |
cmovlq |
larq |
sldtq |
cmovnaeq |
leaq |
smswq |
cmovnaq |
lodsq |
stosq |
cmovnbeq |
lslq |
strq |
cmovnbq |
movabs |
subq |
cmovncq |
movdq |
testq |
cmovneq |
movntiq |
xaddq |
cmovngeq |
movq |
xchgq |
cmovngq |
movsq |
xchgqA |
cmovnleq |
movswq |
xorq |
cmovnlq |
movzwq |
|
The following Solaris mnemonics are not valid when the -xarch=amd64 command line option is specified:
aaa |
daa |
lesw |
aad |
das |
popa |
aam |
into |
popaw |
aas |
jecxz |
pusha |
boundw |
ldsw |
pushaw |