vc4: Refuse to merge instructions involving 32-bit immediate loads.
authorEric Anholt <eric@anholt.net>
Wed, 10 Dec 2014 00:34:37 +0000 (16:34 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 10 Dec 2014 02:32:36 +0000 (18:32 -0800)
An immediate load overwrites the mul and add operations, so you can't
merge with them.

src/gallium/drivers/vc4/vc4_qpu.c

index 6daa07281f41f1048cdd016dbce0ab96c0f9fd2c..faf8790b572cb02ae28fc75ff0512fbac004c423 100644 (file)
@@ -356,6 +356,11 @@ qpu_merge_inst(uint64_t a, uint64_t b)
         if (qpu_num_sf_accesses(a) && qpu_num_sf_accesses(b))
                 return 0;
 
+        if (QPU_GET_FIELD(a, QPU_SIG) == QPU_SIG_LOAD_IMM ||
+            QPU_GET_FIELD(b, QPU_SIG) == QPU_SIG_LOAD_IMM) {
+                return 0;
+        }
+
         ok = ok && merge_fields(&merge, a, b, QPU_SIG_MASK,
                                 QPU_SET_FIELD(QPU_SIG_NONE, QPU_SIG));