[PATCH] D11829: AMDGPU/SI: Re-define AMDGPUISD:CLAMP as always clamping between 0.0. and 1.0

Artem Tamazov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 02:55:28 PST 2017


artem.tamazov added a comment.

@arsenm

> @artem.tamazov Do you know the answer to the denormal questions I added in comments? Most importantly are denormals really not supported with clamp? And if not for f32, are they still not supported for f16/f64? Does clamp work with f64 instructions?

Unlike output modifiers (*2, *4, /2), output clamp is compatible with both denormals and IEEE mode of the shader. In Gfx8 it is applicable to all floating types (f16, f32, f64).

BTW Clamp is also applicable to many integer instructions. It changes overflow behavior from wrapping to saturation. Saturation range is [-MAX_INT, MAX_INT] for signed integers and [0, MAX_UINT] for unsigned.


https://reviews.llvm.org/D11829





More information about the llvm-commits mailing list