nouveau/mme: Move the guts of mme_merge_to() into mme_tu104_builder.c

It's going to be a bit different on Fermi.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:05 -06:00 committed by Marge Bot
parent 0b52da5afa
commit 9e1a868b6d
3 changed files with 17 additions and 7 deletions

View file

@ -27,7 +27,6 @@ enum mme_alu_op {
MME_ALU_OP_NAND,
MME_ALU_OP_OR,
MME_ALU_OP_XOR,
MME_ALU_OP_MERGE,
MME_ALU_OP_SLT,
MME_ALU_OP_SLTU,
MME_ALU_OP_SLE,
@ -293,11 +292,7 @@ mme_merge_to(struct mme_builder *b, struct mme_value dst,
struct mme_value x, struct mme_value y,
uint16_t dst_pos, uint16_t bits, uint16_t src_pos)
{
assert(dst_pos < 32);
assert(bits < 32);
assert(src_pos < 32);
mme_alu_to(b, dst, MME_ALU_OP_MERGE, x, y,
(dst_pos << 10) | (bits << 5) | src_pos);
mme_tu104_merge_to(b, dst, x, y, dst_pos, bits, src_pos);
}
static inline struct mme_value

View file

@ -303,7 +303,6 @@ mme_to_tu104_alu_op(enum mme_alu_op op)
ALU_CASE(NAND)
ALU_CASE(OR)
ALU_CASE(XOR)
ALU_CASE(MERGE)
ALU_CASE(SLT)
ALU_CASE(SLTU)
ALU_CASE(SLE)
@ -352,6 +351,18 @@ mme_tu104_alu64_to(struct mme_builder *b,
build_alu_to(b, dst.hi, mme_to_tu104_alu_op(op_hi), x.hi, y.hi, 0, false);
}
void
mme_tu104_merge_to(struct mme_builder *b, struct mme_value dst,
struct mme_value x, struct mme_value y,
uint16_t dst_pos, uint16_t bits, uint16_t src_pos)
{
assert(dst_pos < 32);
assert(bits < 32);
assert(src_pos < 32);
uint32_t ctrl = (dst_pos << 10) | (bits << 5) | src_pos;
build_alu_to(b, dst, MME_TU104_ALU_OP_MERGE, x, y, ctrl, false);
}
void
mme_tu104_load_barrier(struct mme_builder *b)
{

View file

@ -61,6 +61,10 @@ void mme_tu104_alu64_to(struct mme_builder *b,
struct mme_value64 x,
struct mme_value64 y);
void mme_tu104_merge_to(struct mme_builder *b, struct mme_value dst,
struct mme_value x, struct mme_value y,
uint16_t dst_pos, uint16_t bits, uint16_t src_pos);
void mme_tu104_load_barrier(struct mme_builder *b);
void mme_tu104_load_to(struct mme_builder *b,