From: Jason Ekstrand Date: Thu, 15 Nov 2018 03:57:59 +0000 (-0600) Subject: intel/cs_intrinsics: Handle 64-bit intrinsics X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e1de8e5ac90a9dd0a2fb9310cb36371a9d12dce;p=mesa.git intel/cs_intrinsics: Handle 64-bit intrinsics It's safe to do the math in 32 bits because they're all local workgroup calculations. We just need to do a conversion at the end. For a couple of intrinsics, we just turn them into 32-bit intrinsics and add a u2u64. Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c index 7c08b36aab6..102bd29595a 100644 --- a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c +++ b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c @@ -53,6 +53,18 @@ lower_cs_intrinsics_convert_block(struct lower_intrinsics_state *state, nir_ssa_def *sysval; switch (intrinsic->intrinsic) { + case nir_intrinsic_load_local_group_size: + case nir_intrinsic_load_work_group_id: + /* Convert this to 32-bit if it's not */ + if (intrinsic->dest.ssa.bit_size == 64) { + intrinsic->dest.ssa.bit_size = 32; + sysval = nir_u2u64(b, &intrinsic->dest.ssa); + nir_ssa_def_rewrite_uses_after(&intrinsic->dest.ssa, + nir_src_for_ssa(sysval), + sysval->parent_instr); + } + continue; + case nir_intrinsic_load_local_invocation_index: case nir_intrinsic_load_local_invocation_id: { /* First time we are using those, so let's calculate them. */ @@ -171,6 +183,9 @@ lower_cs_intrinsics_convert_block(struct lower_intrinsics_state *state, continue; } + if (intrinsic->dest.ssa.bit_size == 64) + sysval = nir_u2u64(b, sysval); + nir_ssa_def_rewrite_uses(&intrinsic->dest.ssa, nir_src_for_ssa(sysval)); nir_instr_remove(&intrinsic->instr);