[llvm] a1b8b07 - [WebAssembly] Fix i8x16.popcnt opcode

Thomas Lively via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 17:23:25 PDT 2021


Author: Thomas Lively
Date: 2021-03-29T17:23:15-07:00
New Revision: a1b8b0739a343da61b29c408f5cbbc90a6c8659c

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

LOG: [WebAssembly] Fix i8x16.popcnt opcode

When I updated the SIMD opcodes in f5764a8654e3, I accidentally missed updating
i8x16.popcnt. This patch fixes the omission.

Differential Revision: https://reviews.llvm.org/D99536

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
    llvm/test/MC/WebAssembly/simd-encodings.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
index 9afb7a077796..8009c3bdb57d 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
@@ -832,7 +832,7 @@ defm ANYTRUE : SIMDReduce<int_wasm_anytrue, "any_true", 98>;
 defm ALLTRUE : SIMDReduce<int_wasm_alltrue, "all_true", 99>;
 
 // Population count: popcnt
-defm POPCNT : SIMDUnary<I8x16, int_wasm_popcnt, "popcnt", 124>;
+defm POPCNT : SIMDUnary<I8x16, int_wasm_popcnt, "popcnt", 0x62>;
 
 // Reductions already return 0 or 1, so and 1, setne 0, and seteq 1
 // can be folded out

diff  --git a/llvm/test/MC/WebAssembly/simd-encodings.s b/llvm/test/MC/WebAssembly/simd-encodings.s
index 1a687468487a..a1581ccd4040 100644
--- a/llvm/test/MC/WebAssembly/simd-encodings.s
+++ b/llvm/test/MC/WebAssembly/simd-encodings.s
@@ -324,7 +324,8 @@ main:
     # CHECK: i8x16.neg # encoding: [0xfd,0x61]
     i8x16.neg
 
-    # TODO: i8x16.popcnt # encoding: [0xfd,0x62]
+    # CHECK: i8x16.popcnt # encoding: [0xfd,0x62]
+    i8x16.popcnt
 
     # CHECK: i8x16.all_true # encoding: [0xfd,0x63]
     i8x16.all_true


        


More information about the llvm-commits mailing list