xvtsqrtsp
VSX Vector Test for software Square Root, Single-Precision
Tests each element of a vector for conditions related to square root operations.
Details
The xvtsqrtsp instruction tests each element of the vector VSR[XB] for various conditions and sets the condition register field CR.field[BF] based on these tests.
Pseudocode Operation
if MSR.VSX=0 then
VSX_Unavailable()
fe_flag ←0b0
fg_flag ←0b0
do i = 0 to 3
src ←VSR[32×XB+B].word[i]
e_b ←src2.bit[1:8] - 127
fe_flag ←fe_flag |
IsNaN(src) | IsInf(src) |
IsZero(src) | IsNeg(src) |
(e_a <= -103)
fg_flag ←fg_flag | IsInf(src) |
IsZero(src) | IsDen(src)
end
fl_flag = xvrsqrtesp_error() <= 2-14
CR.field[BF] = 0b1 || fg_flag || fe_flag || 0b0
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