diff options
| author | Thomas Lively <tlively@google.com> | 2019-10-31 16:49:47 -0700 |
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-10-31 20:22:11 -0700 |
| commit | a07019a275cd0deb59433ac59e4faa85d0722822 (patch) | |
| tree | 4991b5badd6d2ddbf8df61c238e500036a951906 /llvm/lib | |
| parent | 10c1d0a452b561a9a0586e994f52066734316224 (diff) | |
| download | bcm5719-llvm-a07019a275cd0deb59433ac59e4faa85d0722822.tar.gz bcm5719-llvm-a07019a275cd0deb59433ac59e4faa85d0722822.zip | |
[WebAssembly] SIMD integer min and max instructions
Summary:
Introduces a clang builtins and LLVM intrinsics representing integer
min/max instructions. These instructions have not been merged to the
SIMD spec proposal yet, so they are currently opt-in only via builtins
and not produced by general pattern matching. If these instructions
are accepted into the spec proposal the builtins and intrinsics will
be replaced with normal pattern matching.
Defined in https://github.com/WebAssembly/simd/pull/27.
Reviewers: aheejin
Reviewed By: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D69696
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index 751c565d37f..2a423acc301 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -727,8 +727,17 @@ defm SUB_SAT_U : SIMDBinaryIntSmall<int_wasm_sub_saturate_unsigned, "sub_saturate_u", 92>; // Integer multiplication: mul +let isCommutable = 1 in defm MUL : SIMDBinaryIntNoI64x2<mul, "mul", 93>; +// Integer min_s / min_u / max_s / max_u +let isCommutable = 1 in { +defm MIN_S : SIMDBinaryIntNoI64x2<int_wasm_min_signed, "min_s", 94>; +defm MIN_U : SIMDBinaryIntNoI64x2<int_wasm_min_unsigned, "min_u", 95>; +defm MAX_S : SIMDBinaryIntNoI64x2<int_wasm_max_signed, "max_s", 96>; +defm MAX_U : SIMDBinaryIntNoI64x2<int_wasm_max_unsigned, "max_u", 97>; +} // isCommutable = 1 + //===----------------------------------------------------------------------===// // Floating-point unary arithmetic //===----------------------------------------------------------------------===// |

