3671 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3672 }
3673 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3674 for (int idx = 0; idx < 4; idx++) {
3675 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3676 arrays_hashcode_elvcast(vtmp[idx], eltype);
3677 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3678 }
3679 // index += 32;
3680 addl(index, 32);
3681 // index < bound;
3682 cmpl(index, bound);
3683 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3684 // }
3685
3686 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3687 subl(cnt1, bound);
3688 // release bound
3689
3690 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3691 for (int idx = 0; idx < 4; idx++) {
3692 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3693 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3694 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3695 }
3696 // result += vresult.reduceLanes(ADD);
3697 for (int idx = 0; idx < 4; idx++) {
3698 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3699 }
3700
3701 // } else if (cnt1 < 32) {
3702
3703 bind(SHORT_UNROLLED_BEGIN);
3704 // int i = 1;
3705 movl(index, 1);
3706 cmpl(index, cnt1);
3707 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3708
3709 // for (; i < cnt1 ; i += 2) {
3710 bind(SHORT_UNROLLED_LOOP_BEGIN);
3711 movl(tmp3, 961);
3712 imull(result, tmp3);
3713 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|
3671 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3672 }
3673 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3674 for (int idx = 0; idx < 4; idx++) {
3675 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3676 arrays_hashcode_elvcast(vtmp[idx], eltype);
3677 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3678 }
3679 // index += 32;
3680 addl(index, 32);
3681 // index < bound;
3682 cmpl(index, bound);
3683 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3684 // }
3685
3686 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3687 subl(cnt1, bound);
3688 // release bound
3689
3690 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3691 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3692 for (int idx = 0; idx < 4; idx++) {
3693 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);
3694 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3695 }
3696 // result += vresult.reduceLanes(ADD);
3697 for (int idx = 0; idx < 4; idx++) {
3698 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3699 }
3700
3701 // } else if (cnt1 < 32) {
3702
3703 bind(SHORT_UNROLLED_BEGIN);
3704 // int i = 1;
3705 movl(index, 1);
3706 cmpl(index, cnt1);
3707 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3708
3709 // for (; i < cnt1 ; i += 2) {
3710 bind(SHORT_UNROLLED_LOOP_BEGIN);
3711 movl(tmp3, 961);
3712 imull(result, tmp3);
3713 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|