xscmpeqdp
VSX Scalar Compare Equal Double-Precision
xscmpeqdp XT,XA,XB
Compares two double-precision floating-point values and sets the target vector register based on equality.
Details
The instruction compares the double-precision floating-point values in the specified source vector registers. If either value is a SNaN, an Invalid Operation exception occurs. The result of the comparison is stored in the target vector register.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
src1 ←bfp_CONVERT_FROM_BFP64(VSR[32×AX+A].dword[0])
src2 ←bfp_CONVERT_FROM_BFP64(VSR[32×BX+B].dword[0])
vxsnan_flag ←src1.class.SNaN | src2.class.SNaN
vex_flag ←FPSCR.VE & vxsnan_flag
if vxsnan_flag=1 SetFX(FPSCR.VXSNAN)
if vex_flag=0 then do
if src1=src2 then
VSR[32×TX+T].dword[0] ←0xFFFF_FFFF_FFFF_FFFF
VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000
else do
VSR[32×TX+T].dword[0] ←0x0000_0000_0000_0000
VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000
end
end
Programming Note
xscmpeqdp can be used to implement the C/C++/Java conditional operation, RESULT = (x=y) ? a:b. xscmpeqdp fEQ,fX,fY xxsel fRESULT,fA,fB,fEQ
Example
xscmpeqdp vs1, vs2, vs3
Encoding
Binary Layout
T
6
A
11
B
16
3
21
AX
29
BX
30
TX
31
Operands
-
XT
Target Vector Register -
XA
Source Vector Register -
XB
Source Vector Register