Commit 2b01c828 authored by Vasili Skurydzin's avatar Vasili Skurydzin Committed by V8 LUCI CQ

ppc: Don't emit unsupported isns on Power8 arch

Don't emit modsd, modud, modsw, moduw if Power proc. version is less
than 9.

Change-Id: I20a33930c5887921cf1943558b3ab6ac8d8a53ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3271636Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Cr-Commit-Position: refs/heads/main@{#77830}
parent d50443b1
......@@ -2818,19 +2818,55 @@ void TurboAssembler::DivU32(Register dst, Register src, Register value, OEBit s,
}
void TurboAssembler::ModS64(Register dst, Register src, Register value) {
modsd(dst, src, value);
if (CpuFeatures::IsSupported(PPC_9_PLUS)) {
modsd(dst, src, value);
} else {
Register scratch = GetRegisterThatIsNotOneOf(dst, src, value);
Push(scratch);
divd(scratch, src, value);
mulld(scratch, scratch, value);
sub(dst, src, scratch);
Pop(scratch);
}
}
void TurboAssembler::ModU64(Register dst, Register src, Register value) {
modud(dst, src, value);
if (CpuFeatures::IsSupported(PPC_9_PLUS)) {
modud(dst, src, value);
} else {
Register scratch = GetRegisterThatIsNotOneOf(dst, src, value);
Push(scratch);
divdu(scratch, src, value);
mulld(scratch, scratch, value);
sub(dst, src, scratch);
Pop(scratch);
}
}
void TurboAssembler::ModS32(Register dst, Register src, Register value) {
modsw(dst, src, value);
if (CpuFeatures::IsSupported(PPC_9_PLUS)) {
modsw(dst, src, value);
} else {
Register scratch = GetRegisterThatIsNotOneOf(dst, src, value);
Push(scratch);
divw(scratch, src, value);
mullw(scratch, scratch, value);
sub(dst, src, scratch);
Pop(scratch);
}
extsw(dst, dst);
}
void TurboAssembler::ModU32(Register dst, Register src, Register value) {
moduw(dst, src, value);
if (CpuFeatures::IsSupported(PPC_9_PLUS)) {
moduw(dst, src, value);
} else {
Register scratch = GetRegisterThatIsNotOneOf(dst, src, value);
Push(scratch);
divwu(scratch, src, value);
mullw(scratch, scratch, value);
sub(dst, src, scratch);
Pop(scratch);
}
ZeroExtWord32(dst, dst);
}
......
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