broadcom/compiler: support subgroup shuffle
This maps to our native shuffle instruction. For shuffle relative and shuffle xor, we rely on the nir lowering to lower this to ALU and regular shuffle. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
This commit is contained in:
committed by
Marge Bot
parent
29a5e3e615
commit
3222fd71a1
@@ -3787,6 +3787,15 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_intrinsic_shuffle: {
|
||||
assert(c->devinfo->ver >= 71);
|
||||
struct qreg value = ntq_get_src(c, instr->src[0], 0);
|
||||
struct qreg indices = ntq_get_src(c, instr->src[1], 0);
|
||||
struct qreg res = vir_SHUFFLE(c, value, indices);
|
||||
ntq_store_def(c, &instr->def, 0, vir_MOV(c, res));
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_intrinsic_load_num_subgroups:
|
||||
unreachable("Should have been lowered");
|
||||
break;
|
||||
|
||||
@@ -1586,6 +1586,10 @@ lower_subgroup_intrinsics(struct v3d_compile *c,
|
||||
case nir_intrinsic_load_subgroup_gt_mask:
|
||||
case nir_intrinsic_load_subgroup_le_mask:
|
||||
case nir_intrinsic_load_subgroup_lt_mask:
|
||||
case nir_intrinsic_shuffle:
|
||||
case nir_intrinsic_shuffle_xor:
|
||||
case nir_intrinsic_shuffle_up:
|
||||
case nir_intrinsic_shuffle_down:
|
||||
c->has_subgroups = true;
|
||||
break;
|
||||
default:
|
||||
@@ -1706,6 +1710,7 @@ v3d_attempt_compile(struct v3d_compile *c)
|
||||
.lower_to_scalar = true,
|
||||
.lower_inverse_ballot = true,
|
||||
.lower_subgroup_masks = true,
|
||||
.lower_relative_shuffle = true,
|
||||
};
|
||||
NIR_PASS(_, c->s, nir_lower_subgroups, &subgroup_opts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user