xvtsqrtsp
VSX Vector Test for software Square Root, Single-Precision
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
Encoding
Operands
-
BF
Condition Register Field -
XB
Vector-Scalar Register