zink: add spirv_builder function for hexops

these are functions with 6 operands

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
This commit is contained in:
Mike Blumenkrantz
2020-11-17 18:17:41 -05:00
committed by Marge Bot
parent 139ae442c6
commit 3d2ffb394a
2 changed files with 24 additions and 0 deletions
@@ -488,6 +488,25 @@ spirv_builder_emit_quadop(struct spirv_builder *b, SpvOp op, SpvId result_type,
return result;
}
SpvId
spirv_builder_emit_hexop(struct spirv_builder *b, SpvOp op, SpvId result_type,
SpvId operand0, SpvId operand1, SpvId operand2, SpvId operand3,
SpvId operand4, SpvId operand5)
{
SpvId result = spirv_builder_new_id(b);
spirv_buffer_prepare(&b->instructions, b->mem_ctx, 9);
spirv_buffer_emit_word(&b->instructions, op | (9 << 16));
spirv_buffer_emit_word(&b->instructions, result_type);
spirv_buffer_emit_word(&b->instructions, result);
spirv_buffer_emit_word(&b->instructions, operand0);
spirv_buffer_emit_word(&b->instructions, operand1);
spirv_buffer_emit_word(&b->instructions, operand2);
spirv_buffer_emit_word(&b->instructions, operand3);
spirv_buffer_emit_word(&b->instructions, operand4);
spirv_buffer_emit_word(&b->instructions, operand5);
return result;
}
SpvId
spirv_builder_emit_composite_extract(struct spirv_builder *b, SpvId result_type,
SpvId composite, const uint32_t indexes[],
@@ -193,6 +193,11 @@ SpvId
spirv_builder_emit_quadop(struct spirv_builder *b, SpvOp op, SpvId result_type,
SpvId operand0, SpvId operand1, SpvId operand2, SpvId operand3);
SpvId
spirv_builder_emit_hexop(struct spirv_builder *b, SpvOp op, SpvId result_type,
SpvId operand0, SpvId operand1, SpvId operand2, SpvId operand3,
SpvId operand4, SpvId operand5);
SpvId
spirv_builder_emit_composite_extract(struct spirv_builder *b, SpvId result_type,
SpvId composite, const uint32_t indexes[],