mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8038953: Add sanity tests for BMI1 and LZCNT instructions
Reviewed-by: kvn, iignatyev
This commit is contained in:
parent
522abfc113
commit
2b032b10e1
15 changed files with 851 additions and 1 deletions
|
@ -294,4 +294,23 @@ public final class Utils {
|
|||
return output;
|
||||
}
|
||||
|
||||
private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
||||
|
||||
/**
|
||||
* Returns hex view of byte array
|
||||
*
|
||||
* @param bytes byte array to process
|
||||
* @return Space separated hexadecimal string representation of bytes
|
||||
*/
|
||||
|
||||
public static String toHexString(byte[] bytes) {
|
||||
char[] hexView = new char[bytes.length * 3];
|
||||
int i = 0;
|
||||
for (byte b : bytes) {
|
||||
hexView[i++] = hexArray[(b >> 4) & 0x0F];
|
||||
hexView[i++] = hexArray[b & 0x0F];
|
||||
hexView[i++] = ' ';
|
||||
}
|
||||
return new String(hexView);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue