xvmaxdp
Vector Scalar Maximum Double-Precision Floating Point
Compares two double-precision floating-point values and selects the maximum value for each element.
Details
For xvmaxdp, the instruction compares the double-precision floating-point values in the elements of VSR[XA] and VSR[XB], and places the maximum value into the corresponding elements of VSR[XT].
Pseudocode Operation
for i in {0, 1} do
src1 <- VSR[XA][i]
src2 <- VSR[XB][i]
if src1 is QNaN or src2 is QNaN then
T(Q(src2))
else if src1 is SNaN or src2 is SNaN then
fx(VXSNAN)
else if src1 is +Infinity and src2 is -Infinity then
T(src1)
else if src1 is -Infinity and src2 is +Infinity then
T(src2)
else if src1 is NZF and src2 is Zero then
T(src1)
else if src1 is Zero and src2 is NZF then
T(src2)
else if src1 is NZF and src2 is NZF then
T(M(src1,src2))
else if src1 is +Zero and src2 is +Zero then
T(src1)
else if src1 is -Zero and src2 is -Zero then
T(src2)
else if src1 is +Infinity and src2 is +Infinity then
T(src1)
else if src1 is -Infinity and src2 is -Infinity then
T(src2)
else if src1 is QNaN or SNaN then
T(src2)
end if
end for
Programming Note
This instruction compares two double-precision floating-point vectors element-wise and stores the maximum value in each corresponding element of the destination vector. Be cautious with NaN values, as they can trigger exceptions or propagate through the operation. Ensure that the input vectors are properly aligned to avoid performance penalties.
Example
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B