[Mesa-dev] [PATCH] gallivm: obey clarified shift behavior

Zack Rusin zackr at vmware.com
Tue Jul 30 21:06:52 PDT 2013


> From: Roland Scheidegger <sroland at vmware.com>
> 
> llvm shifts are undefined for shift counts exceeding (or matching) bit width,
> so need to apply a mask for the tgsi shift instructions.
> 
> v2: only use mask for the tgsi shift instructions, not for the build shift
> helpers. None of the internal callers need this behavior, and while llvm can
> optimize away the masking for constants there are legitimate cases where it
> might not be able to do so even if we know that shift count must be smaller
> than type width (currently all such callers do not use the build shift
> helpers).

Looks good to me


More information about the mesa-dev mailing list