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

Raffaello Giulietti rgiulietti at openjdk.org
Mon Jan 22 17:26:28 UTC 2024


On Tue, 9 Jan 2024 18:24:49 GMT, fabioromano1 <duke at openjdk.org> 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 computation faster.
>
> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Removed trailing whitespaces

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 `divWord()` as suggested is simple enough and avoids hidden dependencies.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17291#issuecomment-1904466691


More information about the core-libs-dev mailing list