WebAssembly / simd

Branch of the spec repo scoped to discussion of SIMD in WebAssembly
Other
531 stars 43 forks source link

i64x2.min_u and i64x2.max_u instructions #418

Closed Maratyszcza closed 3 years ago

Maratyszcza commented 3 years ago

Introduction

This is proposal to add 64-bit variant of the existing min_u and max_u instructions. Only x86 processors with AVX512 natively support these instructions.

Applications

Mapping to Common Instruction Sets

This section illustrates how the new WebAssembly instructions can be lowered on common instruction sets. However, these patterns are provided only for convenience, compliant WebAssembly implementations do not have to follow the same code generation patterns.

x86/x86-64 processors with AVX512F and AVX512VL instruction sets

x86/x86-64 processors with XOP instruction set

x86/x86-64 processors with AVX instruction set

x86/x86-64 processors with SSE4.2 instruction set

x86/x86-64 processors with SSE4.1 instruction set

Based on this answer by user aqrit on Stack Overflow

x86/x86-64 processors with SSE2 instruction set

Based on this answer by user aqrit on Stack Overflow

ARM64 processors

ARMv7 processors with NEON instruction set

ngzhian commented 3 years ago

We will probably discuss this in the next meeting, I will like to put down my thoughts ahead of time:

abrown commented 3 years ago

Code-sequence-wise, these are rather unfortunate on a large number of x86 machines. As with #417, it might make sense to wait on these until more machines have something like VP[MIN|MAX]UQ.

penzn commented 3 years ago

Same comment as @abrown. This part seems to be a bit worse than #417.

dtig commented 3 years ago

Adding a preliminary vote for the inclusion of i64x2 unsigned min/max operations to the SIMD proposal below. Please vote with -

👍 For including i64x2 unsigned min/max operations 👎 Against including i64x2 unsigned min/max operations

Maratyszcza commented 3 years ago

The community group unanimously decided against including these instructions in the 1/29/21 meeting (#429).