- Fix the Macroassembler::TruncatingDiv to compute
the correct result even when the magic number is negative.
- Fix the MULT instruction in the simulator.
TEST=mjsunit/compiler/division-by-constant
BUG=
R=dusan.milosavljevic@imgtec.com
Review URL: https://codereview.chromium.org/
637273002
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24475
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
DCHECK(!result.is(at));
base::MagicNumbersForDivision<uint32_t> mag =
base::SignedDivisionByConstant(static_cast<uint32_t>(divisor));
- li(at, Operand(mag.multiplier));
+ li(at, Operand(static_cast<int32_t>(mag.multiplier)));
Mulh(result, dividend, Operand(at));
bool neg = (mag.multiplier & (static_cast<uint32_t>(1) << 31)) != 0;
if (divisor > 0 && neg) {
// regs.
// TODO(plind) - make the 32-bit MULT ops conform to spec regarding
// checking of 32-bit input values, and un-define operations of HW.
- *i64hilo = static_cast<int64_t>((int32_t)rs) *
- static_cast<int64_t>((int32_t)rt);
+ *i64hilo = rs * rt;
break;
case MULTU:
*u64hilo = static_cast<uint64_t>(rs_u) * static_cast<uint64_t>(rt_u);