src/cpu/x86/vm/x86_32.ad

changeset 1106
d0994e5bebce
parent 1082
bd441136a5ce
child 1116
fbde8ec322d0
     1.1 --- a/src/cpu/x86/vm/x86_32.ad	Tue Mar 24 15:09:52 2009 -0700
     1.2 +++ b/src/cpu/x86/vm/x86_32.ad	Thu Mar 26 14:31:45 2009 -0700
     1.3 @@ -4288,24 +4288,6 @@
     1.4      emit_opcode(cbuf, 0xC8 + $src2$$reg);
     1.5    %}
     1.6  
     1.7 -  enc_class enc_membar_acquire %{
     1.8 -    // Doug Lea believes this is not needed with current Sparcs and TSO.
     1.9 -    // MacroAssembler masm(&cbuf);
    1.10 -    // masm.membar();
    1.11 -  %}
    1.12 -
    1.13 -  enc_class enc_membar_release %{
    1.14 -    // Doug Lea believes this is not needed with current Sparcs and TSO.
    1.15 -    // MacroAssembler masm(&cbuf);
    1.16 -    // masm.membar();
    1.17 -  %}
    1.18 -
    1.19 -  enc_class enc_membar_volatile %{
    1.20 -    MacroAssembler masm(&cbuf);
    1.21 -    masm.membar(Assembler::Membar_mask_bits(Assembler::StoreLoad |
    1.22 -                                            Assembler::StoreStore));
    1.23 -  %}
    1.24 -
    1.25    // Atomically load the volatile long
    1.26    enc_class enc_loadL_volatile( memory mem, stackSlotL dst ) %{
    1.27      emit_opcode(cbuf,0xDF);
    1.28 @@ -7498,9 +7480,9 @@
    1.29    ins_cost(400);
    1.30  
    1.31    size(0);
    1.32 -  format %{ "MEMBAR-acquire" %}
    1.33 -  ins_encode( enc_membar_acquire );
    1.34 -  ins_pipe(pipe_slow);
    1.35 +  format %{ "MEMBAR-acquire ! (empty encoding)" %}
    1.36 +  ins_encode();
    1.37 +  ins_pipe(empty);
    1.38  %}
    1.39  
    1.40  instruct membar_acquire_lock() %{
    1.41 @@ -7519,9 +7501,9 @@
    1.42    ins_cost(400);
    1.43  
    1.44    size(0);
    1.45 -  format %{ "MEMBAR-release" %}
    1.46 -  ins_encode( enc_membar_release );
    1.47 -  ins_pipe(pipe_slow);
    1.48 +  format %{ "MEMBAR-release ! (empty encoding)" %}
    1.49 +  ins_encode( );
    1.50 +  ins_pipe(empty);
    1.51  %}
    1.52  
    1.53  instruct membar_release_lock() %{
    1.54 @@ -7535,12 +7517,22 @@
    1.55    ins_pipe(empty);
    1.56  %}
    1.57  
    1.58 -instruct membar_volatile() %{
    1.59 +instruct membar_volatile(eFlagsReg cr) %{
    1.60    match(MemBarVolatile);
    1.61 +  effect(KILL cr);
    1.62    ins_cost(400);
    1.63  
    1.64 -  format %{ "MEMBAR-volatile" %}
    1.65 -  ins_encode( enc_membar_volatile );
    1.66 +  format %{ 
    1.67 +    $$template
    1.68 +    if (os::is_MP()) {
    1.69 +      $$emit$$"LOCK ADDL [ESP + #0], 0\t! membar_volatile"
    1.70 +    } else {
    1.71 +      $$emit$$"MEMBAR-volatile ! (empty encoding)"
    1.72 +    }
    1.73 +  %}
    1.74 +  ins_encode %{
    1.75 +    __ membar(Assembler::StoreLoad);
    1.76 +  %}
    1.77    ins_pipe(pipe_slow);
    1.78  %}
    1.79  

mercurial