[llvm] cd460c4 - [WebAssembly] Fixup order of ins variables for table instructions

Thomas Lively via llvm-commits llvm-commits at lists.llvm.org
Mon May 3 13:04:58 PDT 2021


Author: Paulo Matos
Date: 2021-05-03T13:04:51-07:00
New Revision: cd460c4d11eeeca485353ad6a1961b543980b664

URL: https://github.com/llvm/llvm-project/commit/cd460c4d11eeeca485353ad6a1961b543980b664
DIFF: https://github.com/llvm/llvm-project/commit/cd460c4d11eeeca485353ad6a1961b543980b664.diff

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

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
index 97638c3494aeb..8fa80ad40995f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrTable.td
@@ -20,24 +20,24 @@ multiclass TABLE<WebAssemblyRegClass rt> {
                          "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 @@ defm TABLE_SIZE : I<(outs I32:$sz), (ins table32_op:$table),
                     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]>;


        


More information about the llvm-commits mailing list