comparison src/cpu/x86/vm/x86_32.ad @ 622:56aae7be60d4

6812678: macro assembler needs delayed binding of a few constants (for 6655638) Summary: minor assembler enhancements preparing for method handles Reviewed-by: kvn
author jrose
date Wed, 04 Mar 2009 09:58:39 -0800
parents 98cb887364d3
children 337400e7a5dd
comparison
equal deleted inserted replaced
621:19f25e603e7b 622:56aae7be60d4
3749 masm.bind(ECX_GOOD_LABEL); 3749 masm.bind(ECX_GOOD_LABEL);
3750 masm.testl(rsi, rsi); 3750 masm.testl(rsi, rsi);
3751 masm.jcc(Assembler::zero, LENGTH_DIFF_LABEL); 3751 masm.jcc(Assembler::zero, LENGTH_DIFF_LABEL);
3752 3752
3753 // Load first characters 3753 // Load first characters
3754 masm.load_unsigned_word(rcx, Address(rbx, 0)); 3754 masm.load_unsigned_short(rcx, Address(rbx, 0));
3755 masm.load_unsigned_word(rdi, Address(rax, 0)); 3755 masm.load_unsigned_short(rdi, Address(rax, 0));
3756 3756
3757 // Compare first characters 3757 // Compare first characters
3758 masm.subl(rcx, rdi); 3758 masm.subl(rcx, rdi);
3759 masm.jcc(Assembler::notZero, POP_LABEL); 3759 masm.jcc(Assembler::notZero, POP_LABEL);
3760 masm.decrementl(rsi); 3760 masm.decrementl(rsi);
3780 masm.lea(rbx, Address(rbx, rsi, Address::times_2, 2)); 3780 masm.lea(rbx, Address(rbx, rsi, Address::times_2, 2));
3781 masm.negl(rsi); 3781 masm.negl(rsi);
3782 3782
3783 // Compare the rest of the characters 3783 // Compare the rest of the characters
3784 masm.bind(WHILE_HEAD_LABEL); 3784 masm.bind(WHILE_HEAD_LABEL);
3785 masm.load_unsigned_word(rcx, Address(rbx, rsi, Address::times_2, 0)); 3785 masm.load_unsigned_short(rcx, Address(rbx, rsi, Address::times_2, 0));
3786 masm.load_unsigned_word(rdi, Address(rax, rsi, Address::times_2, 0)); 3786 masm.load_unsigned_short(rdi, Address(rax, rsi, Address::times_2, 0));
3787 masm.subl(rcx, rdi); 3787 masm.subl(rcx, rdi);
3788 masm.jcc(Assembler::notZero, POP_LABEL); 3788 masm.jcc(Assembler::notZero, POP_LABEL);
3789 masm.incrementl(rsi); 3789 masm.incrementl(rsi);
3790 masm.jcc(Assembler::notZero, WHILE_HEAD_LABEL); 3790 masm.jcc(Assembler::notZero, WHILE_HEAD_LABEL);
3791 3791
3838 masm.andl(tmp2Reg, 1); 3838 masm.andl(tmp2Reg, 1);
3839 masm.testl(tmp2Reg, tmp2Reg); 3839 masm.testl(tmp2Reg, tmp2Reg);
3840 masm.jcc(Assembler::zero, COMPARE_LOOP_HDR); 3840 masm.jcc(Assembler::zero, COMPARE_LOOP_HDR);
3841 3841
3842 // Compare 2-byte "tail" at end of arrays 3842 // Compare 2-byte "tail" at end of arrays
3843 masm.load_unsigned_word(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset)); 3843 masm.load_unsigned_short(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset));
3844 masm.load_unsigned_word(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset)); 3844 masm.load_unsigned_short(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset));
3845 masm.cmpl(tmp1Reg, tmp2Reg); 3845 masm.cmpl(tmp1Reg, tmp2Reg);
3846 masm.jcc(Assembler::notEqual, FALSE_LABEL); 3846 masm.jcc(Assembler::notEqual, FALSE_LABEL);
3847 masm.testl(resultReg, resultReg); 3847 masm.testl(resultReg, resultReg);
3848 masm.jcc(Assembler::zero, TRUE_LABEL); 3848 masm.jcc(Assembler::zero, TRUE_LABEL);
3849 3849