Export (0) Print
Expand All
Expand Minimize

dmovc (sm5 - asm)

Component-wise conditional move.

dmovc[_sat] dest[.mask], src0[.swizzle], [-]src1[_abs][.swizzle], [-]src2[_abs][.swizzle],

 

ItemDescription

dest

[in] The move destination.

If src0, then dest = src1 else dest = src2.

src0

[in] The components to test the condition against.

src1

[in] The components to move if the condition is true.

src2

[in] The components to move if the condition is false.

 

Remarks

The following example shows how to use this instruction.


                if(the dest mask contains .xy)
                {
                    if(the first 32-bit component of src0, post-swizzle, 
                       has any bit set)
                    {
                        copy the first double from src1 (post swizzle)
                        into dest.xy
                    }
                    else
                    {
                        copy the first double from src2 (post swizzle)
                        into dest.xy
                    }
                }
                if(the dest mask contains .zw)
                {
                    if(the second 32-bit component of src0, post-swizzle, 
                       has any bit set)
                    {
                        copy the second double from src1 (post swizzle)
                        into dest.zw
                    }
                    else
                    {
                        copy the second double from src2 (post swizzle)
                        into dest.zw
                    }
                }

The valid masks for dest are .xy, .zw, .xyzw.

The valid swizzles for src0 are anything. The first two components post-swizzle are used to indentify two 32-bit condition values.

The valid swizzles for src1 and src2 containing doubles are .xyzw, .xyxy, .zwxy, .zwzw. are .xy, .zw, and .xyzw.

The following src mappings below are post-swizzle:

  • dest is a double vec2 across (x 32LSB, y 32MSB) and (z 32LSB, w 32MSB).
  • src0 is a 32bit/component vec2 across x and y (zw ignored).
  • src1 is a double vec2 across (x 32LSB, y 32MSB) and (z 32LSB, w 32MSB).
  • src2 is a double vec2 across (x 32LSB, y 32MSB) and (z 32LSB, w 32MSB).

The modifiers on src1 and src2, other than swizzle, assume the data is double. The absence of modifiers moves data without altering bits.

This instruction applies to the following shader stages:

VertexHullDomainGeometryPixelCompute
XX XXXX

 

Minimum Shader Model

This instruction is supported in the following shader models:

Shader ModelSupported
Shader Model 5 yes
Shader Model 4.1 no
Shader Model 4 no
Shader Model 3 (DirectX HLSL) no
Shader Model 2 (DirectX HLSL) no
Shader Model 1 (DirectX HLSL) no

 

 

 

Community Additions

ADD
Show:
© 2014 Microsoft