mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8205528: Base64 encoding algorithm using AVX512 instructions
Reviewed-by: kvn, psandoz
This commit is contained in:
parent
a937d2876b
commit
3feaefd75f
28 changed files with 1851 additions and 23 deletions
|
@ -298,6 +298,7 @@ class LibraryCallKit : public GraphKit {
|
|||
Node* get_key_start_from_aescrypt_object(Node* aescrypt_object);
|
||||
Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object);
|
||||
bool inline_ghash_processBlocks();
|
||||
bool inline_base64_encodeBlock();
|
||||
bool inline_sha_implCompress(vmIntrinsics::ID id);
|
||||
bool inline_digestBase_implCompressMB(int predicate);
|
||||
bool inline_sha_implCompressMB(Node* digestBaseObj, ciInstanceKlass* instklass_SHA,
|
||||
|
@ -833,6 +834,8 @@ bool LibraryCallKit::try_to_inline(int predicate) {
|
|||
|
||||
case vmIntrinsics::_ghash_processBlocks:
|
||||
return inline_ghash_processBlocks();
|
||||
case vmIntrinsics::_base64_encodeBlock:
|
||||
return inline_base64_encodeBlock();
|
||||
|
||||
case vmIntrinsics::_encodeISOArray:
|
||||
case vmIntrinsics::_encodeByteISOArray:
|
||||
|
@ -6084,6 +6087,35 @@ bool LibraryCallKit::inline_ghash_processBlocks() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LibraryCallKit::inline_base64_encodeBlock() {
|
||||
address stubAddr;
|
||||
const char *stubName;
|
||||
assert(UseBASE64Intrinsics, "need Base64 intrinsics support");
|
||||
assert(callee()->signature()->size() == 6, "base64_encodeBlock has 6 parameters");
|
||||
stubAddr = StubRoutines::base64_encodeBlock();
|
||||
stubName = "encodeBlock";
|
||||
|
||||
if (!stubAddr) return false;
|
||||
Node* base64obj = argument(0);
|
||||
Node* src = argument(1);
|
||||
Node* offset = argument(2);
|
||||
Node* len = argument(3);
|
||||
Node* dest = argument(4);
|
||||
Node* dp = argument(5);
|
||||
Node* isURL = argument(6);
|
||||
|
||||
Node* src_start = array_element_address(src, intcon(0), T_BYTE);
|
||||
assert(src_start, "source array is NULL");
|
||||
Node* dest_start = array_element_address(dest, intcon(0), T_BYTE);
|
||||
assert(dest_start, "destination array is NULL");
|
||||
|
||||
Node* base64 = make_runtime_call(RC_LEAF,
|
||||
OptoRuntime::base64_encodeBlock_Type(),
|
||||
stubAddr, stubName, TypePtr::BOTTOM,
|
||||
src_start, offset, len, dest_start, dp, isURL);
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------inline_sha_implCompress-----------------------
|
||||
//
|
||||
// Calculate SHA (i.e., SHA-1) for single-block byte[] array.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue