Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-02-28 Thread Daniel JeliƄski
On Mon, 22 Jan 2024 18:52:32 GMT, fabioromano1 wrote: >> As you note, that would probably require two divisions. I don't know if the >> JIT compiler can detect that the arguments are the same and emit just one >> division instead. >> I think your code is good enough for the purpose of

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 18:07:49 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > As you note, that would probably require two divisions. I don't know if the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 18:07:49 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > As you note, that would probably require two divisions. I don't know if the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 wrote: >> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of >> Hacker's Delight (2nd ed), section 9.3, the same used in >> `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, >> to get the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 17:23:22 GMT, Raffaello Giulietti wrote: > AFAIK, IntrinsicCandidate methods are only relevant in JIT compiled code. A > test that checks correctness might not reach the compilation stage, and > execute only in the bytecode interpreter. > > But IMO using the result of

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 wrote: >> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of >> Hacker's Delight (2nd ed), section 9.3, the same used in >> `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, >> to get the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 16:15:57 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > What about splitting the result of `divWord()` into its components `q` and >

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 wrote: >> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of >> Hacker's Delight (2nd ed), section 9.3, the same used in >> `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, >> to get the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 15:38:08 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > Sure. But the purpose of a test is not much to check the _current_ code but

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 15:38:08 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > Sure. But the purpose of a test is not much to check the _current_ code but

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 wrote: >> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of >> Hacker's Delight (2nd ed), section 9.3, the same used in >> `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, >> to get the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread fabioromano1
On Mon, 22 Jan 2024 15:14:58 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed trailing whitespaces > > The test does not seem to check that the results are correct, but just >

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-22 Thread Raffaello Giulietti
On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 wrote: >> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of >> Hacker's Delight (2nd ed), section 9.3, the same used in >> `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, >> to get the

Re: RFR: JDK-8323186: A faster algorithm for MutablebigInteger.divWord(long, int) [v3]

2024-01-09 Thread fabioromano1
> The method `MutableBigInteger.divWord(long, int)` can use the algorithm of > Hacker's Delight (2nd ed), section 9.3, the same used in > `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`, > to get the computation faster. fabioromano1 has updated the pull request