4750 delayed()->mov(0, result); // annuled so i not clobbered for following
4751 ldx(inp, i, t3); // load final 8B (aligned) containing tail -> t3
4752 mov(8, t5);
4753 sub(t5, t4, t4);
4754 mov(0, result); // ** i clobbered at this point
4755 sll(t4, 3, t4); // bits beyond end of string -> t4
4756 srlx(t3, t4, t3); // bytes beyond end now obliterated -> t3
4757 andcc(lmask, t3, G0);
4758 movcc(Assembler::notZero, false, xcc, 1, result);
4759 bind(Lreturn);
4760 }
4761
4762 #endif
4763
4764
4765 // Use BIS for zeroing (count is in bytes).
4766 void MacroAssembler::bis_zeroing(Register to, Register count, Register temp, Label& Ldone) {
4767 assert(UseBlockZeroing && VM_Version::has_block_zeroing(), "only works with BIS zeroing");
4768 Register end = count;
4769 int cache_line_size = VM_Version::prefetch_data_size();
4770 // Minimum count when BIS zeroing can be used since
4771 // it needs membar which is expensive.
4772 int block_zero_size = MAX2(cache_line_size*3, (int)BlockZeroingLowLimit);
4773
4774 Label small_loop;
4775 // Check if count is negative (dead code) or zero.
4776 // Note, count uses 64bit in 64 bit VM.
4777 cmp_and_brx_short(count, 0, Assembler::lessEqual, Assembler::pn, Ldone);
4778
4779 // Use BIS zeroing only for big arrays since it requires membar.
4780 if (Assembler::is_simm13(block_zero_size)) { // < 4096
4781 cmp(count, block_zero_size);
4782 } else {
4783 set(block_zero_size, temp);
4784 cmp(count, temp);
4785 }
4786 br(Assembler::lessUnsigned, false, Assembler::pt, small_loop);
4787 delayed()->add(to, count, end);
4788
4789 // Note: size is >= three (32 bytes) cache lines.
|
4750 delayed()->mov(0, result); // annuled so i not clobbered for following
4751 ldx(inp, i, t3); // load final 8B (aligned) containing tail -> t3
4752 mov(8, t5);
4753 sub(t5, t4, t4);
4754 mov(0, result); // ** i clobbered at this point
4755 sll(t4, 3, t4); // bits beyond end of string -> t4
4756 srlx(t3, t4, t3); // bytes beyond end now obliterated -> t3
4757 andcc(lmask, t3, G0);
4758 movcc(Assembler::notZero, false, xcc, 1, result);
4759 bind(Lreturn);
4760 }
4761
4762 #endif
4763
4764
4765 // Use BIS for zeroing (count is in bytes).
4766 void MacroAssembler::bis_zeroing(Register to, Register count, Register temp, Label& Ldone) {
4767 assert(UseBlockZeroing && VM_Version::has_block_zeroing(), "only works with BIS zeroing");
4768 Register end = count;
4769 int cache_line_size = VM_Version::prefetch_data_size();
4770 assert(cache_line_size > 0, "cache line size should be known for this code");
4771 // Minimum count when BIS zeroing can be used since
4772 // it needs membar which is expensive.
4773 int block_zero_size = MAX2(cache_line_size*3, (int)BlockZeroingLowLimit);
4774
4775 Label small_loop;
4776 // Check if count is negative (dead code) or zero.
4777 // Note, count uses 64bit in 64 bit VM.
4778 cmp_and_brx_short(count, 0, Assembler::lessEqual, Assembler::pn, Ldone);
4779
4780 // Use BIS zeroing only for big arrays since it requires membar.
4781 if (Assembler::is_simm13(block_zero_size)) { // < 4096
4782 cmp(count, block_zero_size);
4783 } else {
4784 set(block_zero_size, temp);
4785 cmp(count, temp);
4786 }
4787 br(Assembler::lessUnsigned, false, Assembler::pt, small_loop);
4788 delayed()->add(to, count, end);
4789
4790 // Note: size is >= three (32 bytes) cache lines.
|