RFR: JDK-8300783: Consolidate byteswap implementations [v11]

David Holmes dholmes at openjdk.org
Fri Jan 27 02:31:17 UTC 2023


On Wed, 25 Jan 2023 17:41:13 GMT, Justin King <jcking at openjdk.org> wrote:

>> Deduplicate byte swapping implementations by consolidating them into `utilities/byteswap.hpp`, following `std::byteswap` introduced in C++23. Further simplification of `Bytes` will follow in https://github.com/openjdk/jdk/pull/12078.
>
> Justin King has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix test
>   
>   Signed-off-by: Justin King <jcking at google.com>

test/hotspot/gtest/opto/test_moveBits.cpp line 42:

> 40:   ASSERT_EQ(reverse_bits((T)-1), (T)-1);
> 41:   ASSERT_EQ(byteswap<T>((T)0), (T)0);
> 42:   ASSERT_EQ(byteswap<T>((T)-1), (T)-1);

This isn't testing moveBits any more so doesn't belong here.

test/hotspot/gtest/opto/test_moveBits.cpp line 58:

> 56:       ASSERT_EQ((T)~reverse_bits((T)~mask), revm1|revm2) << STUFF;
> 57:       ASSERT_EQ(byteswap<T>(mask), rbym1|rbym2) << STUFF;
> 58:       ASSERT_EQ((T)~byteswap<T>((T)~mask), rbym1|rbym2) << STUFF;

Ditto - doesn't belong here.

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

PR: https://git.openjdk.org/jdk/pull/12114


More information about the hotspot-jfr-dev mailing list