Home | History | Annotate | Download | only in arm64

Lines Matching full:divisor

2535   int32_t divisor = instr->divisor();
2537 DCHECK(divisor == kMinInt || base::bits::IsPowerOfTwo32(Abs(divisor)));
2542 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
2546 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
2554 divisor != 1 && divisor != -1) {
2555 int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
2560 if (divisor == -1) { // Nice shortcut, not needed for correctness.
2564 int32_t shift = WhichPowerOf2Abs(divisor);
2574 if (divisor < 0) __ Neg(result, result);
2580 int32_t divisor = instr->divisor();
2584 if (divisor == 0) {
2591 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
2595 __ TruncatingDiv(result, dividend, Abs(divisor));
2596 if (divisor < 0) __ Neg(result, result);
2602 __ Mov(temp, divisor);
2613 Register divisor = ToRegister32(instr->divisor());
2618 __ Sdiv(result, dividend, divisor);
2627 DeoptimizeIfZero(divisor, instr, Deoptimizer::kDivisionByZero);
2632 __ Cmp(divisor, 0);
2634 // If the divisor < 0 (mi), compare the dividend, and deopt if it is
2635 // zero, ie. zero dividend with negative divisor deopts.
2636 // If the divisor >= 0 (pl, the opposite of mi) set the flags to
2637 // condition ne, so we don't deopt, ie. positive divisor doesn't deopt.
2647 // If overflow is set, ie. dividend = kMinInt, compare the divisor with
2650 __ Ccmp(divisor, -1, NoFlag, vs);
2656 __ Msub(remainder, result, divisor, dividend);
3608 int32_t divisor = instr->divisor();
3610 // If the divisor is 1, return the dividend.
3611 if (divisor == 1) {
3616 // If the divisor is positive, things are easy: There can be no deopts and we
3618 int32_t shift = WhichPowerOf2Abs(divisor);
3619 if (divisor > 1) {
3624 // If the divisor is negative, we have to negate and handle edge cases.
3631 if (divisor == -1) {
3645 __ Csel(result, result, kMinInt / divisor, vc);
3651 int32_t divisor = instr->divisor();
3655 if (divisor == 0) {
3662 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
3668 if ((divisor > 0 && !hdiv->CheckFlag(HValue::kLeftCanBeNegative)) ||
3669 (divisor < 0 && !hdiv->CheckFlag(HValue::kLeftCanBePositive))) {
3670 __ TruncatingDiv(result, dividend, Abs(divisor));
3671 if (divisor < 0) __ Neg(result, result);
3681 __ B(divisor > 0 ? lt : gt, &needs_adjustment);
3682 __ TruncatingDiv(result, dividend, Abs(divisor));
3683 if (divisor < 0) __ Neg(result, result);
3686 __ Add(temp, dividend, Operand(divisor > 0 ? 1 : -1));
3687 __ TruncatingDiv(result, temp, Abs(divisor));
3688 if (divisor < 0) __ Neg(result, result);
3697 Register divisor = ToRegister32(instr->divisor());
3703 __ Sdiv(result, dividend, divisor);
3706 DeoptimizeIfZero(divisor, instr, Deoptimizer::kDivisionByZero);
3712 __ Ccmp(divisor, -1, NoFlag, vs);
3718 __ Cmp(divisor, 0);
3720 // "divisor" can't be null because the code would have already been
3721 // deoptimized. The Z flag is set only if (divisor < 0) and (dividend == 0).
3728 __ Eor(remainder, dividend, divisor);
3732 __ Msub(remainder, result, divisor, dividend);
3952 int32_t divisor = instr->divisor();
3962 int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
3984 int32_t divisor = instr->divisor();
3989 if (divisor == 0) {
3994 __ TruncatingDiv(result, dividend, Abs(divisor));
3996 __ Mov(temp, Abs(divisor));
4012 Register divisor = ToRegister32(instr->right());
4016 // modulo = dividend - quotient * divisor
4017 __ Sdiv(result, dividend, divisor);
4019 DeoptimizeIfZero(divisor, instr, Deoptimizer::kDivisionByZero);
4021 __ Msub(result, result, divisor, dividend);