< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

3547     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3548   }
3549   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3550   for (int idx = 0; idx < 4; idx++) {
3551     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3552     arrays_hashcode_elvcast(vtmp[idx], eltype);
3553     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3554   }
3555   // index += 32;
3556   addl(index, 32);
3557   // index < bound;
3558   cmpl(index, bound);
3559   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3560   // }
3561 
3562   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3563   subl(cnt1, bound);
3564   // release bound
3565 
3566   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);

3567   for (int idx = 0; idx < 4; idx++) {
3568     lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + ((8 * idx + 1) * sizeof(jint))));
3569     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, 0), T_INT);
3570     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3571   }
3572   // result += vresult.reduceLanes(ADD);
3573   for (int idx = 0; idx < 4; idx++) {
3574     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3575   }
3576 
3577   // } else if (cnt1 < 32) {
3578 
3579   bind(SHORT_UNROLLED_BEGIN);
3580   // int i = 1;
3581   movl(index, 1);
3582   cmpl(index, cnt1);
3583   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3584 
3585   // for (; i < cnt1 ; i += 2) {
3586   bind(SHORT_UNROLLED_LOOP_BEGIN);
3587   movl(tmp3, 961);
3588   imull(result, tmp3);
3589   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);

3547     arrays_hashcode_elvload(vtmp[idx], Address(ary1, index, Address::times(elsize), 8 * idx * elsize), eltype);
3548   }
3549   // vresult = vresult * vnext + ary1[index+8*idx:index+8*idx+7];
3550   for (int idx = 0; idx < 4; idx++) {
3551     vpmulld(vresult[idx], vresult[idx], vnext, Assembler::AVX_256bit);
3552     arrays_hashcode_elvcast(vtmp[idx], eltype);
3553     vpaddd(vresult[idx], vresult[idx], vtmp[idx], Assembler::AVX_256bit);
3554   }
3555   // index += 32;
3556   addl(index, 32);
3557   // index < bound;
3558   cmpl(index, bound);
3559   jcc(Assembler::less, UNROLLED_VECTOR_LOOP_BEGIN);
3560   // }
3561 
3562   lea(ary1, Address(ary1, bound, Address::times(elsize)));
3563   subl(cnt1, bound);
3564   // release bound
3565 
3566   // vresult *= IntVector.fromArray(I256, power_of_31_backwards, 1);
3567   lea(tmp2, ExternalAddress(StubRoutines::x86::arrays_hashcode_powers_of_31() + (0 * sizeof(jint))));
3568   for (int idx = 0; idx < 4; idx++) {
3569     arrays_hashcode_elvload(vcoef[idx], Address(tmp2, (int)((8 * idx + 1) * sizeof(jint))), T_INT);

3570     vpmulld(vresult[idx], vresult[idx], vcoef[idx], Assembler::AVX_256bit);
3571   }
3572   // result += vresult.reduceLanes(ADD);
3573   for (int idx = 0; idx < 4; idx++) {
3574     reduceI(Op_AddReductionVI, 256/(sizeof(jint) * 8), result, result, vresult[idx], vtmp[(idx * 2 + 0) % 4], vtmp[(idx * 2 + 1) % 4]);
3575   }
3576 
3577   // } else if (cnt1 < 32) {
3578 
3579   bind(SHORT_UNROLLED_BEGIN);
3580   // int i = 1;
3581   movl(index, 1);
3582   cmpl(index, cnt1);
3583   jcc(Assembler::greaterEqual, SHORT_UNROLLED_LOOP_EXIT);
3584 
3585   // for (; i < cnt1 ; i += 2) {
3586   bind(SHORT_UNROLLED_LOOP_BEGIN);
3587   movl(tmp3, 961);
3588   imull(result, tmp3);
3589   arrays_hashcode_elload(tmp2, Address(ary1, index, Address::times(elsize), -elsize), eltype);
< prev index next >