This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: divide 64-bit by constant for 32-bit target machines


Hi,
Here is updated version of patch. I added comments describing the algorithm.

> Hi Dinar. ?I'm afraid it gives the wrong results for some dividends
> ?* 82625484914982912 / 2023346444509052928: gives 4096, should be zero
> ?* 18317463604061229328 / 2023346444509052928: gives 4109, should be 9
> ?* 12097415865295708879 / 4545815675034402816: gives 130, should be 2
> ?* 18195490362097456014 / 6999635335417036800: gives 10, should be 2
Oh, I have used signed multiplication instead of unsigned and that was
the reason of errors above, fixed that typo.
Tested on arm-7l with no new regressions.
Ok for trunk?

thanks, Dinar.

Attachment: 14.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]