Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick eadaef581c29 #49401

Merged
merged 1 commit into from Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.14',
'v8_embedder_string': '-node.15',

##### V8 defaults for Node.js #####

Expand Down
19 changes: 17 additions & 2 deletions deps/v8/src/codegen/s390/macro-assembler-s390.cc
Expand Up @@ -2906,8 +2906,23 @@ void MacroAssembler::MulS64(Register dst, const MemOperand& opnd) {
}

void MacroAssembler::MulHighS64(Register dst, Register src1, Register src2) {
mgrk(r0, src1, src2);
lgr(dst, r0);
if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
mgrk(r0, src1, src2);
lgr(dst, r0);
} else {
SaveFPRegsMode fp_mode = SaveFPRegsMode::kSave;
PushCallerSaved(fp_mode, ip);
Push(src1, src2);
Pop(r2, r3);
{
FrameScope scope(this, StackFrame::INTERNAL);
PrepareCallCFunction(2, 0, r0);
CallCFunction(ExternalReference::int64_mul_high_function(), 2, 0);
}
mov(r0, r2);
PopCallerSaved(fp_mode, ip);
mov(dst, r0);
}
}

void MacroAssembler::MulHighS64(Register dst, Register src1,
Expand Down
28 changes: 9 additions & 19 deletions deps/v8/src/compiler/backend/s390/code-generator-s390.cc
Expand Up @@ -1699,15 +1699,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kS390_Mul64WithOverflow: {
Register dst = i.OutputRegister(), src1 = i.InputRegister(0),
src2 = i.InputRegister(1);
DCHECK(!AreAliased(dst, src1, src2));
CHECK(!AreAliased(dst, src1, src2));
if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
__ msgrkc(dst, src1, src2);
} else {
__ mgrk(r0, src1, src2); // r0 = high 64-bits, r1 = low 64-bits.
__ lgr(dst, r1);
__ ShiftRightS64(r1, r1, Operand(63));
// Mul high.
__ MulHighS64(r1, src1, src2);
// Mul low.
__ mov(dst, src1);
__ MulS64(dst, src2);
// Test whether {high} is a sign-extension of {result}.
__ CmpU64(r0, r1);
__ ShiftRightS64(r0, dst, Operand(63));
__ CmpU64(r1, r0);
}
break;
}
Expand All @@ -1725,20 +1728,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
ASSEMBLE_BIN_OP(RRRInstr(MulHighU64), nullInstr, nullInstr);
break;
case kS390_MulHighS64:
if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
ASSEMBLE_BIN_OP(RRRInstr(MulHighS64), nullInstr, nullInstr);
} else {
__ Push(r2, r3, i.InputRegister(0), i.InputRegister(1));
__ Pop(r2, r3);
{
FrameScope scope(masm(), StackFrame::INTERNAL);
__ PrepareCallCFunction(2, 0, kScratchReg);
__ CallCFunction(ExternalReference::int64_mul_high_function(), 2, 0);
}
__ mov(kScratchReg, r2);
__ Pop(r2, r3);
__ mov(i.OutputRegister(), kScratchReg);
}
ASSEMBLE_BIN_OP(RRRInstr(MulHighS64), nullInstr, nullInstr);
break;
case kS390_MulFloat:
ASSEMBLE_BIN_OP(DDInstr(meebr), DMTInstr(MulFloat32), nullInstr);
Expand Down