mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
etnaviv: Move swizzle related macros to scr/etnaviv
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28183>
This commit is contained in:
parent
abe5bd35d0
commit
8e0f2c2539
2 changed files with 20 additions and 16 deletions
|
|
@ -16,6 +16,26 @@
|
|||
/* Number of source operands per instruction */
|
||||
#define ETNA_NUM_SRC (3)
|
||||
|
||||
#define SWIZ_X(x) (((x) & 0x03) << 0)
|
||||
#define SWIZ_Y(y) (((y) & 0x03) << 2)
|
||||
#define SWIZ_Z(z) (((z) & 0x03) << 4)
|
||||
#define SWIZ_W(w) (((w) & 0x03) << 6)
|
||||
|
||||
/* Broadcast swizzle to all four components */
|
||||
#define INST_SWIZ_BROADCAST(x) \
|
||||
(SWIZ_X(x) | SWIZ_Y(x) | SWIZ_Z(x) | SWIZ_W(x))
|
||||
/* Identity (NOP) swizzle */
|
||||
#define INST_SWIZ_IDENTITY \
|
||||
(SWIZ_X(0) | SWIZ_Y(1) | SWIZ_Z(2) | SWIZ_W(3))
|
||||
/* Fully specified swizzle */
|
||||
#define INST_SWIZ(x, y, z, w) \
|
||||
(SWIZ_X(x) | SWIZ_Y(y) | SWIZ_Z(z) | SWIZ_W(w))
|
||||
#define SWIZZLE(c0, c1, c2, c3) \
|
||||
INST_SWIZ(ISA_SWIZ_##c0, \
|
||||
ISA_SWIZ_##c1, \
|
||||
ISA_SWIZ_##c2, \
|
||||
ISA_SWIZ_##c3)
|
||||
|
||||
/*** operands ***/
|
||||
|
||||
/* destination operand */
|
||||
|
|
|
|||
|
|
@ -37,22 +37,6 @@
|
|||
/* Size of an instruction in 32-bit words */
|
||||
#define ETNA_INST_SIZE (4)
|
||||
|
||||
/* Broadcast swizzle to all four components */
|
||||
#define INST_SWIZ_BROADCAST(x) \
|
||||
(INST_SWIZ_X(x) | INST_SWIZ_Y(x) | INST_SWIZ_Z(x) | INST_SWIZ_W(x))
|
||||
/* Identity (NOP) swizzle */
|
||||
#define INST_SWIZ_IDENTITY \
|
||||
(INST_SWIZ_X(0) | INST_SWIZ_Y(1) | INST_SWIZ_Z(2) | INST_SWIZ_W(3))
|
||||
/* Fully specified swizzle */
|
||||
#define INST_SWIZ(x,y,z,w) \
|
||||
(INST_SWIZ_X(x) | INST_SWIZ_Y(y) | INST_SWIZ_Z(z) | INST_SWIZ_W(w))
|
||||
#define SWIZZLE(c0,c1,c2,c3) \
|
||||
INST_SWIZ(INST_SWIZ_COMP_##c0, \
|
||||
INST_SWIZ_COMP_##c1, \
|
||||
INST_SWIZ_COMP_##c2, \
|
||||
INST_SWIZ_COMP_##c3)
|
||||
|
||||
|
||||
/* Compose two swizzles (computes swz1.swz2) */
|
||||
static inline uint32_t inst_swiz_compose(uint32_t swz1, uint32_t swz2)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue