< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

3500     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3501   }
3502   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3503   for (int idx = 0; idx < 4; idx++) {
3504     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3505     arrays_hashcode_elvcast(vtmp[idx], eltype);
3506     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3507   }
3508   // index += 32;
3509   addl(index, 32);
3510   // index < bound;
3511   cmpl(index, bound);
3512   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3513   // }
3514 
3515   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3516   subl(cnt1, bound);
3517   // release bound
3518 
3519   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);

3520   for (int idx = 0; idx < 4; idx++) {
3521     lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3522     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3523     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3524   }
3525   // result += vresult.reduceLanes(ADD);
3526   for (int idx = 0; idx < 4; idx++) {
3527     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3528   }
3529 
3530   // } else if (cnt1 < 32) {
3531 
3532   bind(SHORT_UNROLLED_BEGIN);
3533   // int i = 1;
3534   movl(index, 1);
3535   cmpl(index, cnt1);
3536   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3537 
3538   // for (; i < cnt1 ; i += 2) {
3539   bind(SHORT_UNROLLED_LOOP_BEGIN);
3540   movl(tmp3, 961);
3541   imull(result, tmp3);
3542   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);

3500     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3501   }
3502   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3503   for (int idx = 0; idx < 4; idx++) {
3504     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3505     arrays_hashcode_elvcast(vtmp[idx], eltype);
3506     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3507   }
3508   // index += 32;
3509   addl(index, 32);
3510   // index < bound;
3511   cmpl(index, bound);
3512   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3513   // }
3514 
3515   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3516   subl(cnt1, bound);
3517   // release bound
3518 
3519   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3520   lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3521   for (int idx = 0; idx < 4; idx++) {
3522     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);

3523     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3524   }
3525   // result += vresult.reduceLanes(ADD);
3526   for (int idx = 0; idx < 4; idx++) {
3527     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3528   }
3529 
3530   // } else if (cnt1 < 32) {
3531 
3532   bind(SHORT_UNROLLED_BEGIN);
3533   // int i = 1;
3534   movl(index, 1);
3535   cmpl(index, cnt1);
3536   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3537 
3538   // for (; i < cnt1 ; i += 2) {
3539   bind(SHORT_UNROLLED_LOOP_BEGIN);
3540   movl(tmp3, 961);
3541   imull(result, tmp3);
3542   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
< prev index next >