On Tue, 7 Jan 2025 23:06:39 GMT, Chen Liang <[email protected]> wrote:

>> src/java.base/share/classes/jdk/internal/util/HexDigits.java line 204:
>> 
>>> 202:      */
>>> 203:     public static long hex8(long i) {
>>> 204:         long x = Long.expand(i, 0x0F0F_0F0F_0F0F_0F0FL);
>> 
>> x86 should use  pepd - but aarch64?
>
> Seems there is no good way to do so on aarch; raw shifts and going through 
> VPU both seem to be slower.

On both machines I'm testing here, AArch64 and x86, vector expand isn't being 
used. We do have intrinsics for `Long.expand()` on all AArch64, but they're not 
always efficient. 
AArch64 (all versions) can do the binary to hex string in just a few 
instructions, but you won't get there via a generalized expand.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22942#discussion_r3074687181

Reply via email to