United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7066841 remove MacroAssembler::br_on_reg_cond() on sparc
7066841 : remove MacroAssembler::br_on_reg_cond() on sparc

Details
Type:
Enhancement
Submit Date:
2011-07-13
Status:
Closed
Updated Date:
2011-10-07
Project Name:
JDK
Resolved Date:
2011-09-30
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs22
Fixed Versions:
hs22

Related Reports
Backport:
Backport:

Sub Tasks

Description
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):

  AddressLiteral addrlit(byte_map_base);
  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,
                      O2, not_already_dirty);

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,
                      L0, refill);

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.

Vladimir

                                    

Comments
EVALUATION

See main CR
                                     
2011-09-14
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/4fe626cbf0bf
                                     
2011-08-31
SUGGESTED FIX

Remove br_on_reg_cond and use equivalents. For example br_null, cmp_zero_and_br, cmp_and_br_short, cmp_and_brx_short.
                                     
2011-08-31



Hardware and Software, Engineered to Work Together