freedreno/ir3: add support for memory (cat6) instructions
authorRob Clark <robclark@freedesktop.org>
Thu, 26 Feb 2015 20:13:10 +0000 (15:13 -0500)
committerRob Clark <robclark@freedesktop.org>
Tue, 3 Mar 2015 15:41:00 +0000 (10:41 -0500)
Scheduled basically the same as texture (cat5) instructions, using (sy)
flag for synchronization.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3.h
src/gallium/drivers/freedreno/ir3/ir3_depth.c
src/gallium/drivers/freedreno/ir3/ir3_legalize.c

index a3bbba941cedd567e68919c78882ce17fd4cda32..f90392b72972f58bceada2232c2b5701c3a4563e 100644 (file)
@@ -420,6 +420,11 @@ static inline bool is_tex(struct ir3_instruction *instr)
        return (instr->category == 5);
 }
 
+static inline bool is_mem(struct ir3_instruction *instr)
+{
+       return (instr->category == 6);
+}
+
 static inline bool is_input(struct ir3_instruction *instr)
 {
        return (instr->category == 2) && (instr->opc == OPC_BARY_F);
@@ -508,9 +513,6 @@ int ir3_block_ra(struct ir3_block *block, enum shader_t type,
 void ir3_block_legalize(struct ir3_block *block,
                bool *has_samp, int *max_bary);
 
-#ifndef ARRAY_SIZE
-#  define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-#endif
 
 /* ************************************************************************* */
 /* split this out or find some helper to use.. like main/bitset.h.. */
index 76413d415894a1e894cc6c60c653a50fb2913b09..8ff62ba70a67476d431c05b1a25f134697c6542e 100644 (file)
@@ -67,7 +67,7 @@ int ir3_delayslots(struct ir3_instruction *assigner,
                return 6;
 
        /* handled via sync flags: */
-       if (is_sfu(assigner) || is_tex(assigner))
+       if (is_sfu(assigner) || is_tex(assigner) || is_mem(assigner))
                return 0;
 
        /* assigner must be alu: */
index 2ef11f183d7a38c79c5b4a9a21dead5436df6ad5..11629f61f7348e211b04afe5da0433a0328d39b8 100644 (file)
@@ -168,6 +168,8 @@ static void legalize(struct ir3_legalize_ctx *ctx)
                         */
                        ctx->has_samp = true;
                        regmask_set(&needs_sy, n->regs[0]);
+               } else if (is_mem(n)) {
+                       regmask_set(&needs_sy, n->regs[0]);
                }
 
                /* both tex/sfu appear to not always immediately consume