Re: PR64182: Fix rounding division and modulus

2014-12-12 Thread Richard Sandiford
Richard Biener writes: > On Thu, Dec 11, 2014 at 1:26 PM, Richard Sandiford > wrote: >> As pointed out in PR 64182, wide-int rounded division gets the >> ties-away-from-zero case wrong for odd-numbered dividends, while >> double_int gets the unsigned case wrong by unconditionally treating >> a di

Re: PR64182: Fix rounding division and modulus

2014-12-11 Thread Richard Biener
On Thu, Dec 11, 2014 at 1:26 PM, Richard Sandiford wrote: > As pointed out in PR 64182, wide-int rounded division gets the > ties-away-from-zero case wrong for odd-numbered dividends, while > double_int gets the unsigned case wrong by unconditionally treating > a dividend or remainder with the top

PR64182: Fix rounding division and modulus

2014-12-11 Thread Richard Sandiford
As pointed out in PR 64182, wide-int rounded division gets the ties-away-from-zero case wrong for odd-numbered dividends, while double_int gets the unsigned case wrong by unconditionally treating a dividend or remainder with the top bit set as negative. As Jakub says, the test used in double_int m