forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: Merged: [wasm][liftoff] Fix register usage for i64_addi The arm implementation made the assumption that the {lhs} and {dst} registers are either the same, or there is no overlap. This assumption does not hold. ia32 on the other hand has a lot of complicated logic (and unnecessary code generation) for different cases of overlap. This CL fixes the arm issue *and* simplifies the ia32 logic by making the arm assumption hold, and using it to eliminate special handling on ia32. R=[email protected] (cherry picked from commit 89ca48c907e25ef94a135255092c4e150654c4fc) Bug: chromium:1146861 Change-Id: I96c4985fb8ff710b98e009e457444fc8804bce58 No-Try: true No-Presubmit: true No-Tree-Checks: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584242 Reviewed-by: Thibaud Michaud <[email protected]> Commit-Queue: Clemens Backes <[email protected]> Cr-Commit-Position: refs/branch-heads/8.6@{nodejs#50} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@eddb823
- Loading branch information
Showing
5 changed files
with
73 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2020 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. | ||
|
||
load('test/mjsunit/wasm/wasm-module-builder.js'); | ||
|
||
const builder = new WasmModuleBuilder(); | ||
builder.addGlobal(kWasmI32, 1); | ||
builder.addType(makeSig([], [kWasmF64])); | ||
// Generate function 1 (out of 1). | ||
builder.addFunction(undefined, 0 /* sig */) | ||
.addLocals(kWasmI32, 8).addLocals(kWasmI64, 3) | ||
.addBodyWithEnd([ | ||
// signature: d_v | ||
// body: | ||
kExprGlobalGet, 0x00, // global.get | ||
kExprLocalSet, 0x00, // local.set | ||
kExprI32Const, 0x00, // i32.const | ||
kExprI32Eqz, // i32.eqz | ||
kExprLocalSet, 0x01, // local.set | ||
kExprGlobalGet, 0x00, // global.get | ||
kExprLocalSet, 0x02, // local.set | ||
kExprI32Const, 0x01, // i32.const | ||
kExprI32Const, 0x01, // i32.const | ||
kExprI32Sub, // i32.sub | ||
kExprLocalSet, 0x03, // local.set | ||
kExprGlobalGet, 0x00, // global.get | ||
kExprLocalSet, 0x04, // local.set | ||
kExprI32Const, 0x00, // i32.const | ||
kExprI32Eqz, // i32.eqz | ||
kExprLocalSet, 0x05, // local.set | ||
kExprGlobalGet, 0x00, // global.get | ||
kExprLocalSet, 0x06, // local.set | ||
kExprI32Const, 0x00, // i32.const | ||
kExprI32Const, 0x01, // i32.const | ||
kExprI32Sub, // i32.sub | ||
kExprLocalSet, 0x07, // local.set | ||
kExprBlock, kWasmStmt, // block @45 | ||
kExprI32Const, 0x00, // i32.const | ||
kExprIf, kWasmStmt, // if @49 | ||
kExprLocalGet, 0x0a, // local.get | ||
kExprLocalSet, 0x08, // local.set | ||
kExprElse, // else @55 | ||
kExprNop, // nop | ||
kExprEnd, // end @57 | ||
kExprLocalGet, 0x08, // local.get | ||
kExprLocalSet, 0x09, // local.set | ||
kExprLocalGet, 0x09, // local.get | ||
kExprI64Const, 0xff, 0x01, // i64.const | ||
kExprI64Add, // i64.add | ||
kExprDrop, // drop | ||
kExprEnd, // end @69 | ||
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, // f64.const | ||
kExprEnd, // end @79 | ||
]); | ||
builder.instantiate(); |