[PATCH] D101656: [WebAssembly] Fixup order of ins variables for table instructions

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 30 12:09:07 PDT 2021


pmatos created this revision.
pmatos added a reviewer: tlively.
Herald added subscribers: ecnelises, sunfish, hiraditya, jgravelle-google, sbc100, dschuff.
pmatos requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

WebAssembly instruction arguments should have their arguments ordered from
the deepest to the shallowest on the stack.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101656

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td


Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
+++ llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
@@ -20,24 +20,24 @@
                          "table.get\t$table",
                          0x25>;
 
-  defm TABLE_SET_#rt : I<(outs), (ins table32_op:$table, rt:$val, I32:$i),
+  defm TABLE_SET_#rt : I<(outs), (ins table32_op:$table, I32:$i, rt:$val),
                          (outs), (ins table32_op:$table),
                          [],
-                         "table.set\t$table, $val, $i",
+                         "table.set\t$table, $i, $val",
                          "table.set\t$table",
                          0x26>;
 
-  defm TABLE_GROW_#rt : I<(outs I32:$sz), (ins table32_op:$table, I32:$n, rt:$val),
+  defm TABLE_GROW_#rt : I<(outs I32:$sz), (ins table32_op:$table, rt:$val, I32:$n),
                           (outs), (ins table32_op:$table),
                           [],
-                          "table.grow\t$sz, $table, $n, $val",
+                          "table.grow\t$sz, $table, $val, $n",
                           "table.grow\t$table",
                           0xfc0f>;
 
-  defm TABLE_FILL_#rt : I<(outs), (ins table32_op:$table, I32:$n, rt:$val, I32:$i),
+  defm TABLE_FILL_#rt : I<(outs), (ins table32_op:$table, I32:$i, rt:$val, I32:$n),
                           (outs), (ins table32_op:$table),
                           [],
-                          "table.fill\t$table, $n, $val, $i",
+                          "table.fill\t$table, $i, $val, $n",
                           "table.fill\t$table",
                           0xfc11>;
 
@@ -55,10 +55,10 @@
                     Requires<[HasReferenceTypes]>;
 
 
-defm TABLE_COPY : I<(outs), (ins table32_op:$table1, table32_op:$table2, I32:$n, I32:$s, I32:$d),
+defm TABLE_COPY : I<(outs), (ins table32_op:$table1, table32_op:$table2, I32:$d, I32:$s, I32:$n),
                     (outs), (ins table32_op:$table1, table32_op:$table2),
                     [],
-                    "table.copy\t$table1, $table2, $n, $s, $d",
+                    "table.copy\t$table1, $table2, $d, $s, $n",
                     "table.copy\t$table1, $table2",
                     0xfc0e>,
                     Requires<[HasReferenceTypes]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101656.342003.patch
Type: text/x-patch
Size: 2370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210430/bda4b4f0/attachment.bin>


More information about the llvm-commits mailing list