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