nouveau/mme: Move the guts of mme_merge_to() into mme_tu104_builder.c
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:32:03 +0000 (21:32 +0000)
It's going to be a bit different on Fermi.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/mme/mme_builder.h
src/nouveau/mme/mme_tu104_builder.c
src/nouveau/mme/mme_tu104_builder.h

index 16ef7a2..d1a1122 100644 (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
index 141fd00..ff7f5fb 100644 (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)
@@ -353,6 +352,18 @@ mme_tu104_alu64_to(struct mme_builder *b,
 }
 
 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)
 {
    build_alu_to(b, mme_zero(), MME_TU104_ALU_OP_EXTENDED,
index 79dab87..7e94ee1 100644 (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,