xstsqrtdp

VSX Scalar Test for software Square Root, Double-Precision

xstsqrtdp BF,XB

Tests the double-precision floating-point value in VSR[XB] and sets condition register field BF based on various flags.

Details

The instruction tests the double-precision floating-point value in VSR[XB].dword[0] and sets CR.field[BF] based on flags fe_flag, fg_flag, and fl_flag.

Pseudocode Operation

if MSR.VSX=0 then
    VSX_Unavailable()
src ← VSR[32×XB+B].dword[0]
e_b ← src.bit[1:11] - 1023
fe_flag ← IsNaN(src) | IsInf(src) | IsZero(src) |
           IsNeg(src) | (e_b <= -970)
fg_flag ← IsInf(src) | IsZero(src) | IsDen(src)
fl_flag ← xsrsqrtedp_error() <= 2-14
CR.field[BF] ← 0b1 || fg_flag || fe_flag || 0b0

Programming Note

This instruction is used to test a double-precision floating-point value for special conditions like NaN, infinity, zero, and denormal numbers. It sets the condition register field based on these flags. Ensure VSX is enabled in the MSR; otherwise, an exception will be raised. The instruction does not require any specific alignment or privilege level.

Example

xstsqrtdp cr0, vs3

Encoding

Binary Layout
18
0
BF
6
XB
9
 
Format XX2-form
Opcode 0xF00001A8
Extension VSX
Registers Altered CR

Operands

  • BF
    Condition Register Field
  • XB
    Vector-Scalar Register Index