aco: allow GFX9 partial writes with instructions which use opsel
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 11 Jun 2020 13:05:48 +0000 (14:05 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 15 Jun 2020 18:24:22 +0000 (18:24 +0000)
Some instructions such as v_mad_f16 can do partial writes on GFX9.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>

src/amd/compiler/aco_register_allocation.cpp

index 505f5cb613df31358bf8abc359576a09e7c34aa3..4841b5eb6f0075736e8cf3fc4d8a833ec168e60e 100644 (file)
@@ -429,7 +429,7 @@ std::pair<unsigned, unsigned> get_subdword_definition_info(Program *program, con
    if (can_use_SDWA(chip, instr)) {
       return std::make_pair(rc.bytes(), rc.bytes());
    } else if (rc.bytes() == 2 && can_use_opsel(chip, instr->opcode, -1, 1)) {
-      return std::make_pair(2u, chip >= GFX10 ? 2u : 4u);
+      return std::make_pair(2u, bytes_written);
    }
 
    switch (instr->opcode) {