Go to main content

x86 Assembly Language Reference Manual

Exit Print View

Updated: March 2018
 
 

3.3 Floating-Point Instructions

The floating point instructions operate on floating-point, integer, and binary coded decimal (BCD) operands.

3.3.1 Data Transfer Instructions (Floating Point)

The data transfer instructions move floating-point, integer, and BCD values between memory and the floating point registers.

Table 14  Data Transfer Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
fbld
FBLD
load BCD
fbstp
FBSTP
store BCD and pop
fcmovb
FCMOVB
floating-point conditional move if below
fcmovbe
FCMOVBE
floating-point conditional move if below or equal
fcmove
FCMOVE
floating-point conditional move if equal
fcmovnb
FCMOVNB
floating-point conditional move if not below
fcmovnbe
FCMOVNBE
floating-point conditional move if not below or equal
fcmovne
FCMOVNE
floating-point conditional move if not equal
fcmovnu
FCMOVNU
floating-point conditional move if unordered
fcmovu
FCMOVU
floating-point conditional move if unordered
fild
FILD
load integer
fist
FIST
store integer
fistp
FISTP
store integer and pop
fld
FLD
load floating-point value
fst
FST
store floating-point value
fstp
FSTP
store floating-point value and pop
fxch
FXCH
exchange registers

3.3.2 Basic Arithmetic Instructions (Floating-Point)

The basic arithmetic instructions perform basic arithmetic operations on floating-point and integer operands.

Table 15  Basic Arithmetic Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
fabs
FABS
absolute value
fadd
FADD
add floating-point
faddp
FADDP
add floating-point and pop
fchs
FCHS
change sign
fdiv
FDIV
divide floating-point
fdivp
FDIVP
divide floating-point and pop
fdivr
FDIVR
divide floating-point reverse
fdivrp
FDIVRP
divide floating-point reverse and pop
fiadd
FIADD
add integer
fidiv
FIDIV
divide integer
fidivr
FIDIVR
divide integer reverse
fimul
FIMUL
multiply integer
fisub
FISUB
subtract integer
fisubr
FISUBR
subtract integer reverse
fmul
FMUL
multiply floating-point
fmulp
FMULP
multiply floating-point and pop
fprem
FPREM
partial remainder
fprem1
FPREM1
IEEE partial remainder
frndint
FRNDINT
round to integer
fscale
FSCALE
scale by power of two
fsqrt
FSQRT
square root
fsub
FSUB
subtract floating-point
fsubp
FSUBP
subtract floating-point and pop
fsubr
FSUBR
subtract floating-point reverse
fsubrp
FSUBRP
subtract floating-point reverse and pop
fxtract
FXTRACT
extract exponent and significand

3.3.3 Comparison Instructions (Floating-Point)

The floating-point comparison instructions operate on floating-point or integer operands.

Table 16  Comparison Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
fcom
FCOM
compare floating-point
fcomi
FCOMI
compare floating-point and set %eflags
fcomip
FCOMIP
compare floating-point, set %eflags, and pop
fcomp
FCOMP
compare floating-point and pop
fcompp
FCOMPP
compare floating-point and pop twice
ficom
FICOM
compare integer
ficomp
FICOMP
compare integer and pop
ftst
FTST
test floating-point (compare with 0.0)
fucom
FUCOM
unordered compare floating-point
fucomi
FUCOMI
unordered compare floating-point and set %eflags
fucomip
FUCOMIP
unordered compare floating-point, set %eflags, and pop
fucomp
FUCOMP
unordered compare floating-point and pop
fucompp
FUCOMPP
compare floating-point and pop twice
fxam
FXAM
examine floating-point

3.3.4 Transcendental Instructions (Floating-Point)

The transcendental instructions perform trigonometric and logarithmic operations on floating-point operands.

Table 17  Transcendental Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
f2xm1
F2XM1
computes 2x-1
fcos
FCOS
cosine
fpatan
FPATAN
partial arctangent
fptan
FPTAN
partial tangent
fsin
FSIN
sine
fsincos
FSINCOS
sine and cosine
fyl2x
FYL2X
computes y * log2x
fyl2xp1
FYL2XP1
computes y * log2(x+1)

3.3.5 Load Constants (Floating-Point) Instructions

The load constants instructions load common constants, such as π, into the floating-point registers.

Table 18  Load Constants Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
fld1
FLD1
load +1.0
fldl2e
FLDL2E
load log2e
fldl2t
FLDL2T
load log210
fldlg2
FLDLG2
load log102
fldln2
FLDLN2
load loge2
fldpi
FLDPI
load π
fldz
FLDZ
load +0.0

3.3.6 Control Instructions (Floating-Point)

The floating-point control instructions operate on the floating-point register stack and save and restore the floating-point state.

Table 19  Control Instructions (Floating-Point)
Oracle Solaris Mnemonic
Intel/AMD Mnemonic
Description
Notes
fclex
FCLEX
clear floating-point exception flags after checking for error conditions
fdecstp
FDECSTP
decrement floating-point register stack pointer
ffree
FFREE
free floating-point register
fincstp
FINCSTP
increment floating-point register stack pointer
finit
FINIT
initialize floating-point unit after checking error conditions
fldcw
FLDCW
load floating-point unit control word
fldenv
FLDENV
load floating-point unit environment
fnclex
FNCLEX
clear floating-point exception flags without checking for error conditions
fninit
FNINIT
initialize floating-point unit without checking error conditions
fnop
FNOP
floating-point no operation
fnsave
FNSAVE
save floating-point unit state without checking error conditions
fnstcw
FNSTCW
store floating-point unit control word without checking error conditions
fnstenv
FNSTENV
store floating-point unit environment without checking error conditions
fnstsw
FNSTSW
store floating-point unit status word without checking error conditions
frstor
FRSTOR
restore floating-point unit state
fsave
FSAVE
save floating-point unit state after checking error conditions
fstcw
FSTCW
store floating-point unit control word after checking error conditions
fstenv
FSTENV
store floating-point unit environment after checking error conditions
fstsw
FSTSW
store floating-point unit status word after checking error conditions
fwait
FWAIT
wait for floating-point unit
wait
WAIT
wait for floating-point unit