< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

3627     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3628   }
3629   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3630   for (int idx = 0; idx < 4; idx++) {
3631     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3632     arrays_hashcode_elvcast(vtmp[idx], eltype);
3633     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3634   }
3635   // index += 32;
3636   addl(index, 32);
3637   // index < bound;
3638   cmpl(index, bound);
3639   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3640   // }
3641 
3642   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3643   subl(cnt1, bound);
3644   // release bound
3645 
3646   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);

3647   for (int idx = 0; idx < 4; idx++) {
3648     lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3649     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3650     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3651   }
3652   // result += vresult.reduceLanes(ADD);
3653   for (int idx = 0; idx < 4; idx++) {
3654     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3655   }
3656 
3657   // } else if (cnt1 < 32) {
3658 
3659   bind(SHORT_UNROLLED_BEGIN);
3660   // int i = 1;
3661   movl(index, 1);
3662   cmpl(index, cnt1);
3663   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3664 
3665   // for (; i < cnt1 ; i += 2) {
3666   bind(SHORT_UNROLLED_LOOP_BEGIN);
3667   movl(tmp3, 961);
3668   imull(result, tmp3);
3669   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);

3627     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3628   }
3629   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3630   for (int idx = 0; idx < 4; idx++) {
3631     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3632     arrays_hashcode_elvcast(vtmp[idx], eltype);
3633     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3634   }
3635   // index += 32;
3636   addl(index, 32);
3637   // index < bound;
3638   cmpl(index, bound);
3639   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3640   // }
3641 
3642   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3643   subl(cnt1, bound);
3644   // release bound
3645 
3646   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3647   lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3648   for (int idx = 0; idx < 4; idx++) {
3649     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);

3650     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3651   }
3652   // result += vresult.reduceLanes(ADD);
3653   for (int idx = 0; idx < 4; idx++) {
3654     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3655   }
3656 
3657   // } else if (cnt1 < 32) {
3658 
3659   bind(SHORT_UNROLLED_BEGIN);
3660   // int i = 1;
3661   movl(index, 1);
3662   cmpl(index, cnt1);
3663   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3664 
3665   // for (; i < cnt1 ; i += 2) {
3666   bind(SHORT_UNROLLED_LOOP_BEGIN);
3667   movl(tmp3, 961);
3668   imull(result, tmp3);
3669   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
< prev index next >