xvtsqrtsp

VSX Vector Test for software Square Root, Single-Precision

xvtsqrtsp BF,XB

Tests each element of a vector for conditions related to square root operations.

Details

Tests whether a square root operation would be valid for each single-precision floating-point vector element and sets the specified condition register field accordingly. This VSX instruction examines the four single-precision values in XB against square root validity conditions (e.g., negative operands). The condition register field BF is set to reflect the test outcome; no other registers are modified.

Pseudocode Operation

for i in 0 to 3 do
  sqrt_valid ← test_sqrt_conditions(XB[i])
  CR[BF] ← (sqrt_valid, 0, 0, 0)
end for

Programming Note

The xvtsqrtsp instruction is used to test each element of a vector for NaN, infinity, zero, negative values, and underflow conditions. It sets the condition register based on these tests. Ensure that VSX is enabled in the MSR before using this instruction; otherwise, it will raise an exception. The instruction does not require specific alignment but must be executed at a privilege level where VSX is available.

Example

xvtsqrtsp cr0, vs3

Encoding

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

Operands

  • BF
    Condition Register Field
  • XB
    Vector-Scalar Register