[Mesa-dev] [PATCH] nvir/nvc0: fix CVT lowering for dType == sType

Karol Herbst kherbst at redhat.com
Tue Dec 5 14:23:44 UTC 2017


uhh, seems like this code isn't in master yet, so ignore this please.

On Tue, Dec 5, 2017 at 3:17 PM, Karol Herbst <kherbst at redhat.com> wrote:
> The lowering code can't really handle that situation well and we just get away
> with converting it to OP_MOV in this case.
>
> Signed-off-by: Karol Herbst <kherbst at redhat.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> index b0834a8035..da2f979e66 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -2808,6 +2808,11 @@ NVC0LoweringPass::handleCVT(Instruction *i)
>     if (isFloatType(i->dType) || isFloatType(i->sType))
>        return true;
>
> +   if (i->dType == i->sType) {
> +      i->op = OP_MOV;
> +      return true;
> +   }
> +
>     if (i->saturate && (typeSizeof(i->sType) > typeSizeof(i->dType))) {
>        if (isSignedIntType(i->sType) && !isSignedIntType(i->dType)) {
>           // Signed to unsigned: only need to clamp to 0
> --
> 2.14.3
>


More information about the mesa-dev mailing list