From d6d39920a0a15ec77b315e70521fb72ab1662451 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 25 Sep 2022 00:49:09 +0200 Subject: [PATCH] ac/llvm: support non 32 bit sized workgroup ids MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Karol Herbst Reviewed-by: Marek Olšák Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 496a93f..8c456c2 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -3582,6 +3582,8 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins values[i] = ctx->args->workgroup_ids[i].used ? ac_get_arg(&ctx->ac, ctx->args->workgroup_ids[i]) : ctx->ac.i32_0; + if (nir_dest_bit_size(instr->dest) == 64) + values[i] = LLVMBuildZExt(ctx->ac.builder, values[i], ctx->ac.i64, ""); } result = ac_build_gather_values(&ctx->ac, values, 3); @@ -3724,6 +3726,8 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins ptr = LLVMBuildBitCast(ctx->ac.builder, ptr, ptr_type, ""); result = ac_build_load_invariant(&ctx->ac, ptr, ctx->ac.i32_0); } + if (nir_dest_bit_size(instr->dest) == 64) + result = LLVMBuildZExt(ctx->ac.builder, result, LLVMVectorType(ctx->ac.i64, 3), ""); break; case nir_intrinsic_load_local_invocation_index: result = visit_load_local_invocation_index(ctx); -- 2.7.4