RFR: 8282365: Consolidate and improve division by constant idealizations [v35]
Kim Barrett
kbarrett at openjdk.org
Mon Dec 18 17:18:13 UTC 2023
On Tue, 12 Dec 2023 16:11:05 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> src/hotspot/share/opto/divnode.hpp line 40:
>>
>>> 38: template <class T>
>>> 39: void magic_divide_constants(T d, T N_neg, T N_pos, juint min_s, T& c, bool& c_ovf, juint& s);
>>> 40: void magic_divide_constants_round_down(juint d, juint& c, juint& s);
>>
>> The definitions of these are in new file divconstants.cpp. So I think these should be in divconstants.hpp.
>
> I see there are multiple cases where a header is defined in multiple source files, and these are used exclusively for `DivNode`s so putting them here seems logical.
If it were true these are only used in divnode.cpp then the declarations could
be in that file. But these are also used in the gtest. That gtest duplicates
the declaration. Better would be for it to include the suggested
divconstants.hpp.
Having examples of an unusual style doesn't mean we want more, at least not
without some fairly good reason.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/9947#discussion_r1430436221
More information about the hotspot-compiler-dev
mailing list