pan/bi: Rename PATOM_C to ATOM
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 23 Mar 2022 01:47:27 +0000 (21:47 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Mar 2022 19:00:13 +0000 (19:00 +0000)
This is basically what's native on Valhall. Use the Valhall naming for the
pseudo-instruction on Bifrost for consistency.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>

src/panfrost/bifrost/ISA.xml
src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/bir.c

index 4d820fd..0fad891 100644 (file)
     <mod name="preserve_null" size="1" opt="preserve_null"/>
   </ins>
 
-  <!-- Scheduler lowered to *ATOM_C.i32/+ATOM_CX -->
-  <ins name="+PATOM_C.i32" pseudo="true" staging="rw=sr_count" message="atomic">
+  <!-- Scheduler lowered to *ATOM_C.i32/+ATOM_CX. Real Valhall instructions. -->
+  <ins name="+ATOM_RETURN.i32" pseudo="true" staging="rw=sr_count" message="atomic">
     <src start="0"/>
     <src start="3"/>
-    <mod name="atom_opc" start="9" size="4">
+    <mod name="atom_opc" start="9" size="5">
       <reserved/>
       <reserved/>
       <opt>aadd</opt>
     <immediate name="sr_count" size="4" pseudo="true"/>
   </ins>
 
-  <ins name="+PATOM_C1.i32" pseudo="true" staging="w=sr_count" message="atomic">
+  <ins name="+ATOM1_RETURN.i32" pseudo="true" staging="w=sr_count" message="atomic">
     <src start="0"/>
     <src start="3"/>
     <mod name="atom_opc" start="6" size="3">
index efcd961..01bf629 100644 (file)
@@ -1234,9 +1234,9 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st,
 {
         if (tuple->add && tuple->add->op == BI_OPCODE_CUBEFACE)
                 return bi_lower_cubeface(ctx, clause, tuple);
-        else if (tuple->add && tuple->add->op == BI_OPCODE_PATOM_C_I32)
+        else if (tuple->add && tuple->add->op == BI_OPCODE_ATOM_RETURN_I32)
                 return bi_lower_atom_c(ctx, clause, tuple);
-        else if (tuple->add && tuple->add->op == BI_OPCODE_PATOM_C1_I32)
+        else if (tuple->add && tuple->add->op == BI_OPCODE_ATOM1_RETURN_I32)
                 return bi_lower_atom_c1(ctx, clause, tuple);
         else if (tuple->add && tuple->add->op == BI_OPCODE_SEG_ADD_I64)
                 return bi_lower_seg_add(ctx, clause, tuple);
index b7f1f8a..ca921e9 100644 (file)
@@ -1094,14 +1094,14 @@ bi_emit_atomic_i32_to(bi_builder *b, bi_index dst,
         enum bi_atom_opc opc = bi_atom_opc_for_nir(intrinsic);
         enum bi_atom_opc post_opc = opc;
 
-        /* Generate either ATOM_C or ATOM_C1 as required */
+        /* Generate either ATOM or ATOM1 as required */
         if (bi_promote_atom_c1(opc, arg, &opc)) {
-                bi_patom_c1_i32_to(b, sr, bi_word(addr, 0),
-                                bi_word(addr, 1), opc, 2);
+                bi_atom1_return_i32_to(b, sr, bi_word(addr, 0),
+                                       bi_word(addr, 1), opc, 2);
         } else {
                 bi_mov_i32_to(b, sr, arg);
-                bi_patom_c_i32_to(b, sr, sr, bi_word(addr, 0),
-                                bi_word(addr, 1), opc, 2);
+                bi_atom_return_i32_to(b, sr, sr, bi_word(addr, 0),
+                                      bi_word(addr, 1), opc, 2);
         }
 
         /* Post-process it */
index 178950d..45b34ba 100644 (file)
@@ -86,8 +86,8 @@ bi_count_staging_registers(const bi_instr *ins)
 unsigned
 bi_count_read_registers(const bi_instr *ins, unsigned s)
 {
-        /* PATOM_C reads 1 but writes 2 */
-        if (s == 0 && ins->op == BI_OPCODE_PATOM_C_I32)
+        /* ATOM reads 1 but writes 2 */
+        if (s == 0 && ins->op == BI_OPCODE_ATOM_RETURN_I32)
                 return 1;
         else if (s == 0 && bi_opcode_props[ins->op].sr_read)
                 return bi_count_staging_registers(ins);