Mesa (main): aco: use p_create_vector(v2b,v2b) in get_alu_src_vop3p()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 31 15:13:09 UTC 2021


Module: Mesa
Branch: main
Commit: 7e02787a544a758d134a814eda54068ec1bf25d2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e02787a544a758d134a814eda54068ec1bf25d2

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Oct 26 18:11:30 2021 +0200

aco: use p_create_vector(v2b,v2b) in get_alu_src_vop3p()

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13576>

---

 src/amd/compiler/aco_instruction_selection.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index b04e10d7682..f2f53a916ca 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -780,7 +780,16 @@ get_alu_src_vop3p(struct isel_context* ctx, nir_alu_src src)
 
    /* extract a full dword if possible */
    if (tmp.bytes() >= (dword + 1) * 4) {
-      return emit_extract_vector(ctx, tmp, dword, RegClass(tmp.type(), 1));
+      /* if the source is splitted into components, use p_create_vector */
+      auto it = ctx->allocated_vec.find(tmp.id());
+      if (it != ctx->allocated_vec.end()) {
+         unsigned index = dword << 1;
+         Builder bld(ctx->program, ctx->block);
+         if (it->second[index].regClass() == v2b)
+            return bld.pseudo(aco_opcode::p_create_vector, bld.def(v1), it->second[index],
+                              it->second[index + 1]);
+      }
+      return emit_extract_vector(ctx, tmp, dword, v1);
    } else {
       /* This must be a swizzled access to %a.zz where %a is v6b */
       assert(((src.swizzle[0] | src.swizzle[1]) & 1) == 0);



More information about the mesa-commit mailing list