8290034: Auto vectorize reverse bit operations.

Reviewed-by: xgong, kvn
This commit is contained in:
Jatin Bhateja 2022-07-28 04:43:01 +00:00
parent 348a0521e1
commit 5d82d67a9e
18 changed files with 425 additions and 0 deletions

View file

@ -1762,6 +1762,7 @@ public final class Integer extends Number
* specified {@code int} value.
* @since 1.5
*/
@IntrinsicCandidate
public static int reverse(int i) {
// HD, Figure 7-1
i = (i & 0x55555555) << 1 | (i >>> 1) & 0x55555555;

View file

@ -1901,6 +1901,7 @@ public final class Long extends Number
* specified {@code long} value.
* @since 1.5
*/
@IntrinsicCandidate
public static long reverse(long i) {
// HD, Figure 7-1
i = (i & 0x5555555555555555L) << 1 | (i >>> 1) & 0x5555555555555555L;