< prev index next >
src/cpu/x86/vm/x86_64.ad
Print this page
*** 524,533 ****
--- 524,539 ----
// Singleton class for instruction pointer
// reg_class ip_reg(RIP);
%}
+ source_hpp %{
+ #if INCLUDE_ALL_GCS
+ #include "shenandoahBarrierSetAssembler_x86.hpp"
+ #endif
+ %}
+
//----------SOURCE BLOCK-------------------------------------------------------
// This is a block of C++ code which provides values, functions, and
// definitions necessary in the rest of the architecture description
source %{
#define RELOC_IMM64 Assembler::imm_operand
*** 7268,7278 ****
instruct compareAndSwapP(rRegI res,
memory mem_ptr,
rax_RegP oldval, rRegP newval,
rFlagsReg cr)
%{
! predicate(VM_Version::supports_cx8());
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "cmpxchgq $mem_ptr,$newval\t# "
"If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
--- 7274,7284 ----
instruct compareAndSwapP(rRegI res,
memory mem_ptr,
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(KILL cr, KILL oldval);
format %{ "cmpxchgq $mem_ptr,$newval\t# "
"If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
*** 7287,7296 ****
--- 7293,7323 ----
REX_reg_breg(res, res), // movzbl
Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
ins_pipe( pipe_cmpxchg );
%}
+ instruct compareAndSwapP_shenandoah(rRegI res,
+ 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" %}
+
+ ins_encode %{
+ ShenandoahBarrierSetAssembler::bsasm()->cmpxchg_oop(&_masm, $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
+ false, // swap
+ $tmp1$$Register, $tmp2$$Register
+ );
+ %}
+ ins_pipe( pipe_cmpxchg );
+ %}
+
instruct compareAndSwapL(rRegI res,
memory mem_ptr,
rax_RegL oldval, rRegL newval,
rFlagsReg cr)
%{
*** 7339,7348 ****
--- 7366,7376 ----
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"
*** 7357,7366 ****
--- 7385,7414 ----
REX_reg_breg(res, res), // movzbl
Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
ins_pipe( pipe_cmpxchg );
%}
+ 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" %}
+
+ ins_encode %{
+ ShenandoahBarrierSetAssembler::bsasm()->cmpxchg_oop(&_masm, $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
+ false, // swap
+ $tmp1$$Register, $tmp2$$Register
+ );
+ %}
+ ins_pipe( pipe_cmpxchg );
+ %}
+
instruct xaddI_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{
predicate(n->as_LoadStore()->result_not_used());
match(Set dummy (GetAndAddI mem add));
effect(KILL cr);
format %{ "ADDL [$mem],$add" %}
*** 11165,11174 ****
--- 11213,11248 ----
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
instruct cmovI_reg_g(rRegI dst, rRegI src, rFlagsReg cr)
%{
< prev index next >