8146581: Minor corrections to the patch submitted for earlier bug id - 8143925

Reviewed-by: kvn
This commit is contained in:
Kishor Kharbas 2016-01-07 14:29:05 -08:00 committed by Vladimir Kozlov
parent 543fcb3a25
commit a8fcb62829
3 changed files with 13 additions and 27 deletions

View File

@ -2802,8 +2802,7 @@ class StubGenerator: public StubCodeGenerator {
const Register to = rdx; // destination array address
const Register key = rcx; // key array address
const Register counter = rdi; // counter byte array initialized from initvector array address
// and left with the results of the last encryption block
// and updated with the incremented counter in the end
const Register len_reg = rbx;
const Register pos = rax;
@ -2829,10 +2828,7 @@ class StubGenerator: public StubCodeGenerator {
__ movptr(from , from_param);
__ movptr(to , to_param);
//__ movptr(key, key_param);
//__ movptr(counter, rvec_param);
__ movptr(len_reg , len_param);
//__ movptr(pos, 0);
// Use the partially used encrpyted counter from last invocation
Label L_exit_preLoop, L_preLoop_start;
@ -3007,8 +3003,8 @@ class StubGenerator: public StubCodeGenerator {
__ subptr(len_reg, AESBlockSize);
__ jmp(L_singleBlockLoopTop[k]);
__ BIND(L_processTail_insr[k]);
__ addptr(pos, len_reg);
__ BIND(L_processTail_insr[k]); // Process the tail part of the input array
__ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register
__ testptr(len_reg, 8);
__ jcc(Assembler::zero, L_processTail_4_insr[k]);
__ subptr(pos,8);
@ -3035,11 +3031,11 @@ class StubGenerator: public StubCodeGenerator {
__ BIND(L_processTail_exit_insr[k]);
__ movptr(saved_encCounter_start, saved_counter_param);
__ movdqu(Address(saved_encCounter_start, 0), xmm_result0);
__ pxor(xmm_result0, xmm_from0);
__ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes.
__ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation.
__ testptr(len_reg, 8);
__ jcc(Assembler::zero, L_processTail_4_extr[k]);
__ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array
__ pextrd(Address(to, pos), xmm_result0, 0);
__ pextrd(Address(to, pos, Address::times_1, 4), xmm_result0, 1);
__ psrldq(xmm_result0, 8);

View File

@ -3752,7 +3752,7 @@ class StubGenerator: public StubCodeGenerator {
const Register to = c_rarg1; // destination array address
const Register key = c_rarg2; // key array address
const Register counter = c_rarg3; // counter byte array initialized from counter array address
// and left with the results of the last encryption block
// and updated with the incremented counter in the end
#ifndef _WIN64
const Register len_reg = c_rarg4;
const Register saved_encCounter_start = c_rarg5;
@ -3967,8 +3967,8 @@ class StubGenerator: public StubCodeGenerator {
__ addptr(pos, AESBlockSize);
__ subptr(len_reg, AESBlockSize);
__ jmp(L_singleBlockLoopTop[k]);
__ BIND(L_processTail_insr[k]);
__ addptr(pos, len_reg);
__ BIND(L_processTail_insr[k]); // Process the tail part of the input array
__ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register
__ testptr(len_reg, 8);
__ jcc(Assembler::zero, L_processTail_4_insr[k]);
__ subptr(pos,8);
@ -3993,11 +3993,11 @@ class StubGenerator: public StubCodeGenerator {
__ pinsrb(xmm_from0, Address(from, pos), 0);
__ BIND(L_processTail_exit_insr[k]);
__ movdqu(Address(saved_encCounter_start, 0), xmm_result0);
__ pxor(xmm_result0, xmm_from0);
__ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes.
__ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation.
__ testptr(len_reg, 8);
__ jcc(Assembler::zero, L_processTail_4_extr[k]);
__ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array
__ pextrq(Address(to, pos), xmm_result0, 0);
__ psrldq(xmm_result0, 8);
__ addptr(pos, 8);

View File

@ -671,7 +671,7 @@ void VM_Version::get_processor_features() {
}
// --AES-CTR ends--
}
} else if (UseAES || UseAESIntrinsics) {
} else if (UseAES || UseAESIntrinsics || UseAESCTRIntrinsics) {
if (UseAES && !FLAG_IS_DEFAULT(UseAES)) {
warning("AES instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseAES, false);
@ -707,16 +707,6 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
}
if (UseAESIntrinsics) {
if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) {
UseAESCTRIntrinsics = true;
}
} else if (UseAESCTRIntrinsics) {
if (!FLAG_IS_DEFAULT(UseAESCTRIntrinsics))
warning("AES/CTR intrinsics are not available on this CPU");
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
}
if (supports_sse4_2()) {
if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) {
UseCRC32CIntrinsics = true;