< prev index next >
src/cpu/x86/vm/x86_64.ad
Print this page
rev 10526 : [backport] Perform gc-state checks with LoadB to fit C2 matchers
rev 10556 : [backport] Remove C2 write-barrier from .ad files
rev 10568 : [backport] Fix CAS-obj predicates and add expected-null-versions for cmpxchg-narrow-oop
*** 6476,6501 ****
__ movptr(d, Address(r12, s, Address::times_8, BrooksPointer::byte_offset()));
%}
ins_pipe(ialu_reg_mem);
%}
- instruct shenandoahWB(rRegP dst, rRegP src, rFlagsReg cr) %{
- match(Set dst (ShenandoahWriteBarrier src));
- effect(DEF dst, USE src, KILL cr);
- ins_cost(300); // XXX
- format %{ "shenandoah_wb $dst,$src" %}
- ins_encode %{
- Register s = $src$$Register;
- Register d = $dst$$Register;
- // We need that first read barrier in order to trigger a SEGV/NPE on incoming NULL.
- // Also, it brings s into d in preparation for the call to shenandoah_write_barrier().
- __ movptr(d, Address(s, BrooksPointer::byte_offset()));
- __ shenandoah_write_barrier(d);
- %}
- ins_pipe(pipe_slow);
- %}
-
// Convert oop pointer into compressed form
instruct encodeHeapOop(rRegN dst, rRegP src, rFlagsReg cr) %{
predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull);
match(Set dst (EncodeP src));
effect(KILL cr);
--- 6476,6485 ----
*** 7366,7376 ****
memory mem_ptr,
rRegP tmp1, rRegP tmp2,
rax_RegP oldval, rRegP newval,
rFlagsReg cr)
%{
! predicate(VM_Version::supports_cx8() && UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
--- 7350,7360 ----
memory mem_ptr,
rRegP tmp1, rRegP tmp2,
rax_RegP oldval, rRegP newval,
rFlagsReg cr)
%{
! predicate(VM_Version::supports_cx8() && UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypePtr::NULL_PTR);
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
*** 7433,7443 ****
instruct compareAndSwapN(rRegI res,
memory mem_ptr,
rax_RegN oldval, rRegN newval,
rFlagsReg cr) %{
! predicate(!UseShenandoahGC || !ShenandoahCASBarrier);
match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "cmpxchgl $mem_ptr,$newval\t# "
"If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
--- 7417,7427 ----
instruct compareAndSwapN(rRegI res,
memory mem_ptr,
rax_RegN oldval, rRegN newval,
rFlagsReg cr) %{
! predicate(!UseShenandoahGC || !ShenandoahCASBarrier || n->in(3)->in(1)->bottom_type() == TypeNarrowOop::NULL_PTR);
match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "cmpxchgl $mem_ptr,$newval\t# "
"If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
*** 7457,7467 ****
instruct compareAndSwapN_shenandoah(rRegI res,
memory mem_ptr,
rRegP tmp1, rRegP tmp2,
rax_RegN oldval, rRegN newval,
rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier);
match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
--- 7441,7451 ----
instruct compareAndSwapN_shenandoah(rRegI res,
memory mem_ptr,
rRegP tmp1, rRegP tmp2,
rax_RegN oldval, rRegN newval,
rFlagsReg cr) %{
! predicate(UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypeNarrowOop::NULL_PTR);
match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
*** 11280,11331 ****
opcode(0x85);
ins_encode(REX_reg_reg_wide(src, src), OpcP, reg_reg(src, src));
ins_pipe(ialu_cr_reg_imm);
%}
! instruct compUB_mem_imm(rFlagsReg cr, memory op1, immU8 op2)
%{
! // This match is actually generic, but protect with Shenandoah flag for a while,
! // until the fix is upstreamed.
predicate(UseShenandoahGC);
! match(Set cr (CmpI (LoadUB op1) op2));
ins_cost(125);
! format %{ "cmpb $op1, $op2" %}
! ins_encode %{
! __ cmpb($op1$$Address, $op2$$constant);
! %}
ins_pipe(ialu_cr_reg_mem);
%}
! instruct compB_mem_imm(rFlagsReg cr, memory op1, immI8 op2)
%{
! // This match is actually generic, but protect with Shenandoah flag for a while,
! // until the fix is upstreamed.
predicate(UseShenandoahGC);
! match(Set cr (CmpI (LoadB op1) op2));
ins_cost(125);
! format %{ "cmpb $op1, $op2" %}
! ins_encode %{
! __ cmpb($op1$$Address, $op2$$constant);
! %}
! ins_pipe(ialu_cr_reg_mem);
! %}
!
! instruct testUB_mem_imm(rFlagsReg cr, memory op1, immU8 op2, immI0 opZ)
! %{
! // This match is actually generic, but protect with Shenandoah flag for a while,
! // until the fix is upstreamed.
! predicate(UseShenandoahGC);
! match(Set cr (CmpI (AndI (LoadUB op1) op2) opZ));
!
! ins_cost(125);
! format %{ "testb $op1, $op2" %}
! ins_encode %{
! __ testb($op1$$Address, $op2$$constant);
! %}
ins_pipe(ialu_cr_reg_mem);
%}
//----------Max and Min--------------------------------------------------------
// Min Instructions
--- 11264,11296 ----
opcode(0x85);
ins_encode(REX_reg_reg_wide(src, src), OpcP, reg_reg(src, src));
ins_pipe(ialu_cr_reg_imm);
%}
! instruct compB_mem_imm(rFlagsReg cr, memory mem, immI8 imm)
%{
! // This match is actually generic, but protect with Shenandoah flag,
! // because it is not tested upstream.
predicate(UseShenandoahGC);
! match(Set cr (CmpI (LoadB mem) imm));
ins_cost(125);
! format %{ "cmpb $mem, $imm" %}
! ins_encode %{ __ cmpb($mem$$Address, $imm$$constant); %}
ins_pipe(ialu_cr_reg_mem);
%}
! instruct testB_mem_imm(rFlagsReg cr, memory mem, immI8 imm, immI0 zero)
%{
! // This match is actually generic, but protect with Shenandoah flag,
! // because it is not tested upstream
predicate(UseShenandoahGC);
! match(Set cr (CmpI (AndI (LoadB mem) imm) zero));
ins_cost(125);
! format %{ "testb $mem, $imm" %}
! ins_encode %{ __ testb($mem$$Address, $imm$$constant); %}
ins_pipe(ialu_cr_reg_mem);
%}
//----------Max and Min--------------------------------------------------------
// Min Instructions
< prev index next >