Commit 96e72459 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[ia32][x64][wasm] Do not require dst == lhs for i64x2.mul

There is a bit of a contradictory register requirement in the
instruction selector for i64x2.mul. We want dst == lhs (when AVX not
supported), but we also want lhs and rhs to be unique (to ensure that
that they don't alias the temp).

We remove the requirement for dst == lhs, since the code gen can handle
both cases (dst == lhs, dst != lhs), at the expense of 1 movaps.

Bug: chromium:1264462
Change-Id: Ia48572412b1f6e0da3551880d8b68a03f42fe2a3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3253661
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77625}
parent 8cf49c2d
...@@ -2499,15 +2499,9 @@ void InstructionSelector::VisitI64x2Mul(Node* node) { ...@@ -2499,15 +2499,9 @@ void InstructionSelector::VisitI64x2Mul(Node* node) {
IA32OperandGenerator g(this); IA32OperandGenerator g(this);
InstructionOperand temps[] = {g.TempSimd128Register(), InstructionOperand temps[] = {g.TempSimd128Register(),
g.TempSimd128Register()}; g.TempSimd128Register()};
if (IsSupported(AVX)) { Emit(kIA32I64x2Mul, g.DefineAsRegister(node),
Emit(kIA32I64x2Mul, g.DefineAsRegister(node), g.UseUniqueRegister(node->InputAt(0)),
g.UseUniqueRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
} else {
Emit(kIA32I64x2Mul, g.DefineSameAsFirst(node),
g.UseUniqueRegister(node->InputAt(0)),
g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
}
} }
void InstructionSelector::VisitF32x4Splat(Node* node) { void InstructionSelector::VisitF32x4Splat(Node* node) {
......
...@@ -3358,7 +3358,7 @@ void InstructionSelector::VisitI64x2ShrS(Node* node) { ...@@ -3358,7 +3358,7 @@ void InstructionSelector::VisitI64x2ShrS(Node* node) {
void InstructionSelector::VisitI64x2Mul(Node* node) { void InstructionSelector::VisitI64x2Mul(Node* node) {
X64OperandGenerator g(this); X64OperandGenerator g(this);
InstructionOperand temps[] = {g.TempSimd128Register()}; InstructionOperand temps[] = {g.TempSimd128Register()};
Emit(kX64I64x2Mul, g.DefineSameAsFirst(node), Emit(kX64I64x2Mul, g.DefineAsRegister(node),
g.UseUniqueRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(0)),
g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
} }
......
...@@ -895,6 +895,7 @@ ...@@ -895,6 +895,7 @@
'regress/wasm/regress-1187831': [SKIP], 'regress/wasm/regress-1187831': [SKIP],
'regress/wasm/regress-1199662': [SKIP], 'regress/wasm/regress-1199662': [SKIP],
'regress/wasm/regress-1231950': [SKIP], 'regress/wasm/regress-1231950': [SKIP],
'regress/wasm/regress-1264462': [SKIP],
'regress/regress-1172797': [SKIP], 'regress/regress-1172797': [SKIP],
'regress/wasm/regress-1179025': [SKIP], 'regress/wasm/regress-1179025': [SKIP],
'wasm/multi-value-simd': [SKIP], 'wasm/multi-value-simd': [SKIP],
...@@ -1460,6 +1461,7 @@ ...@@ -1460,6 +1461,7 @@
'regress/wasm/regress-1237024': [SKIP], 'regress/wasm/regress-1237024': [SKIP],
'regress/wasm/regress-1242300': [SKIP], 'regress/wasm/regress-1242300': [SKIP],
'regress/wasm/regress-1242689': [SKIP], 'regress/wasm/regress-1242689': [SKIP],
'regress/wasm/regress-1264462': [SKIP],
}], # no_simd_hardware == True }], # no_simd_hardware == True
############################################################################## ##############################################################################
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-liftoff --turbo-force-mid-tier-regalloc
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
const builder = new WasmModuleBuilder();
builder.addFunction('main', kSig_i_v).addBody([
kExprI32Const, 0, // i32.const
kSimdPrefix, kExprI8x16Splat, // i8x16.splat
kExprI32Const, 0, // i32.const
kSimdPrefix, kExprI8x16Splat, // i8x16.splat
kSimdPrefix, kExprI64x2Mul, 0x01, // i64x2.mul
kSimdPrefix, kExprI8x16ExtractLaneS, 0x00, // i8x16.extract_lane_s
]);
builder.toModule();
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