3480 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3481 }
3482 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3483 for (int idx = 0; idx < 4; idx++) {
3484 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3485 arrays_hashcode_elvcast(vtmp[idx], eltype);
3486 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3487 }
3488 // index += 32;
3489 addl(index, 32);
3490 // index < bound;
3491 cmpl(index, bound);
3492 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3493 // }
3494
3495 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3496 subl(cnt1, bound);
3497 // release bound
3498
3499 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3500 for (int idx = 0; idx < 4; idx++) {
3501 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3502 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3503 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3504 }
3505 // result += vresult.reduceLanes(ADD);
3506 for (int idx = 0; idx < 4; idx++) {
3507 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3508 }
3509
3510 // } else if (cnt1 < 32) {
3511
3512 bind(SHORT_UNROLLED_BEGIN);
3513 // int i = 1;
3514 movl(index, 1);
3515 cmpl(index, cnt1);
3516 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3517
3518 // for (; i < cnt1 ; i += 2) {
3519 bind(SHORT_UNROLLED_LOOP_BEGIN);
3520 movl(tmp3, 961);
3521 imull(result, tmp3);
3522 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|
3480 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3481 }
3482 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3483 for (int idx = 0; idx < 4; idx++) {
3484 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3485 arrays_hashcode_elvcast(vtmp[idx], eltype);
3486 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3487 }
3488 // index += 32;
3489 addl(index, 32);
3490 // index < bound;
3491 cmpl(index, bound);
3492 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3493 // }
3494
3495 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3496 subl(cnt1, bound);
3497 // release bound
3498
3499 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3500 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3501 for (int idx = 0; idx < 4; idx++) {
3502 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);
3503 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3504 }
3505 // result += vresult.reduceLanes(ADD);
3506 for (int idx = 0; idx < 4; idx++) {
3507 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3508 }
3509
3510 // } else if (cnt1 < 32) {
3511
3512 bind(SHORT_UNROLLED_BEGIN);
3513 // int i = 1;
3514 movl(index, 1);
3515 cmpl(index, cnt1);
3516 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3517
3518 // for (; i < cnt1 ; i += 2) {
3519 bind(SHORT_UNROLLED_LOOP_BEGIN);
3520 movl(tmp3, 961);
3521 imull(result, tmp3);
3522 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|