3544 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3545 }
3546 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3547 for (int idx = 0; idx < 4; idx++) {
3548 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3549 arrays_hashcode_elvcast(vtmp[idx], eltype);
3550 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3551 }
3552 // index += 32;
3553 addl(index, 32);
3554 // index < bound;
3555 cmpl(index, bound);
3556 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3557 // }
3558
3559 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3560 subl(cnt1, bound);
3561 // release bound
3562
3563 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3564 for (int idx = 0; idx < 4; idx++) {
3565 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3566 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3567 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3568 }
3569 // result += vresult.reduceLanes(ADD);
3570 for (int idx = 0; idx < 4; idx++) {
3571 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3572 }
3573
3574 // } else if (cnt1 < 32) {
3575
3576 bind(SHORT_UNROLLED_BEGIN);
3577 // int i = 1;
3578 movl(index, 1);
3579 cmpl(index, cnt1);
3580 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3581
3582 // for (; i < cnt1 ; i += 2) {
3583 bind(SHORT_UNROLLED_LOOP_BEGIN);
3584 movl(tmp3, 961);
3585 imull(result, tmp3);
3586 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|
3544 arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3545 }
3546 // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3547 for (int idx = 0; idx < 4; idx++) {
3548 vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3549 arrays_hashcode_elvcast(vtmp[idx], eltype);
3550 vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3551 }
3552 // index += 32;
3553 addl(index, 32);
3554 // index < bound;
3555 cmpl(index, bound);
3556 jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3557 // }
3558
3559 lea(ary1, Address(ary1, bound, Address::times(elsize)));
3560 subl(cnt1, bound);
3561 // release bound
3562
3563 // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3564 lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3565 for (int idx = 0; idx < 4; idx++) {
3566 arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);
3567 vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3568 }
3569 // result += vresult.reduceLanes(ADD);
3570 for (int idx = 0; idx < 4; idx++) {
3571 reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3572 }
3573
3574 // } else if (cnt1 < 32) {
3575
3576 bind(SHORT_UNROLLED_BEGIN);
3577 // int i = 1;
3578 movl(index, 1);
3579 cmpl(index, cnt1);
3580 jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3581
3582 // for (; i < cnt1 ; i += 2) {
3583 bind(SHORT_UNROLLED_LOOP_BEGIN);
3584 movl(tmp3, 961);
3585 imull(result, tmp3);
3586 arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
|