RFR: 8329077: C2 SuperWord: Add MoveD2L, MoveL2D, MoveF2I, MoveI2F
Bhavana Kilambi
bkilambi at openjdk.org
Mon Aug 4 20:10:09 UTC 2025
On Mon, 4 Aug 2025 15:51:59 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> test/micro/org/openjdk/bench/java/lang/VectorBitConversion.java line 67:
>>
>>> 65:
>>> 66: @Benchmark
>>> 67: public long[] doubleToLongBits() {
>>
>> Would something like this be more concise (and maybe more readable as well) -
>>
>> @Benchmark
>> public long[] doubleToLongBits() {
>> for (int i = 0; i < doubles.length; i++) {
>> resultLongs[i] = Double.doubleToLongBits(doubles[i]);
>> }
>> return resultLongs;
>> }
>>
>>
>> The loop should still get vectorized (if vectorizable).
>>
>> Same for other benchmarks.
>
> Maybe but there's a reason why I wrote these benchmark methods this way. Keeping each line doing one thing makes it easier to map each line to the assembly (e.g. `perfasm`) and related IR nodes (e.g. `PrintIdeal`). That IMO is more important than the conciseness of the benchmark. What do others think?
Makes sense. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26457#discussion_r2252475557
More information about the core-libs-dev
mailing list