x86 Instruction Set Reference

FSQRT - Square Root

Opcode Mnemonic Description
D9 FA FSQRT Computes square root of ST(0) and stores the result in ST(0).
Description

Computes the square root of the source value in the ST(0) register and stores the result in ST(0).

The following table shows the results obtained when taking the square root of various classes of numbers, assuming that neither overflow nor underflow occurs.

FSQRT Results
Source (ST(0))Destination (ST(0))
-inf*
-F*
-0-0
+0+0
+F+F
+inf+inf
NaNNaN
F Means finite floating-point value.
* Indicates floating-point invalid-arithmetic-operand (#IA) exception.
Operation
ST(0) = SquareRoot(ST(0));
FPU flags affected

C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.

Floating-Point Exceptions
#ISStack underflow occurred.
#ISStack underflow occurred.
#IASource operand is an SNaN value or unsupported format. Source operand is a negative value (except for -0).
#DSource operand is a denormal value.
Protected Mode Exceptions
#NMEM or TS in CR0 is set.
Real-Address Mode Exceptions
#NMEM or TS in CR0 is set.
Virtual-8086 Mode Exceptions
#NMEM or TS in CR0 is set.
Instruction Latency Throughput Execution Unit
CPUID0F3n/0F2n0F3n/0F2n0F2n
FSQRT SP30/2330/23FP_DIV
FSQRT DP40/3840/38FP_DIV
FSQRT EP44/4344/43FP_DIV