v8/test/mjsunit/regress/wasm/regress-1283395.js
Clemens Backes 3643b9e7c5 [compiler] Fix spilling of SIMD registers on merge
This is similar to the previous SIMD spilling fixes, but this time at
block merges. The logic is similar to the existing cases, but not quite
the same. I did not find a nice way to unify the different locations
where we check for SIMD register overlap.

R=thibaudm@chromium.org

Bug: chromium:1283395, v8:12330
Change-Id: I5ab9b6831368cbce40b8368e4ec7954e985bff96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3404780
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78720}
2022-01-21 15:59:36 +00:00

52 lines
2.2 KiB
JavaScript

// Copyright 2022 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.addMemory(16, 32, false);
// Generate function 1 (out of 3).
builder.addFunction(undefined, makeSig([kWasmI32, kWasmI32, kWasmI32], []))
.addLocals(kWasmS128, 1)
.addBody([
kExprTry, kWasmVoid, // try i32
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // f64.const
kExprI32Const, 0x00, // i32.const
kSimdPrefix, kExprI8x16Splat, // i8x16.splat
kExprLocalTee, 0x03, // local.tee
kExprCallFunction, 2, // call function #2
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // f64.const
kExprLocalGet, 0x03, // local.get
kExprCallFunction, 2, // call function #2
kExprTry, kWasmVoid, // try
kExprLocalGet, 0x03, // local.get
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // f64.const
kExprF32Const, 0x00, 0x00, 0x00, 0x00, // f32.const
kExprCallFunction, 1, // call function #1
kExprCatchAll, // catch-all
kExprEnd, // end
kExprI32Const, 0x00, // i32.const
kExprI32Const, 0x00, // i32.const
kExprI32Const, 0x00, // i32.const
kAtomicPrefix, kExprI32AtomicCompareExchange16U, 0x01, 0x80, 0x80, 0xc0, 0x9b, 0x07, // i32.atomic.cmpxchng16_u
kExprDrop, // drop
kExprCatchAll, // catch-all
kExprEnd, // end
kExprI32Const, 0x00, // i32.const
kSimdPrefix, kExprI8x16Splat, // i8x16.splat
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // f64.const
kExprF32Const, 0x00, 0x00, 0x00, 0x00, // f32.const
kExprCallFunction, 1, // call function #1
]);
// Generate function 2 (out of 3).
builder.addFunction(undefined, makeSig([kWasmS128, kWasmF64, kWasmF32], []))
.addBody([kExprUnreachable]);
// Generate function 3 (out of 3).
builder.addFunction(undefined, makeSig([kWasmF64, kWasmS128], [])).addBody([
kExprUnreachable
]);
builder.toModule();