< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

3560     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3561   }
3562   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3563   for (int idx = 0; idx < 4; idx++) {
3564     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3565     arrays_hashcode_elvcast(vtmp[idx], eltype);
3566     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3567   }
3568   // index += 32;
3569   addl(index, 32);
3570   // index < bound;
3571   cmpl(index, bound);
3572   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3573   // }
3574 
3575   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3576   subl(cnt1, bound);
3577   // release bound
3578 
3579   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);

3580   for (int idx = 0; idx < 4; idx++) {
3581     lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3582     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3583     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3584   }
3585   // result += vresult.reduceLanes(ADD);
3586   for (int idx = 0; idx < 4; idx++) {
3587     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3588   }
3589 
3590   // } else if (cnt1 < 32) {
3591 
3592   bind(SHORT_UNROLLED_BEGIN);
3593   // int i = 1;
3594   movl(index, 1);
3595   cmpl(index, cnt1);
3596   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3597 
3598   // for (; i < cnt1 ; i += 2) {
3599   bind(SHORT_UNROLLED_LOOP_BEGIN);
3600   movl(tmp3, 961);
3601   imull(result, tmp3);
3602   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);

3560     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3561   }
3562   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3563   for (int idx = 0; idx < 4; idx++) {
3564     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3565     arrays_hashcode_elvcast(vtmp[idx], eltype);
3566     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3567   }
3568   // index += 32;
3569   addl(index, 32);
3570   // index < bound;
3571   cmpl(index, bound);
3572   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3573   // }
3574 
3575   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3576   subl(cnt1, bound);
3577   // release bound
3578 
3579   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3580   lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3581   for (int idx = 0; idx < 4; idx++) {
3582     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);

3583     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3584   }
3585   // result += vresult.reduceLanes(ADD);
3586   for (int idx = 0; idx < 4; idx++) {
3587     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3588   }
3589 
3590   // } else if (cnt1 < 32) {
3591 
3592   bind(SHORT_UNROLLED_BEGIN);
3593   // int i = 1;
3594   movl(index, 1);
3595   cmpl(index, cnt1);
3596   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3597 
3598   // for (; i < cnt1 ; i += 2) {
3599   bind(SHORT_UNROLLED_LOOP_BEGIN);
3600   movl(tmp3, 961);
3601   imull(result, tmp3);
3602   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
< prev index next >