s390x: [liftoff] update emit_cond_jump

Change-Id: I38197dc313b049a612fb34472db3b647990747dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2715086
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72978}
This commit is contained in:
Junliang Yan 2021-02-23 12:30:10 -05:00 committed by Commit Bot
parent b5fcbda3d0
commit 25bc68544a

View File

@ -1176,38 +1176,37 @@ void LiftoffAssembler::emit_cond_jump(LiftoffCondition liftoff_cond,
Condition cond = liftoff::ToCondition(liftoff_cond);
bool use_signed = liftoff::UseSignedOp(liftoff_cond);
if (type.kind() == kI32) {
if (rhs == no_reg) {
if (use_signed) {
CmpS32(lhs, Operand::Zero());
} else {
CmpU32(lhs, Operand::Zero());
}
} else {
if (use_signed) {
CmpS32(lhs, rhs);
} else {
CmpU32(lhs, rhs);
}
if (rhs != no_reg) {
switch (type.kind()) {
case kI32:
if (use_signed) {
CmpS32(lhs, rhs);
} else {
CmpU32(lhs, rhs);
}
break;
case kRef:
case kOptRef:
case kRtt:
case kRttWithDepth:
DCHECK(liftoff_cond == kEqual || liftoff_cond == kUnequal);
V8_FALLTHROUGH;
case kI64:
if (use_signed) {
CmpS64(lhs, rhs);
} else {
CmpU64(lhs, rhs);
}
break;
default:
UNREACHABLE();
}
} else {
CHECK(type.kind() == kI64 || type.kind() == kOptRef ||
type.kind() == kRtt || type.kind() == kRttWithDepth ||
type.kind() == kRef);
if (rhs == no_reg) {
if (use_signed) {
CmpS64(lhs, Operand::Zero());
} else {
CmpU64(lhs, Operand::Zero());
}
} else {
if (use_signed) {
CmpS64(lhs, rhs);
} else {
CmpU64(lhs, rhs);
}
}
DCHECK_EQ(type, kWasmI32);
CHECK(use_signed);
CmpS32(lhs, Operand::Zero());
}
b(cond, label);
}