RFR: 8369123: Still more small Float16 refactorings [v2]
Eirik Bjørsnøs
eirbjo at openjdk.org
Sat Oct 4 07:06:45 UTC 2025
On Fri, 3 Oct 2025 22:12:19 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Upon further inspection, found a few more opportunities to refine the use of constants in the Float16 implementation.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove unneeded use of "Float16.".
// Currently Float16 is a value-based class and in future it is
in _the_ future
// IEEEremainder / remainder operator remainder
Would one remainder suffice for this remainder reminder?
private final short value;
Consider adding a field comment to align with Float, Double and friends.
private static final Float16 ZERO = valueOf(0);
Other private implementation constants in this class have comments. These would be rather obvious, but perheps we can consider adding them just for consistency?
Should we consider ordering private vs. public constructors? Now they seem a bit mingled, making it harder for the eye to scan the public API of the class.
Line 372:
return new Float16((short)(sign_bit | 0x7c00));
`0x7c00` here is `EXP_BIT_MASK`, right?
// toHexString, line 288:
return s.replaceFirst("p-1022$", "p-14");
Are we okay to invoke regex from such low level code?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27625#issuecomment-3367978726
More information about the core-libs-dev
mailing list