[PATCH] D53097: [WebAssembly][NFC] Use vnot patfrag to simplify v128.not

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 12:11:28 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344175: [WebAssembly][NFC] Use vnot patfrag to simplify v128.not (authored by tlively, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D53097

Files:
  llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td


Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
@@ -508,23 +508,16 @@
 } // isCommutable = 1
 
 // Bitwise logic: v128.not
-multiclass SIMDNot<ValueType vec_t, PatFrag splat_pat, ValueType lane_t> {
-  defm NOT_#vec_t : SIMD_I<(outs V128:$dst), (ins V128:$vec),
-                           (outs), (ins),
-                           [(set
-                             (vec_t V128:$dst),
-                             (vec_t (xor
-                               (vec_t V128:$vec),
-                               (vec_t (splat_pat (lane_t -1)))
-                             ))
-                           )],
+multiclass SIMDNot<ValueType vec_t> {
+  defm NOT_#vec_t : SIMD_I<(outs V128:$dst), (ins V128:$vec), (outs), (ins),
+                           [(set (vec_t V128:$dst), (vec_t (vnot V128:$vec)))],
                            "v128.not\t$dst, $vec", "v128.not", 63>;
 }
 
-defm "" : SIMDNot<v16i8, splat16, i32>;
-defm "" : SIMDNot<v8i16, splat8, i32>;
-defm "" : SIMDNot<v4i32, splat4, i32>;
-defm "" : SIMDNot<v2i64, splat2, i64>;
+defm "" : SIMDNot<v16i8>;
+defm "" : SIMDNot<v8i16>;
+defm "" : SIMDNot<v4i32>;
+defm "" : SIMDNot<v2i64>;
 
 // Bitwise select: v128.bitselect
 def wasm_bitselect_t : SDTypeProfile<1, 3,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53097.169070.patch
Type: text/x-patch
Size: 1441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181010/253b20fb/attachment.bin>


More information about the llvm-commits mailing list