RFR: 8282365: Consolidate and improve division by constant idealizations [v44]
Raffaello Giulietti
rgiulietti at openjdk.org
Tue Jan 23 15:05:51 UTC 2024
On Tue, 23 Jan 2024 14:54:08 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>>> such a case, the smallest c is b and the smallest s is e, and a result meeting s >= min_s doesn't need any iterative algorithm.
>>
>> I must correct this claim, my bad.
>> A result meeting `s >= min_s` might still need an iterative algorithm if `e < min_s` and if `c` must be minimal.
>
> That is an excellent analysis. To add to the analysis, we do not really need the minimal value of `c`, since 2 values of `c` that both satisfy the inequations must give the same upper bits for all input values. As a result, for the purpose of the algorithm, they are equivalent.
>
> My concern is that it will complicate the analysis, which is complicated enough, for a minor improvement in the exit conditions.
I have no idea about the timing difference with the current exit condition or with the simplified one. It might indeed be negligible.
Anyway, there's a choice now ;-)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/9947#discussion_r1463415760
More information about the hotspot-compiler-dev
mailing list