~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/asahi/compiler/agx_lower_parallel_copy.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
agx_emit_parallel_copies(agx_builder *b, struct agx_copy *copies,
100
100
                         unsigned num_copies)
101
101
{
 
102
   /* First, lower away 64-bit copies to smaller chunks, since we don't have
 
103
    * 64-bit ALU so we always want to split.
 
104
    */
 
105
   struct agx_copy *copies2 = calloc(sizeof(copies[0]), num_copies * 2);
 
106
   unsigned num_copies2 = 0;
 
107
 
 
108
   for (unsigned i = 0; i < num_copies; ++i) {
 
109
      struct agx_copy copy = copies[i];
 
110
 
 
111
      if (copy.src.size == AGX_SIZE_64) {
 
112
         copy.src.size = AGX_SIZE_32;
 
113
         copies2[num_copies2++] = copy;
 
114
 
 
115
         copy.src.value += 2;
 
116
         copy.dest += 2;
 
117
         copies2[num_copies2++] = copy;
 
118
      } else {
 
119
         copies2[num_copies2++] = copy;
 
120
      }
 
121
   }
 
122
 
 
123
   copies = copies2;
 
124
   num_copies = num_copies2;
 
125
 
 
126
   /* Set up the bookkeeping */
102
127
   struct copy_ctx _ctx = {.entry_count = num_copies};
103
 
 
104
128
   struct copy_ctx *ctx = &_ctx;
105
129
 
106
 
   /* Set up the bookkeeping */
107
130
   memset(ctx->physreg_dest, 0, sizeof(ctx->physreg_dest));
108
131
   memset(ctx->physreg_use_count, 0, sizeof(ctx->physreg_use_count));
109
132
 
262
285
 
263
286
      entry->done = true;
264
287
   }
 
288
 
 
289
   free(copies2);
265
290
}