Commit 64bad451 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan] Handle -0 truncation in word32->tagged rep change.

Bug: chromium:932392
Change-Id: Icf5690585303a7f61421bdfe7729823c98950d13
Reviewed-on: https://chromium-review.googlesource.com/c/1478192Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59731}
parent 0d4985d0
......@@ -467,9 +467,13 @@ Node* RepresentationChanger::GetTaggedRepresentationFor(
} else if (IsWord(output_rep)) {
if (output_type.Is(Type::Signed31())) {
op = simplified()->ChangeInt31ToTaggedSigned();
} else if (output_type.Is(Type::Signed32())) {
} else if (output_type.Is(Type::Signed32()) ||
(output_type.Is(Type::Signed32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero())) {
op = simplified()->ChangeInt32ToTagged();
} else if (output_type.Is(Type::Unsigned32()) ||
(output_type.Is(Type::Unsigned32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero()) ||
truncation.IsUsedAsWord32()) {
// Either the output is uint32 or the uses only care about the
// low 32 bits (so we can pick uint32 safely).
......
// Copyright 2019 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: --allow-natives-syntax
function opt(flag){
((flag||(Math.max(-0,0)))==0)
}
try{opt(false)}catch{}
%OptimizeFunctionOnNextCall(opt)
try{opt(false)}catch{}
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