Commit 7f9c35d4 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[maglev] Emit BranchIfFloat64Compare

Duplicate the logic of trying to build Int32 comparisons to also try to
build Float64 comparisons if preceeding a branch. Also, make sure to do
the opposite (emit a tagged value) for the internalized string compare
case.

Bug: v8:7700
Change-Id: Ib34761fa0fdc26d4ad9b6adb960b0b17ec8e1f21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3762582Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81742}
parent f3c52370
......@@ -491,7 +491,19 @@ void MaglevGraphBuilder::VisitCompareOperation() {
break;
case CompareOperationHint::kNumber:
if (BinaryOperationHasFloat64FastPath<kOperation>()) {
BuildFloat64BinaryOperationNode<kOperation>();
ValueNode *left, *right;
if (IsRegisterEqualToAccumulator(0)) {
left = right = LoadRegisterFloat64(0);
} else {
left = LoadRegisterFloat64(0);
right = GetAccumulatorFloat64();
}
if (TryBuildCompareOperation<BranchIfFloat64Compare>(kOperation, left,
right)) {
return;
}
SetAccumulator(
AddNewFloat64BinaryOperationNode<kOperation>({left, right}));
return;
// } else if (BinaryOperationHasInt32FastPath<kOperation>()) {
// // Fall back to int32 fast path if there is one (this will be the
......@@ -515,7 +527,8 @@ void MaglevGraphBuilder::VisitCompareOperation() {
right)) {
return;
}
break;
SetAccumulator(AddNewNode<TaggedEqual>({left, right}));
return;
default:
// Fallback to generic node.
break;
......
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