Skip to content

Commit

Permalink
Merge pull request #3310 from yebblies/pow2
Browse files Browse the repository at this point in the history
[DDMD] Replace comment inside if condition with a better comment outside it
  • Loading branch information
9rnsr committed Feb 21, 2014
2 parents ffc1d56 + cf3037e commit 5c6a5c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,9 @@ Expression *Expression_optimize(Expression *e, int result, bool keepLvalue)
}
}

// (2 ^^ n) ^^ p -> 1 << n * p
if (e->e1->op == TOKint64 && e->e1->toInteger() > 0 &&
!((e->e1->toInteger() - 1) & e->e1->toInteger()) && // is power of two
!((e->e1->toInteger() - 1) & e->e1->toInteger()) &&
e->e2->type->isintegral() && e->e2->type->isunsigned())
{
dinteger_t i = e->e1->toInteger();
Expand Down

0 comments on commit 5c6a5c4

Please sign in to comment.