Commit 10b023c1 authored by ivica.bogosavljevic's avatar ivica.bogosavljevic Committed by Commit bot

MIPS: Fix long branches being emitted mistakenly in floating-point branches

Due to a typo, long branches were emitted instead of short branches, and the
code would stop working at all in the situation when long branches must be
emitted. This patche fixes this issue.

TEST=mjsunit/wasm/embenchen/lua_binarytrees
BUG=

Review-Url: https://codereview.chromium.org/2351143002
Cr-Commit-Position: refs/heads/master@{#39552}
parent 4dab7b5a
......@@ -2159,7 +2159,7 @@ void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
// Check for unordered (NaN) cases.
if (nan) {
bool long_branch =
nan->is_bound() ? is_near(nan) : is_trampoline_emitted();
nan->is_bound() ? !is_near(nan) : is_trampoline_emitted();
if (!IsMipsArchVariant(kMips32r6)) {
if (long_branch) {
Label skip;
......@@ -2198,7 +2198,7 @@ void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
if (target) {
bool long_branch =
target->is_bound() ? is_near(target) : is_trampoline_emitted();
target->is_bound() ? !is_near(target) : is_trampoline_emitted();
if (long_branch) {
Label skip;
Condition neg_cond = NegateFpuCondition(cond);
......
......@@ -2379,7 +2379,8 @@ void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
DCHECK(nan || target);
// Check for unordered (NaN) cases.
if (nan) {
bool long_branch = nan->is_bound() ? is_near(nan) : is_trampoline_emitted();
bool long_branch =
nan->is_bound() ? !is_near(nan) : is_trampoline_emitted();
if (kArchVariant != kMips64r6) {
if (long_branch) {
Label skip;
......@@ -2419,7 +2420,7 @@ void MacroAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
if (target) {
bool long_branch =
target->is_bound() ? is_near(target) : is_trampoline_emitted();
target->is_bound() ? !is_near(target) : is_trampoline_emitted();
if (long_branch) {
Label skip;
Condition neg_cond = NegateFpuCondition(cond);
......
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