8220198: Lots of com/sun/crypto/provider/Cipher tests fail on x86_32 due to missing SHA512 stubs

Reviewed-by: kvn, thartmann
This commit is contained in:
Aleksey Shipilev 2019-03-27 11:35:28 +01:00
parent c8725ae469
commit af6cddfa78
3 changed files with 13 additions and 1 deletions

@ -901,11 +901,15 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}
#ifdef _LP64
// These are only supported on 64-bit
if (UseSHA && supports_avx2() && supports_bmi2()) {
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
}
} else if (UseSHA512Intrinsics) {
} else
#endif
if (UseSHA512Intrinsics) {
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
}

@ -2450,6 +2450,8 @@ Node* GraphKit::make_runtime_call(int flags,
Node* parm2, Node* parm3,
Node* parm4, Node* parm5,
Node* parm6, Node* parm7) {
assert(call_addr != NULL, "must not call NULL targets");
// Slow-path call
bool is_leaf = !(flags & RC_NO_LEAF);
bool has_io = (!is_leaf && !(flags & RC_NO_IO));

@ -6353,6 +6353,9 @@ bool LibraryCallKit::inline_sha_implCompress(vmIntrinsics::ID id) {
}
if (state == NULL) return false;
assert(stubAddr != NULL, "Stub is generated");
if (stubAddr == NULL) return false;
// Call the stub.
Node* call = make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::sha_implCompress_Type(),
stubAddr, stubName, TypePtr::BOTTOM,
@ -6425,6 +6428,9 @@ bool LibraryCallKit::inline_digestBase_implCompressMB(int predicate) {
fatal("unknown SHA intrinsic predicate: %d", predicate);
}
if (klass_SHA_name != NULL) {
assert(stub_addr != NULL, "Stub is generated");
if (stub_addr == NULL) return false;
// get DigestBase klass to lookup for SHA klass
const TypeInstPtr* tinst = _gvn.type(digestBase_obj)->isa_instptr();
assert(tinst != NULL, "digestBase_obj is not instance???");