nv50/ir: handle U8/U16 integers converting to U64
authorDanilo Krummrich <dakr@redhat.com>
Wed, 17 Aug 2022 12:50:50 +0000 (14:50 +0200)
committerDanilo Krummrich <dakr@redhat.com>
Fri, 9 Sep 2022 15:32:30 +0000 (17:32 +0200)
We can't directly convert from unsigned integers smaller than 64 bit to
unsigned 64 bit integers. Hence, converting from 32 bit to 64 bit is
handled by just merging with 0. To support U8/U16 integers handle them
just the same way.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18109>

src/nouveau/codegen/nv50_ir_lowering_helper.cpp

index a8f1660..ac02552 100644 (file)
@@ -154,9 +154,11 @@ LoweringHelper::handleCVT(Instruction *insn)
       return true;
    }
 
-   if (dTy == TYPE_U64 && sTy == TYPE_U32) {
+   if (dTy == TYPE_U64 && isUnsignedIntType(sTy) && typeSizeof(sTy) <= 4) {
       insn->op = OP_MERGE;
       insn->setSrc(1, bld.loadImm(bld.getSSA(), 0));
+
+      return true;
    }
 
    return true;