Export (0) Print
Expand All
Expand Minimize

ubfe (sm5 - asm)

Given a range of bits in a number, shift those bits to the LSB and set remaining bits to 0.

ubfe dest[.mask], src0[.swizzle], src1[.swizzle], src2[.swizzle]

 

ItemDescription

dest

[in] Contains the results of the instruction.

src0

[in] The LSB 5 bits provide the bitfield width (0-31).

src1

[in] The LSB 5 bits of src1 provide the bitfield offset (0-31).

src2

[in] The number to shift.

 

Remarks

 
        Given width, offset:
                if( width == 0 )
                {
                    dest = 0
                }
                else if( width + offset < 32 )
                {
                    shl dest, src2, 32-(width+offset)
                    ushr dest, dest, 32-width
                }
                else
                {
                    ushr dest, src2, offset
                }

Use this instruction to unpack unsigned integers or flags.

This instruction applies to the following shader stages:

VertexHullDomainGeometryPixelCompute
XX X XXX

 

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