Commit 4c92f23c authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][ia32] Fix load lane and run spec tests

Load lanes require that dst == src1 when AVX is not supported, add that
constraint to the instruction selector. For Liftoff, we change the macro
defintions of Movlps and Movhps to do the move if dst != src1.

Bug: v8:10975
Change-Id: Ic4f499845f0728db250ea23b1b053e0a9fbe99b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2708825Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72936}
parent 1bd29073
......@@ -473,10 +473,26 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
AVX_PACKED_OP3_WITH_TYPE(Psraw, psraw, XMMRegister, uint8_t)
AVX_PACKED_OP3_WITH_TYPE(Psrad, psrad, XMMRegister, uint8_t)
AVX_PACKED_OP3_WITH_TYPE(Movlps, movlps, XMMRegister, Operand)
AVX_PACKED_OP3_WITH_TYPE(Movhps, movhps, XMMRegister, Operand)
#undef AVX_PACKED_OP3_WITH_TYPE
// Macro for instructions that have 2 operands for AVX version and 1 operand for
// SSE version. Will move src1 to dst if dst != src1.
#define AVX_OP3_WITH_MOVE(macro_name, name, dst_type, src_type) \
void macro_name(dst_type dst, dst_type src1, src_type src2) { \
if (CpuFeatures::IsSupported(AVX)) { \
CpuFeatureScope scope(this, AVX); \
v##name(dst, src1, src2); \
} else { \
if (dst != src1) { \
movaps(dst, src1); \
} \
name(dst, src2); \
} \
}
AVX_OP3_WITH_MOVE(Movlps, movlps, XMMRegister, Operand)
AVX_OP3_WITH_MOVE(Movhps, movhps, XMMRegister, Operand)
#undef AVX_OP3_WITH_MOVE
// Non-SSE2 instructions.
#define AVX_OP2_WITH_TYPE_SCOPE(macro_name, name, dst_type, src_type, \
sse_scope) \
......
......@@ -432,7 +432,8 @@ void InstructionSelector::VisitLoadLane(Node* node) {
}
IA32OperandGenerator g(this);
InstructionOperand outputs[] = {g.DefineAsRegister(node)};
InstructionOperand outputs[] = {IsSupported(AVX) ? g.DefineAsRegister(node)
: g.DefineSameAsFirst(node)};
// Input 0 is value node, 1 is lane idx, and GetEffectiveAddressMemoryOperand
// uses up to 3 inputs. This ordering is consistent with other operations that
// use the same opcode.
......
......@@ -37,13 +37,6 @@
# This test requires the reftypes flag to be disabled.
'proposals/bulk-memory-operations/imports': [FAIL],
# TODO(v8:11331): Remove once nosse is fixed.
'proposals/simd/simd_boolean': [FAIL, PASS],
'proposals/simd/simd_load16_lane': [FAIL, PASS],
'proposals/simd/simd_load32_lane': [FAIL, PASS],
'proposals/simd/simd_load64_lane': [FAIL, PASS],
'proposals/simd/simd_load8_lane': [FAIL, PASS],
# TODO(v8:11401): Fix memory64 spec tests / the v8 implementation (whatever
# is broken).
'proposals/memory64/address64': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment