I want to remove these instructions added with initial push for G1 (3 years ago) and use existing instructions. I think they are dangerous because for all v9 sparc (32 and 64 bit VM) they use branch on register (bpr, compare with zero) instruction which checks all 64 bits but for v8 they use old branch instruction which checks only 32 bits.
Also they are used to check int values (but checks all 64 bits):
masm.set(addrlit, O1); // O1 := <card table base>
masm.ldub(O0, O1, O2); // O2 := [O0 + O1]
masm.br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
and at the same time checks pointers values:
masm.ld_ptr(G2_thread, dirty_card_q_index_byte_offset, L0);
masm.br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pn,
We had situations when upper 32 bits in registers with integer values are dirty so we may get situation when check's result is incorrect. Note, in the case above the result will be correct since loads extends signs.
We use br_null() and br_notnull() for pointers tests and br_zero() for 32 bits tests. So I want to use them instead of br_on_reg_cond().
Also the version of br_on_reg_cond() with address parameter is not used.