3618 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3619 }
3620 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3621 for (int idx = 0; idx < 4; idx++) {
3622 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3623 arrays_hashcode_elvcast(vtmp[idx], eltype);
3624 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3625 }
3626 // index += 32;
3627 addl(index, 32);
3628 // index < bound;
3629 cmpl(index, bound);
3630 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3631 // }
3632
3633 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3634 subl(cnt1, bound);
3635 // release bound
3636
3637 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3638 for (int idx = 0; idx < 4; idx++) {
3639 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3640 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3641 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3642 }
3643 // result += vresult.reduceLanes(ADD);
3644 for (int idx = 0; idx < 4; idx++) {
3645 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3646 }
3647
3648 // } else if (cnt1 < 32) {
3649
3650 bind(SHORT_UNROLLED_BEGIN);
3651 // int i = 1;
3652 movl(index, 1);
3653 cmpl(index, cnt1);
3654 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3655
3656 // for (; i < cnt1 ; i += 2) {
3657 bind(SHORT_UNROLLED_LOOP_BEGIN);
3658 movl(tmp3, 961);
3659 imull(result, tmp3);
3660 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|
3618 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3619 }
3620 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3621 for (int idx = 0; idx < 4; idx++) {
3622 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3623 arrays_hashcode_elvcast(vtmp[idx], eltype);
3624 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3625 }
3626 // index += 32;
3627 addl(index, 32);
3628 // index < bound;
3629 cmpl(index, bound);
3630 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3631 // }
3632
3633 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3634 subl(cnt1, bound);
3635 // release bound
3636
3637 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3638 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3639 for (int idx = 0; idx < 4; idx++) {
3640 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);
3641 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3642 }
3643 // result += vresult.reduceLanes(ADD);
3644 for (int idx = 0; idx < 4; idx++) {
3645 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3646 }
3647
3648 // } else if (cnt1 < 32) {
3649
3650 bind(SHORT_UNROLLED_BEGIN);
3651 // int i = 1;
3652 movl(index, 1);
3653 cmpl(index, cnt1);
3654 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3655
3656 // for (; i < cnt1 ; i += 2) {
3657 bind(SHORT_UNROLLED_LOOP_BEGIN);
3658 movl(tmp3, 961);
3659 imull(result, tmp3);
3660 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|