mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8290034: Auto vectorize reverse bit operations.
Reviewed-by: xgong, kvn
This commit is contained in:
parent
348a0521e1
commit
5d82d67a9e
18 changed files with 425 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue