udiv (sm4 - asm)

Unsigned integer divide.

udiv destQUOT[.mask], destREM[.mask], src0[.swizzle], src1[.swizzle]
Item Description
destQUOT
[in] The address of the resulting quotient.
destREM
[in] The address of the resulting remainder.
src0
[in] The components to be divided by src1.
src1
[in] The components by whch to divide src0.

Remarks

This instruction performs a component-wise unsigned divide of the 32-bit operand src0 by the 32-bit operand src1. The results of the divides are the 32-bit quotients placed in destQUOT and 32-bit remainders placed in destREM.

Divide by zero returns 0xffffffff for both quotient and remainder.

You can specifiy either destQUOT or destREM as NULL instead of specifying a register, if the quotient or remainder are not needed.

This instruction applies to the following shader stages:

Vertex Shader Geometry Shader Pixel Shader
x x x

Minimum Shader Model

This function is supported in the following shader models.

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

Shader Model 4 Assembly (DirectX HLSL)