Microsoft DirectX 8.0 (Visual Basic)

exp

Provides exponential 2x with full precision to at least 1/220.

exp   vDest, vSrc0

Registers

vDest
Destination register, holding the result of the operation.
vSrc0
Source register, specifying the input argument.

Operation

    SetDestReg();
    SetSrcReg(0);

    float v = m_Source[0].w;

    m_TmpReg.x = m_TmpReg.y = m_TmpReg.z = m_TmpReg.w = (float)pow(2, v);  

    WriteResult();

Expansion

This macro takes twelve instruction slots.

Remarks

This is a scalar operation and takes its input from the .w channel, which must be specified. It always replicates the result into all four output channels.