Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[SIMD] Intel support for swizzle and shuffle and fix extract_lane and…
… replace_lane https://bugs.webkit.org/show_bug.cgi?id=248728 rdar://102942396 Reviewed by Yusuke Suzuki. This patch aims for three tasks: 1. Add WASM SIMD operations `swizzle` and `shuffle`. https://github.com/WebAssembly/simd/blob/main/proposals/simd/SIMD.md#shuffling-using-immediate-indices 2. Refactor MacroAssemblerX86_64.h and X86Assembler.h for `pinsr` and `pextr`, where X86Assembler should do simple instruction emission only. And MacroAssemblerX86 should select the instruction. 3. Fix WASM SIMD operation `replace_lane`. Previously, the operation is implemented with instruction `pinsr` in AVX format but only passing three parameters which is wrong. https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq https://www.felixcloutier.com/x86/pinsrw https://www.officedaytime.com/simd512e/simdimg/si.php?f=pinsrb https://www.officedaytime.com/simd512e/simdimg/si.php?f=pinsrw https://www.officedaytime.com/simd512e/simdimg/si.php?f=pinsrd https://www.officedaytime.com/simd512e/simdimg/si.php?f=pinsrq * Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::vectorReplaceLane): (JSC::MacroAssemblerX86_64::vectorExtractLane): (JSC::MacroAssemblerX86_64::vectorSwizzle): * Source/JavaScriptCore/assembler/X86Assembler.h: (JSC::X86Assembler::pinsrb): (JSC::X86Assembler::pinsrw): (JSC::X86Assembler::pinsrd): (JSC::X86Assembler::pinsrq): (JSC::X86Assembler::insertps): (JSC::X86Assembler::unpcklpd): (JSC::X86Assembler::vpextrb): (JSC::X86Assembler::vpextrw): (JSC::X86Assembler::vpextrd): (JSC::X86Assembler::vpextrq): (JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM): (JSC::X86Assembler::pinsr): Deleted. (JSC::X86Assembler::pextr): Deleted. (JSC::X86Assembler::vextractps): Deleted. * Source/JavaScriptCore/b3/air/AirOpcode.opcodes: * Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::addReplaceLane): Canonical link: https://commits.webkit.org/257400@main
- Loading branch information