WebAssembly / simd

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

i64x2.gt_u, i64x2.lt_u, i64x2.ge_u, and i64x2.le_u instructions #414

Closed Maratyszcza closed 3 years ago

Maratyszcza commented 3 years ago

Introduction

This is proposal to add 64-bit variant of existing gt_u, lt_u, ge_u, and le_u instructions. ARM64 and x86-64 XOP natively support these instructions, but on other instruction sets they need to be emulated. On SSE4.2 emulation costs 5-6 instructions, but on older SSE extension and on ARMv7 NEON the emulation cost is more significant.

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, AVX512DQ, 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 SSE2 instruction set

Based on this answer by user aqrit on Stack Overflow

ARM64 processors

ARMv7 processors with NEON instruction set

abrown commented 3 years ago

See https://github.com/WebAssembly/simd/pull/412#issuecomment-758243737.

dtig commented 3 years ago

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

šŸ‘ For including i64x2 unsigned comparison operations šŸ‘Ž Against including i64x2 unsigned comparison operations

dtig commented 3 years ago

Closing as per #436.