< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page




 513 reg_class int_rbx_reg(RBX);
 514 
 515 // Singleton class for RCX int register
 516 reg_class int_rcx_reg(RCX);
 517 
 518 // Singleton class for RCX int register
 519 reg_class int_rdx_reg(RDX);
 520 
 521 // Singleton class for RCX int register
 522 reg_class int_rdi_reg(RDI);
 523 
 524 // Singleton class for instruction pointer
 525 // reg_class ip_reg(RIP);
 526 
 527 %}
 528 
 529 source_hpp %{
 530 #if INCLUDE_ZGC
 531 #include "gc/z/zBarrierSetAssembler.hpp"
 532 #endif



 533 %}
 534 
 535 //----------SOURCE BLOCK-------------------------------------------------------
 536 // This is a block of C++ code which provides values, functions, and
 537 // definitions necessary in the rest of the architecture description
 538 source %{
 539 #define   RELOC_IMM64    Assembler::imm_operand
 540 #define   RELOC_DISP32   Assembler::disp32_operand
 541 
 542 #define __ _masm.
 543 
 544 static bool generate_vzeroupper(Compile* C) {
 545   return (VM_Version::supports_vzeroupper() && (C->max_vector_size() > 16 || C->clear_upper_avx() == true)) ? true: false;  // Generate vzeroupper
 546 }
 547 
 548 static int clear_avx_size() {
 549   return generate_vzeroupper(Compile::current()) ? 3: 0;  // vzeroupper
 550 }
 551 
 552 // !!!!! Special hack to get all types of calls to specify the byte offset


6675   ins_encode %{
6676     __ movl($dst$$Register, $src$$Register);
6677   %}
6678   ins_pipe(ialu_reg_reg); // XXX
6679 %}
6680 
6681 // Convert compressed oop into int for vectors alignment masking
6682 // in case of 32bit oops (heap < 4Gb).
6683 instruct convN2I(rRegI dst, rRegN src)
6684 %{
6685   predicate(Universe::narrow_oop_shift() == 0);
6686   match(Set dst (ConvL2I (CastP2X (DecodeN src))));
6687 
6688   format %{ "movl    $dst, $src\t# compressed ptr -> int" %}
6689   ins_encode %{
6690     __ movl($dst$$Register, $src$$Register);
6691   %}
6692   ins_pipe(ialu_reg_reg); // XXX
6693 %}
6694 





















































6695 // Convert oop pointer into compressed form
6696 instruct encodeHeapOop(rRegN dst, rRegP src, rFlagsReg cr) %{
6697   predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull);
6698   match(Set dst (EncodeP src));
6699   effect(KILL cr);
6700   format %{ "encode_heap_oop $dst,$src" %}
6701   ins_encode %{
6702     Register s = $src$$Register;
6703     Register d = $dst$$Register;
6704     if (s != d) {
6705       __ movq(d, s);
6706     }
6707     __ encode_heap_oop(d);
6708   %}
6709   ins_pipe(ialu_reg_long);
6710 %}
6711 
6712 instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
6713   predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull);
6714   match(Set dst (EncodeP src));


7544   predicate(VM_Version::supports_cx8());
7545   match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
7546   match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval)));
7547   effect(KILL cr, KILL oldval);
7548 
7549   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7550             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7551             "sete    $res\n\t"
7552             "movzbl  $res, $res" %}
7553   opcode(0x0F, 0xB1);
7554   ins_encode(lock_prefix,
7555              REX_reg_mem_wide(newval, mem_ptr),
7556              OpcP, OpcS,
7557              reg_mem(newval, mem_ptr),
7558              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete
7559              REX_reg_breg(res, res), // movzbl
7560              Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
7561   ins_pipe( pipe_cmpxchg );
7562 %}
7563 



























7564 instruct compareAndSwapL(rRegI res,
7565                          memory mem_ptr,
7566                          rax_RegL oldval, rRegL newval,
7567                          rFlagsReg cr)
7568 %{
7569   predicate(VM_Version::supports_cx8());
7570   match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
7571   match(Set res (WeakCompareAndSwapL mem_ptr (Binary oldval newval)));
7572   effect(KILL cr, KILL oldval);
7573 
7574   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7575             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7576             "sete    $res\n\t"
7577             "movzbl  $res, $res" %}
7578   opcode(0x0F, 0xB1);
7579   ins_encode(lock_prefix,
7580              REX_reg_mem_wide(newval, mem_ptr),
7581              OpcP, OpcS,
7582              reg_mem(newval, mem_ptr),
7583              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete


7665                           rFlagsReg cr) %{
7666   match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
7667   match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval)));
7668   effect(KILL cr, KILL oldval);
7669 
7670   format %{ "cmpxchgl $mem_ptr,$newval\t# "
7671             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7672             "sete    $res\n\t"
7673             "movzbl  $res, $res" %}
7674   opcode(0x0F, 0xB1);
7675   ins_encode(lock_prefix,
7676              REX_reg_mem(newval, mem_ptr),
7677              OpcP, OpcS,
7678              reg_mem(newval, mem_ptr),
7679              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete
7680              REX_reg_breg(res, res), // movzbl
7681              Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
7682   ins_pipe( pipe_cmpxchg );
7683 %}
7684 

























7685 instruct compareAndExchangeB(
7686                          memory mem_ptr,
7687                          rax_RegI oldval, rRegI newval,
7688                          rFlagsReg cr)
7689 %{
7690   match(Set oldval (CompareAndExchangeB mem_ptr (Binary oldval newval)));
7691   effect(KILL cr);
7692 
7693   format %{ "cmpxchgb $mem_ptr,$newval\t# "
7694             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"  %}
7695   opcode(0x0F, 0xB0);
7696   ins_encode(lock_prefix,
7697              REX_breg_mem(newval, mem_ptr),
7698              OpcP, OpcS,
7699              reg_mem(newval, mem_ptr) // lock cmpxchg
7700              );
7701   ins_pipe( pipe_cmpxchg );
7702 %}
7703 
7704 instruct compareAndExchangeS(


7761 %}
7762 
7763 instruct compareAndExchangeN(
7764                           memory mem_ptr,
7765                           rax_RegN oldval, rRegN newval,
7766                           rFlagsReg cr) %{
7767   match(Set oldval (CompareAndExchangeN mem_ptr (Binary oldval newval)));
7768   effect(KILL cr);
7769 
7770   format %{ "cmpxchgl $mem_ptr,$newval\t# "
7771             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %}
7772   opcode(0x0F, 0xB1);
7773   ins_encode(lock_prefix,
7774              REX_reg_mem(newval, mem_ptr),
7775              OpcP, OpcS,
7776              reg_mem(newval, mem_ptr)  // lock cmpxchg
7777           );
7778   ins_pipe( pipe_cmpxchg );
7779 %}
7780 























7781 instruct compareAndExchangeP(
7782                          memory mem_ptr,
7783                          rax_RegP oldval, rRegP newval,
7784                          rFlagsReg cr)
7785 %{
7786   predicate(VM_Version::supports_cx8());
7787   match(Set oldval (CompareAndExchangeP mem_ptr (Binary oldval newval)));
7788   effect(KILL cr);
7789 
7790   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7791             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %}
7792   opcode(0x0F, 0xB1);
7793   ins_encode(lock_prefix,
7794              REX_reg_mem_wide(newval, mem_ptr),
7795              OpcP, OpcS,
7796              reg_mem(newval, mem_ptr)  // lock cmpxchg
7797           );


























7798   ins_pipe( pipe_cmpxchg );
7799 %}
7800 
7801 instruct xaddB_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{
7802   predicate(n->as_LoadStore()->result_not_used());
7803   match(Set dummy (GetAndAddB mem add));
7804   effect(KILL cr);
7805   format %{ "ADDB  [$mem],$add" %}
7806   ins_encode %{
7807     __ lock();
7808     __ addb($mem$$Address, $add$$constant);
7809   %}
7810   ins_pipe( pipe_cmpxchg );
7811 %}
7812 
7813 instruct xaddB( memory mem, rRegI newval, rFlagsReg cr) %{
7814   match(Set newval (GetAndAddB mem newval));
7815   effect(KILL cr);
7816   format %{ "XADDB  [$mem],$newval" %}
7817   ins_encode %{




 513 reg_class int_rbx_reg(RBX);
 514 
 515 // Singleton class for RCX int register
 516 reg_class int_rcx_reg(RCX);
 517 
 518 // Singleton class for RCX int register
 519 reg_class int_rdx_reg(RDX);
 520 
 521 // Singleton class for RCX int register
 522 reg_class int_rdi_reg(RDI);
 523 
 524 // Singleton class for instruction pointer
 525 // reg_class ip_reg(RIP);
 526 
 527 %}
 528 
 529 source_hpp %{
 530 #if INCLUDE_ZGC
 531 #include "gc/z/zBarrierSetAssembler.hpp"
 532 #endif
 533 #if INCLUDE_SHENANDOAHGC
 534 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
 535 #endif
 536 %}
 537 
 538 //----------SOURCE BLOCK-------------------------------------------------------
 539 // This is a block of C++ code which provides values, functions, and
 540 // definitions necessary in the rest of the architecture description
 541 source %{
 542 #define   RELOC_IMM64    Assembler::imm_operand
 543 #define   RELOC_DISP32   Assembler::disp32_operand
 544 
 545 #define __ _masm.
 546 
 547 static bool generate_vzeroupper(Compile* C) {
 548   return (VM_Version::supports_vzeroupper() && (C->max_vector_size() > 16 || C->clear_upper_avx() == true)) ? true: false;  // Generate vzeroupper
 549 }
 550 
 551 static int clear_avx_size() {
 552   return generate_vzeroupper(Compile::current()) ? 3: 0;  // vzeroupper
 553 }
 554 
 555 // !!!!! Special hack to get all types of calls to specify the byte offset


6678   ins_encode %{
6679     __ movl($dst$$Register, $src$$Register);
6680   %}
6681   ins_pipe(ialu_reg_reg); // XXX
6682 %}
6683 
6684 // Convert compressed oop into int for vectors alignment masking
6685 // in case of 32bit oops (heap < 4Gb).
6686 instruct convN2I(rRegI dst, rRegN src)
6687 %{
6688   predicate(Universe::narrow_oop_shift() == 0);
6689   match(Set dst (ConvL2I (CastP2X (DecodeN src))));
6690 
6691   format %{ "movl    $dst, $src\t# compressed ptr -> int" %}
6692   ins_encode %{
6693     __ movl($dst$$Register, $src$$Register);
6694   %}
6695   ins_pipe(ialu_reg_reg); // XXX
6696 %}
6697 
6698 instruct shenandoahRB(rRegP dst, rRegP src, rFlagsReg cr) %{
6699   match(Set dst (ShenandoahReadBarrier src));
6700   effect(DEF dst, USE src);
6701   ins_cost(125); // XXX
6702   format %{ "shenandoah_rb $dst, $src" %}
6703   ins_encode %{
6704 #if INCLUDE_SHENANDOAHGC
6705     Register d = $dst$$Register;
6706     Register s = $src$$Register;
6707     __ movptr(d, Address(s, ShenandoahBrooksPointer::byte_offset()));
6708 #else
6709     ShouldNotReachHere();
6710 #endif
6711   %}
6712   ins_pipe(ialu_reg_mem);
6713 %}
6714 
6715 instruct shenandoahRBNarrow(rRegP dst, rRegN src) %{
6716   predicate(UseCompressedOops && (Universe::narrow_oop_shift() == 0));
6717   match(Set dst (ShenandoahReadBarrier (DecodeN src)));
6718   effect(DEF dst, USE src);
6719   ins_cost(125); // XXX
6720   format %{ "shenandoah_rb $dst, $src" %}
6721   ins_encode %{
6722 #if INCLUDE_SHENANDOAHGC
6723     Register d = $dst$$Register;
6724     Register s = $src$$Register;
6725     __ movptr(d, Address(r12, s, Address::times_1, ShenandoahBrooksPointer::byte_offset()));
6726 #else
6727     ShouldNotReachHere();
6728 #endif
6729   %}
6730   ins_pipe(ialu_reg_mem);
6731 %}
6732 
6733 instruct shenandoahRBNarrowShift(rRegP dst, rRegN src) %{
6734   predicate(UseCompressedOops && (Universe::narrow_oop_shift() == Address::times_8));
6735   match(Set dst (ShenandoahReadBarrier (DecodeN src)));
6736   effect(DEF dst, USE src);
6737   ins_cost(125); // XXX
6738   format %{ "shenandoah_rb $dst, $src" %}
6739   ins_encode %{
6740 #if INCLUDE_SHENANDOAHGC
6741     Register d = $dst$$Register;
6742     Register s = $src$$Register;
6743     __ movptr(d, Address(r12, s, Address::times_8, ShenandoahBrooksPointer::byte_offset()));
6744 #else
6745     ShouldNotReachHere();
6746 #endif
6747   %}
6748   ins_pipe(ialu_reg_mem);
6749 %}
6750 
6751 // Convert oop pointer into compressed form
6752 instruct encodeHeapOop(rRegN dst, rRegP src, rFlagsReg cr) %{
6753   predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull);
6754   match(Set dst (EncodeP src));
6755   effect(KILL cr);
6756   format %{ "encode_heap_oop $dst,$src" %}
6757   ins_encode %{
6758     Register s = $src$$Register;
6759     Register d = $dst$$Register;
6760     if (s != d) {
6761       __ movq(d, s);
6762     }
6763     __ encode_heap_oop(d);
6764   %}
6765   ins_pipe(ialu_reg_long);
6766 %}
6767 
6768 instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
6769   predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull);
6770   match(Set dst (EncodeP src));


7600   predicate(VM_Version::supports_cx8());
7601   match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
7602   match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval)));
7603   effect(KILL cr, KILL oldval);
7604 
7605   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7606             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7607             "sete    $res\n\t"
7608             "movzbl  $res, $res" %}
7609   opcode(0x0F, 0xB1);
7610   ins_encode(lock_prefix,
7611              REX_reg_mem_wide(newval, mem_ptr),
7612              OpcP, OpcS,
7613              reg_mem(newval, mem_ptr),
7614              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete
7615              REX_reg_breg(res, res), // movzbl
7616              Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
7617   ins_pipe( pipe_cmpxchg );
7618 %}
7619 
7620 instruct compareAndSwapP_shenandoah(rRegI res,
7621                                     memory mem_ptr,
7622                                     rRegP tmp1, rRegP tmp2,
7623                                     rax_RegP oldval, rRegP newval,
7624                                     rFlagsReg cr)
7625 %{
7626   predicate(VM_Version::supports_cx8());
7627   match(Set res (ShenandoahCompareAndSwapP mem_ptr (Binary oldval newval)));
7628   match(Set res (ShenandoahWeakCompareAndSwapP mem_ptr (Binary oldval newval)));
7629   effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
7630 
7631   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
7632 
7633   ins_encode %{
7634 #if INCLUDE_SHENANDOAHGC
7635     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
7636                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
7637                                                    false, // swap
7638                                                    false, $tmp1$$Register, $tmp2$$Register
7639                                                    );
7640 #else
7641     ShouldNotReachHere();
7642 #endif
7643   %}
7644   ins_pipe( pipe_cmpxchg );
7645 %}
7646 
7647 instruct compareAndSwapL(rRegI res,
7648                          memory mem_ptr,
7649                          rax_RegL oldval, rRegL newval,
7650                          rFlagsReg cr)
7651 %{
7652   predicate(VM_Version::supports_cx8());
7653   match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
7654   match(Set res (WeakCompareAndSwapL mem_ptr (Binary oldval newval)));
7655   effect(KILL cr, KILL oldval);
7656 
7657   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7658             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7659             "sete    $res\n\t"
7660             "movzbl  $res, $res" %}
7661   opcode(0x0F, 0xB1);
7662   ins_encode(lock_prefix,
7663              REX_reg_mem_wide(newval, mem_ptr),
7664              OpcP, OpcS,
7665              reg_mem(newval, mem_ptr),
7666              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete


7748                           rFlagsReg cr) %{
7749   match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
7750   match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval)));
7751   effect(KILL cr, KILL oldval);
7752 
7753   format %{ "cmpxchgl $mem_ptr,$newval\t# "
7754             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"
7755             "sete    $res\n\t"
7756             "movzbl  $res, $res" %}
7757   opcode(0x0F, 0xB1);
7758   ins_encode(lock_prefix,
7759              REX_reg_mem(newval, mem_ptr),
7760              OpcP, OpcS,
7761              reg_mem(newval, mem_ptr),
7762              REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete
7763              REX_reg_breg(res, res), // movzbl
7764              Opcode(0xF), Opcode(0xB6), reg_reg(res, res));
7765   ins_pipe( pipe_cmpxchg );
7766 %}
7767 
7768 instruct compareAndSwapN_shenandoah(rRegI res,
7769                                     memory mem_ptr,
7770                                     rRegP tmp1, rRegP tmp2,
7771                                     rax_RegN oldval, rRegN newval,
7772                                     rFlagsReg cr) %{
7773   match(Set res (ShenandoahCompareAndSwapN mem_ptr (Binary oldval newval)));
7774   match(Set res (ShenandoahWeakCompareAndSwapN mem_ptr (Binary oldval newval)));
7775   effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
7776 
7777   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
7778 
7779   ins_encode %{
7780 #if INCLUDE_SHENANDOAHGC
7781     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
7782                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
7783                                                    false, // swap
7784                                                    false, $tmp1$$Register, $tmp2$$Register
7785                                                    );
7786 #else
7787     ShouldNotReachHere();
7788 #endif
7789   %}
7790   ins_pipe( pipe_cmpxchg );
7791 %}
7792 
7793 instruct compareAndExchangeB(
7794                          memory mem_ptr,
7795                          rax_RegI oldval, rRegI newval,
7796                          rFlagsReg cr)
7797 %{
7798   match(Set oldval (CompareAndExchangeB mem_ptr (Binary oldval newval)));
7799   effect(KILL cr);
7800 
7801   format %{ "cmpxchgb $mem_ptr,$newval\t# "
7802             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t"  %}
7803   opcode(0x0F, 0xB0);
7804   ins_encode(lock_prefix,
7805              REX_breg_mem(newval, mem_ptr),
7806              OpcP, OpcS,
7807              reg_mem(newval, mem_ptr) // lock cmpxchg
7808              );
7809   ins_pipe( pipe_cmpxchg );
7810 %}
7811 
7812 instruct compareAndExchangeS(


7869 %}
7870 
7871 instruct compareAndExchangeN(
7872                           memory mem_ptr,
7873                           rax_RegN oldval, rRegN newval,
7874                           rFlagsReg cr) %{
7875   match(Set oldval (CompareAndExchangeN mem_ptr (Binary oldval newval)));
7876   effect(KILL cr);
7877 
7878   format %{ "cmpxchgl $mem_ptr,$newval\t# "
7879             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %}
7880   opcode(0x0F, 0xB1);
7881   ins_encode(lock_prefix,
7882              REX_reg_mem(newval, mem_ptr),
7883              OpcP, OpcS,
7884              reg_mem(newval, mem_ptr)  // lock cmpxchg
7885           );
7886   ins_pipe( pipe_cmpxchg );
7887 %}
7888 
7889 instruct compareAndExchangeN_shenandoah(memory mem_ptr,
7890                                         rax_RegN oldval, rRegN newval,
7891                                         rRegP tmp1, rRegP tmp2,
7892                                         rFlagsReg cr) %{
7893   match(Set oldval (ShenandoahCompareAndExchangeN mem_ptr (Binary oldval newval)));
7894   effect(TEMP tmp1, TEMP tmp2, KILL cr);
7895 
7896   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
7897 
7898   ins_encode %{
7899 #if INCLUDE_SHENANDOAHGC
7900     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
7901                                                    NULL, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
7902                                                    true, // exchange
7903                                                    false, $tmp1$$Register, $tmp2$$Register
7904                                                    );
7905 #else
7906     ShouldNotReachHere();
7907 #endif
7908   %}
7909   ins_pipe( pipe_cmpxchg );
7910 %}
7911 
7912 instruct compareAndExchangeP(
7913                          memory mem_ptr,
7914                          rax_RegP oldval, rRegP newval,
7915                          rFlagsReg cr)
7916 %{
7917   predicate(VM_Version::supports_cx8());
7918   match(Set oldval (CompareAndExchangeP mem_ptr (Binary oldval newval)));
7919   effect(KILL cr);
7920 
7921   format %{ "cmpxchgq $mem_ptr,$newval\t# "
7922             "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %}
7923   opcode(0x0F, 0xB1);
7924   ins_encode(lock_prefix,
7925              REX_reg_mem_wide(newval, mem_ptr),
7926              OpcP, OpcS,
7927              reg_mem(newval, mem_ptr)  // lock cmpxchg
7928           );
7929   ins_pipe( pipe_cmpxchg );
7930 %}
7931 
7932 instruct compareAndExchangeP_shenandoah(memory mem_ptr,
7933                                         rax_RegP oldval, rRegP newval,
7934                                         rRegP tmp1, rRegP tmp2,
7935                                         rFlagsReg cr)
7936 %{
7937   predicate(VM_Version::supports_cx8());
7938   match(Set oldval (ShenandoahCompareAndExchangeP mem_ptr (Binary oldval newval)));
7939   effect(KILL cr, TEMP tmp1, TEMP tmp2);
7940   ins_cost(1000);
7941 
7942   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
7943 
7944   ins_encode %{
7945 #if INCLUDE_SHENANDOAHGC
7946     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
7947                                                    NULL, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
7948                                                    true,  // exchange
7949                                                    false, $tmp1$$Register, $tmp2$$Register
7950                                                    );
7951 #else
7952     ShouldNotReachHere();
7953 #endif
7954   %}
7955   ins_pipe( pipe_cmpxchg );
7956 %}
7957 
7958 instruct xaddB_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{
7959   predicate(n->as_LoadStore()->result_not_used());
7960   match(Set dummy (GetAndAddB mem add));
7961   effect(KILL cr);
7962   format %{ "ADDB  [$mem],$add" %}
7963   ins_encode %{
7964     __ lock();
7965     __ addb($mem$$Address, $add$$constant);
7966   %}
7967   ins_pipe( pipe_cmpxchg );
7968 %}
7969 
7970 instruct xaddB( memory mem, rRegI newval, rFlagsReg cr) %{
7971   match(Set newval (GetAndAddB mem newval));
7972   effect(KILL cr);
7973   format %{ "XADDB  [$mem],$newval" %}
7974   ins_encode %{


< prev index next >