Microsoft DirectX 8.0 (C++) |
Sets the destination to 1.0 if the first source operand is less than the second source operand; otherwise, the destination is set to 0.0.
slt vDest, vSrc0, vSrc1
The following code fragment shows the operations performed by the slt instruction to write a result to the destination.
SetDestReg(); SetSrcReg(0); SetSrcReg(1); m_TmpReg.x = (m_Source[0].x < m_Source[1].x) ? 1.0f : 0.0f; m_TmpReg.y = (m_Source[0].y < m_Source[1].y) ? 1.0f : 0.0f; m_TmpReg.z = (m_Source[0].z < m_Source[1].z) ? 1.0f : 0.0f; m_TmpReg.w = (m_Source[0].w < m_Source[1].w) ? 1.0f : 0.0f; WriteResult();
The following example illustrates how the slt instruction might be used.
slt r1, r2, v1