Print this page
rev 1838 : 6961690: load oops from constant table on SPARC
Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/x86_64.ad
          +++ new/src/cpu/x86/vm/x86_64.ad
↓ open down ↓ 825 lines elided ↑ open up ↑
 826  826      // reg-reg copy, use an empty encoding
 827  827    } else {
 828  828      MacroAssembler _masm(&cbuf);
 829  829  
 830  830      __ movdqa(as_XMMRegister(dst_encoding), as_XMMRegister(src_encoding));
 831  831    }
 832  832  }
 833  833  
 834  834  
 835  835  //=============================================================================
      836 +const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
      837 +
      838 +void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
      839 +  emit_constant_table(cbuf);
      840 +  set_table_base_offset(0);
      841 +  // Empty encoding
      842 +}
      843 +
      844 +uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const {
      845 +  // Compute the size (even if it's zero) since
      846 +  // Compile::Shorten_branches needs the table to be emitted (which
      847 +  // happens in Compile::scratch_emit_size) to calculate the size for
      848 +  // MachConstantNodes.
      849 +  return MachNode::size(ra_);
      850 +}
      851 +
      852 +#ifndef PRODUCT
      853 +void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
      854 +  st->print("# MachConstantBase (empty encoding)");
      855 +}
      856 +#endif
      857 +
      858 +
      859 +//=============================================================================
 836  860  #ifndef PRODUCT
 837  861  void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const
 838  862  {
 839  863    Compile* C = ra_->C;
 840  864  
 841  865    int framesize = C->frame_slots() << LogBytesPerInt;
 842  866    assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
 843  867    // Remove wordSize for return adr already pushed
 844  868    // and another for the RBP we are going to save
 845  869    framesize -= 2*wordSize;
↓ open down ↓ 1069 lines elided ↑ open up ↑
1915 1939    __ call(next, relocInfo::none); // reloc none is fine since it is a disp32
1916 1940    __ bind(next);
1917 1941    // adjust it so it matches "the_pc"
1918 1942    __ subptr(Address(rsp, 0), __ offset() - offset);
1919 1943    __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
1920 1944    assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow");
1921 1945    __ end_a_stub();
1922 1946    return offset;
1923 1947  }
1924 1948  
1925      -static void emit_double_constant(CodeBuffer& cbuf, double x) {
1926      -  int mark = cbuf.insts()->mark_off();
1927      -  MacroAssembler _masm(&cbuf);
1928      -  address double_address = __ double_constant(x);
1929      -  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
1930      -  emit_d32_reloc(cbuf,
1931      -                 (int) (double_address - cbuf.insts_end() - 4),
1932      -                 internal_word_Relocation::spec(double_address),
1933      -                 RELOC_DISP32);
1934      -}
1935      -
1936      -static void emit_float_constant(CodeBuffer& cbuf, float x) {
1937      -  int mark = cbuf.insts()->mark_off();
1938      -  MacroAssembler _masm(&cbuf);
1939      -  address float_address = __ float_constant(x);
1940      -  cbuf.insts()->set_mark_off(mark);  // preserve mark across masm shift
1941      -  emit_d32_reloc(cbuf,
1942      -                 (int) (float_address - cbuf.insts_end() - 4),
1943      -                 internal_word_Relocation::spec(float_address),
1944      -                 RELOC_DISP32);
1945      -}
1946      -
1947 1949  
1948 1950  const bool Matcher::match_rule_supported(int opcode) {
1949 1951    if (!has_match_rule(opcode))
1950 1952      return false;
1951 1953  
1952 1954    return true;  // Per default match rules are supported.
1953 1955  }
1954 1956  
1955 1957  int Matcher::regnum_to_fpu_offset(int regnum)
1956 1958  {
↓ open down ↓ 825 lines elided ↑ open up ↑
2782 2784      }
2783 2785      emit_opcode(cbuf, 0xB8 | dstenc);
2784 2786      // This next line should be generated from ADLC
2785 2787      if ($src->constant_is_oop()) {
2786 2788        emit_d64_reloc(cbuf, $src$$constant, relocInfo::oop_type, RELOC_IMM64);
2787 2789      } else {
2788 2790        emit_d64(cbuf, $src$$constant);
2789 2791      }
2790 2792    %}
2791 2793  
2792      -  enc_class load_immF(regF dst, immF con)
2793      -  %{
2794      -    // XXX reg_mem doesn't support RIP-relative addressing yet
2795      -    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
2796      -    emit_float_constant(cbuf, $con$$constant);
2797      -  %}
2798      -
2799      -  enc_class load_immD(regD dst, immD con)
2800      -  %{
2801      -    // XXX reg_mem doesn't support RIP-relative addressing yet
2802      -    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
2803      -    emit_double_constant(cbuf, $con$$constant);
2804      -  %}
2805      -
2806      -  enc_class load_conF (regF dst, immF con) %{    // Load float constant
2807      -    emit_opcode(cbuf, 0xF3);
2808      -    if ($dst$$reg >= 8) {
2809      -      emit_opcode(cbuf, Assembler::REX_R);
2810      -    }
2811      -    emit_opcode(cbuf, 0x0F);
2812      -    emit_opcode(cbuf, 0x10);
2813      -    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
2814      -    emit_float_constant(cbuf, $con$$constant);
2815      -  %}
2816      -
2817      -  enc_class load_conD (regD dst, immD con) %{    // Load double constant
2818      -    // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con)
2819      -    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66);
2820      -    if ($dst$$reg >= 8) {
2821      -      emit_opcode(cbuf, Assembler::REX_R);
2822      -    }
2823      -    emit_opcode(cbuf, 0x0F);
2824      -    emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12);
2825      -    emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
2826      -    emit_double_constant(cbuf, $con$$constant);
2827      -  %}
2828      -
2829 2794    // Encode a reg-reg copy.  If it is useless, then empty encoding.
2830 2795    enc_class enc_copy(rRegI dst, rRegI src)
2831 2796    %{
2832 2797      encode_copy(cbuf, $dst$$reg, $src$$reg);
2833 2798    %}
2834 2799  
2835 2800    // Encode xmm reg-reg copy.  If it is useless, then empty encoding.
2836 2801    enc_class enc_CopyXD( RegD dst, RegD src ) %{
2837 2802      encode_CopyXD( cbuf, $dst$$reg, $src$$reg );
2838 2803    %}
↓ open down ↓ 80 lines elided ↑ open up ↑
2919 2884    %{
2920 2885      emit_d32(cbuf,$src$$constant);
2921 2886    %}
2922 2887  
2923 2888    enc_class conmemref (rRegP t1) %{    // Con32(storeImmI)
2924 2889      // Output immediate memory reference
2925 2890      emit_rm(cbuf, 0x00, $t1$$reg, 0x05 );
2926 2891      emit_d32(cbuf, 0x00);
2927 2892    %}
2928 2893  
2929      -  enc_class jump_enc(rRegL switch_val, rRegI dest) %{
2930      -    MacroAssembler masm(&cbuf);
2931      -
2932      -    Register switch_reg = as_Register($switch_val$$reg);
2933      -    Register dest_reg   = as_Register($dest$$reg);
2934      -    address table_base  = masm.address_table_constant(_index2label);
2935      -
2936      -    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
2937      -    // to do that and the compiler is using that register as one it can allocate.
2938      -    // So we build it all by hand.
2939      -    // Address index(noreg, switch_reg, Address::times_1);
2940      -    // ArrayAddress dispatch(table, index);
2941      -
2942      -    Address dispatch(dest_reg, switch_reg, Address::times_1);
2943      -
2944      -    masm.lea(dest_reg, InternalAddress(table_base));
2945      -    masm.jmp(dispatch);
2946      -  %}
2947      -
2948      -  enc_class jump_enc_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) %{
2949      -    MacroAssembler masm(&cbuf);
2950      -
2951      -    Register switch_reg = as_Register($switch_val$$reg);
2952      -    Register dest_reg   = as_Register($dest$$reg);
2953      -    address table_base  = masm.address_table_constant(_index2label);
2954      -
2955      -    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
2956      -    // to do that and the compiler is using that register as one it can allocate.
2957      -    // So we build it all by hand.
2958      -    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
2959      -    // ArrayAddress dispatch(table, index);
2960      -
2961      -    Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
2962      -
2963      -    masm.lea(dest_reg, InternalAddress(table_base));
2964      -    masm.jmp(dispatch);
2965      -  %}
2966      -
2967      -  enc_class jump_enc_offset(rRegL switch_val, immI2 shift, rRegI dest) %{
2968      -    MacroAssembler masm(&cbuf);
2969      -
2970      -    Register switch_reg = as_Register($switch_val$$reg);
2971      -    Register dest_reg   = as_Register($dest$$reg);
2972      -    address table_base  = masm.address_table_constant(_index2label);
2973      -
2974      -    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
2975      -    // to do that and the compiler is using that register as one it can allocate.
2976      -    // So we build it all by hand.
2977      -    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
2978      -    // ArrayAddress dispatch(table, index);
2979      -
2980      -    Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant);
2981      -    masm.lea(dest_reg, InternalAddress(table_base));
2982      -    masm.jmp(dispatch);
2983      -
2984      -  %}
2985      -
2986 2894    enc_class lock_prefix()
2987 2895    %{
2988 2896      if (os::is_MP()) {
2989 2897        emit_opcode(cbuf, 0xF0); // lock
2990 2898      }
2991 2899    %}
2992 2900  
2993 2901    enc_class REX_mem(memory mem)
2994 2902    %{
2995 2903      if ($mem$$base >= 8) {
↓ open down ↓ 3638 lines elided ↑ open up ↑
6634 6542  instruct loadConL32(rRegL dst, immL32 src)
6635 6543  %{
6636 6544    match(Set dst src);
6637 6545  
6638 6546    ins_cost(70);
6639 6547    format %{ "movq    $dst, $src\t# long (32-bit)" %}
6640 6548    ins_encode(load_immL32(dst, src));
6641 6549    ins_pipe(ialu_reg);
6642 6550  %}
6643 6551  
6644      -instruct loadConP(rRegP dst, immP src)
6645      -%{
6646      -  match(Set dst src);
     6552 +instruct loadConP(rRegP dst, immP con) %{
     6553 +  match(Set dst con);
6647 6554  
6648      -  format %{ "movq    $dst, $src\t# ptr" %}
6649      -  ins_encode(load_immP(dst, src));
     6555 +  format %{ "movq    $dst, $con\t# ptr" %}
     6556 +  ins_encode(load_immP(dst, con));
6650 6557    ins_pipe(ialu_reg_fat); // XXX
6651 6558  %}
6652 6559  
6653 6560  instruct loadConP0(rRegP dst, immP0 src, rFlagsReg cr)
6654 6561  %{
6655 6562    match(Set dst src);
6656 6563    effect(KILL cr);
6657 6564  
6658 6565    ins_cost(50);
6659 6566    format %{ "xorl    $dst, $dst\t# ptr" %}
↓ open down ↓ 6 lines elided ↑ open up ↑
6666 6573  %{
6667 6574    match(Set dst src);
6668 6575    effect(KILL cr);
6669 6576  
6670 6577    ins_cost(60);
6671 6578    format %{ "movl    $dst, $src\t# ptr (positive 32-bit)" %}
6672 6579    ins_encode(load_immP31(dst, src));
6673 6580    ins_pipe(ialu_reg);
6674 6581  %}
6675 6582  
6676      -instruct loadConF(regF dst, immF src)
6677      -%{
6678      -  match(Set dst src);
     6583 +instruct loadConF(regF dst, immF con) %{
     6584 +  match(Set dst con);
6679 6585    ins_cost(125);
6680      -
6681      -  format %{ "movss   $dst, [$src]" %}
6682      -  ins_encode(load_conF(dst, src));
     6586 +  format %{ "movss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
     6587 +  ins_encode %{
     6588 +    __ movflt($dst$$XMMRegister, $constantaddress($con));
     6589 +  %}
6683 6590    ins_pipe(pipe_slow);
6684 6591  %}
6685 6592  
6686 6593  instruct loadConN0(rRegN dst, immN0 src, rFlagsReg cr) %{
6687 6594    match(Set dst src);
6688 6595    effect(KILL cr);
6689 6596    format %{ "xorq    $dst, $src\t# compressed NULL ptr" %}
6690 6597    ins_encode %{
6691 6598      __ xorq($dst$$Register, $dst$$Register);
6692 6599    %}
↓ open down ↓ 21 lines elided ↑ open up ↑
6714 6621    match(Set dst src);
6715 6622    ins_cost(100);
6716 6623  
6717 6624    format %{ "xorps   $dst, $dst\t# float 0.0" %}
6718 6625    opcode(0x0F, 0x57);
6719 6626    ins_encode(REX_reg_reg(dst, dst), OpcP, OpcS, reg_reg(dst, dst));
6720 6627    ins_pipe(pipe_slow);
6721 6628  %}
6722 6629  
6723 6630  // Use the same format since predicate() can not be used here.
6724      -instruct loadConD(regD dst, immD src)
6725      -%{
6726      -  match(Set dst src);
     6631 +instruct loadConD(regD dst, immD con) %{
     6632 +  match(Set dst con);
6727 6633    ins_cost(125);
6728      -
6729      -  format %{ "movsd   $dst, [$src]" %}
6730      -  ins_encode(load_conD(dst, src));
     6634 +  format %{ "movsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
     6635 +  ins_encode %{
     6636 +    __ movdbl($dst$$XMMRegister, $constantaddress($con));
     6637 +  %}
6731 6638    ins_pipe(pipe_slow);
6732 6639  %}
6733 6640  
6734 6641  instruct loadConD0(regD dst, immD0 src)
6735 6642  %{
6736 6643    match(Set dst src);
6737 6644    ins_cost(100);
6738 6645  
6739 6646    format %{ "xorpd   $dst, $dst\t# double 0.0" %}
6740 6647    opcode(0x66, 0x0F, 0x57);
↓ open down ↓ 946 lines elided ↑ open up ↑
7687 7594  
7688 7595  //----------Conditional Move---------------------------------------------------
7689 7596  // Jump
7690 7597  // dummy instruction for generating temp registers
7691 7598  instruct jumpXtnd_offset(rRegL switch_val, immI2 shift, rRegI dest) %{
7692 7599    match(Jump (LShiftL switch_val shift));
7693 7600    ins_cost(350);
7694 7601    predicate(false);
7695 7602    effect(TEMP dest);
7696 7603  
7697      -  format %{ "leaq    $dest, table_base\n\t"
     7604 +  format %{ "leaq    $dest, [$constantaddress]\n\t"
7698 7605              "jmp     [$dest + $switch_val << $shift]\n\t" %}
7699      -  ins_encode(jump_enc_offset(switch_val, shift, dest));
     7606 +  ins_encode %{
     7607 +    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
     7608 +    // to do that and the compiler is using that register as one it can allocate.
     7609 +    // So we build it all by hand.
     7610 +    // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
     7611 +    // ArrayAddress dispatch(table, index);
     7612 +    Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant);
     7613 +    __ lea($dest$$Register, $constantaddress);
     7614 +    __ jmp(dispatch);
     7615 +  %}
7700 7616    ins_pipe(pipe_jmp);
7701 7617    ins_pc_relative(1);
7702 7618  %}
7703 7619  
7704 7620  instruct jumpXtnd_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) %{
7705 7621    match(Jump (AddL (LShiftL switch_val shift) offset));
7706 7622    ins_cost(350);
7707 7623    effect(TEMP dest);
7708 7624  
7709      -  format %{ "leaq    $dest, table_base\n\t"
     7625 +  format %{ "leaq    $dest, [$constantaddress]\n\t"
7710 7626              "jmp     [$dest + $switch_val << $shift + $offset]\n\t" %}
7711      -  ins_encode(jump_enc_addr(switch_val, shift, offset, dest));
     7627 +  ins_encode %{
     7628 +    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
     7629 +    // to do that and the compiler is using that register as one it can allocate.
     7630 +    // So we build it all by hand.
     7631 +    // Address index(noreg, switch_reg, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
     7632 +    // ArrayAddress dispatch(table, index);
     7633 +    Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
     7634 +    __ lea($dest$$Register, $constantaddress);
     7635 +    __ jmp(dispatch);
     7636 +  %}
7712 7637    ins_pipe(pipe_jmp);
7713 7638    ins_pc_relative(1);
7714 7639  %}
7715 7640  
7716 7641  instruct jumpXtnd(rRegL switch_val, rRegI dest) %{
7717 7642    match(Jump switch_val);
7718 7643    ins_cost(350);
7719 7644    effect(TEMP dest);
7720 7645  
7721      -  format %{ "leaq    $dest, table_base\n\t"
     7646 +  format %{ "leaq    $dest, [$constantaddress]\n\t"
7722 7647              "jmp     [$dest + $switch_val]\n\t" %}
7723      -  ins_encode(jump_enc(switch_val, dest));
     7648 +  ins_encode %{
     7649 +    // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
     7650 +    // to do that and the compiler is using that register as one it can allocate.
     7651 +    // So we build it all by hand.
     7652 +    // Address index(noreg, switch_reg, Address::times_1);
     7653 +    // ArrayAddress dispatch(table, index);
     7654 +    Address dispatch($dest$$Register, $switch_val$$Register, Address::times_1);
     7655 +    __ lea($dest$$Register, $constantaddress);
     7656 +    __ jmp(dispatch);
     7657 +  %}
7724 7658    ins_pipe(pipe_jmp);
7725 7659    ins_pc_relative(1);
7726 7660  %}
7727 7661  
7728 7662  // Conditional move
7729 7663  instruct cmovI_reg(rRegI dst, rRegI src, rFlagsReg cr, cmpOp cop)
7730 7664  %{
7731 7665    match(Set dst (CMoveI (Binary cop cr) (Binary dst src)));
7732 7666  
7733 7667    ins_cost(200); // XXX
↓ open down ↓ 2635 lines elided ↑ open up ↑
10369 10303  instruct cmpF_cc_memCF(rFlagsRegUCF cr, regF src1, memory src2) %{
10370 10304    match(Set cr (CmpF src1 (LoadF src2)));
10371 10305  
10372 10306    ins_cost(100);
10373 10307    format %{ "ucomiss $src1, $src2" %}
10374 10308    opcode(0x0F, 0x2E);
10375 10309    ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, reg_mem(src1, src2));
10376 10310    ins_pipe(pipe_slow);
10377 10311  %}
10378 10312  
10379      -instruct cmpF_cc_imm(rFlagsRegU cr, regF src1, immF src2)
10380      -%{
10381      -  match(Set cr (CmpF src1 src2));
     10313 +instruct cmpF_cc_imm(rFlagsRegU cr, regF src, immF con) %{
     10314 +  match(Set cr (CmpF src con));
10382 10315  
10383 10316    ins_cost(145);
10384      -  format %{ "ucomiss $src1, $src2\n\t"
     10317 +  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
10385 10318              "jnp,s   exit\n\t"
10386 10319              "pushfq\t# saw NaN, set CF\n\t"
10387 10320              "andq    [rsp], #0xffffff2b\n\t"
10388 10321              "popfq\n"
10389 10322      "exit:   nop\t# avoid branch to branch" %}
10390      -  opcode(0x0F, 0x2E);
10391      -  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
10392      -             cmpfp_fixup);
     10323 +  ins_encode %{
     10324 +    Label L_exit;
     10325 +    __ ucomiss($src$$XMMRegister, $constantaddress($con));
     10326 +    __ jcc(Assembler::noParity, L_exit);
     10327 +    __ pushf();
     10328 +    __ andq(rsp, 0xffffff2b);
     10329 +    __ popf();
     10330 +    __ bind(L_exit);
     10331 +    __ nop();
     10332 +  %}
10393 10333    ins_pipe(pipe_slow);
10394 10334  %}
10395 10335  
10396      -instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src1, immF src2) %{
10397      -  match(Set cr (CmpF src1 src2));
10398      -
     10336 +instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{
     10337 +  match(Set cr (CmpF src con));
10399 10338    ins_cost(100);
10400      -  format %{ "ucomiss $src1, $src2" %}
10401      -  opcode(0x0F, 0x2E);
10402      -  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2));
     10339 +  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con" %}
     10340 +  ins_encode %{
     10341 +    __ ucomiss($src$$XMMRegister, $constantaddress($con));
     10342 +  %}
10403 10343    ins_pipe(pipe_slow);
10404 10344  %}
10405 10345  
10406 10346  instruct cmpD_cc_reg(rFlagsRegU cr, regD src1, regD src2)
10407 10347  %{
10408 10348    match(Set cr (CmpD src1 src2));
10409 10349  
10410 10350    ins_cost(145);
10411 10351    format %{ "ucomisd $src1, $src2\n\t"
10412 10352              "jnp,s   exit\n\t"
↓ open down ↓ 38 lines elided ↑ open up ↑
10451 10391  instruct cmpD_cc_memCF(rFlagsRegUCF cr, regD src1, memory src2) %{
10452 10392    match(Set cr (CmpD src1 (LoadD src2)));
10453 10393  
10454 10394    ins_cost(100);
10455 10395    format %{ "ucomisd $src1, $src2" %}
10456 10396    opcode(0x66, 0x0F, 0x2E);
10457 10397    ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, reg_mem(src1, src2));
10458 10398    ins_pipe(pipe_slow);
10459 10399  %}
10460 10400  
10461      -instruct cmpD_cc_imm(rFlagsRegU cr, regD src1, immD src2)
10462      -%{
10463      -  match(Set cr (CmpD src1 src2));
     10401 +instruct cmpD_cc_imm(rFlagsRegU cr, regD src, immD con) %{
     10402 +  match(Set cr (CmpD src con));
10464 10403  
10465 10404    ins_cost(145);
10466      -  format %{ "ucomisd $src1, [$src2]\n\t"
     10405 +  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
10467 10406              "jnp,s   exit\n\t"
10468 10407              "pushfq\t# saw NaN, set CF\n\t"
10469 10408              "andq    [rsp], #0xffffff2b\n\t"
10470 10409              "popfq\n"
10471 10410      "exit:   nop\t# avoid branch to branch" %}
10472      -  opcode(0x66, 0x0F, 0x2E);
10473      -  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
10474      -             cmpfp_fixup);
     10411 +  ins_encode %{
     10412 +    Label L_exit;
     10413 +    __ ucomisd($src$$XMMRegister, $constantaddress($con));
     10414 +    __ jcc(Assembler::noParity, L_exit);
     10415 +    __ pushf();
     10416 +    __ andq(rsp, 0xffffff2b);
     10417 +    __ popf();
     10418 +    __ bind(L_exit);
     10419 +    __ nop();
     10420 +  %}
10475 10421    ins_pipe(pipe_slow);
10476 10422  %}
10477 10423  
10478      -instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src1, immD src2) %{
10479      -  match(Set cr (CmpD src1 src2));
10480      -
     10424 +instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{
     10425 +  match(Set cr (CmpD src con));
10481 10426    ins_cost(100);
10482      -  format %{ "ucomisd $src1, [$src2]" %}
10483      -  opcode(0x66, 0x0F, 0x2E);
10484      -  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2));
     10427 +  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con" %}
     10428 +  ins_encode %{
     10429 +    __ ucomisd($src$$XMMRegister, $constantaddress($con));
     10430 +  %}
10485 10431    ins_pipe(pipe_slow);
10486 10432  %}
10487 10433  
10488 10434  // Compare into -1,0,1
10489 10435  instruct cmpF_reg(rRegI dst, regF src1, regF src2, rFlagsReg cr)
10490 10436  %{
10491 10437    match(Set dst (CmpF3 src1 src2));
10492 10438    effect(KILL cr);
10493 10439  
10494 10440    ins_cost(275);
↓ open down ↓ 26 lines elided ↑ open up ↑
10521 10467              "movzbl  $dst, $dst\n"
10522 10468      "done:" %}
10523 10469  
10524 10470    opcode(0x0F, 0x2E);
10525 10471    ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, reg_mem(src1, src2),
10526 10472               cmpfp3(dst));
10527 10473    ins_pipe(pipe_slow);
10528 10474  %}
10529 10475  
10530 10476  // Compare into -1,0,1
10531      -instruct cmpF_imm(rRegI dst, regF src1, immF src2, rFlagsReg cr)
10532      -%{
10533      -  match(Set dst (CmpF3 src1 src2));
     10477 +instruct cmpF_imm(rRegI dst, regF src, immF con, rFlagsReg cr) %{
     10478 +  match(Set dst (CmpF3 src con));
10534 10479    effect(KILL cr);
10535 10480  
10536 10481    ins_cost(275);
10537      -  format %{ "ucomiss $src1, [$src2]\n\t"
     10482 +  format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
10538 10483              "movl    $dst, #-1\n\t"
10539 10484              "jp,s    done\n\t"
10540 10485              "jb,s    done\n\t"
10541 10486              "setne   $dst\n\t"
10542 10487              "movzbl  $dst, $dst\n"
10543 10488      "done:" %}
10544      -
10545      -  opcode(0x0F, 0x2E);
10546      -  ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
10547      -             cmpfp3(dst));
     10489 +  ins_encode %{
     10490 +    Label L_done;
     10491 +    Register Rdst = $dst$$Register;
     10492 +    __ ucomiss($src$$XMMRegister, $constantaddress($con));
     10493 +    __ movl(Rdst, -1);
     10494 +    __ jcc(Assembler::parity, L_done);
     10495 +    __ jcc(Assembler::below, L_done);
     10496 +    __ setb(Assembler::notEqual, Rdst);
     10497 +    __ movzbl(Rdst, Rdst);
     10498 +    __ bind(L_done);
     10499 +  %}
10548 10500    ins_pipe(pipe_slow);
10549 10501  %}
10550 10502  
10551 10503  // Compare into -1,0,1
10552 10504  instruct cmpD_reg(rRegI dst, regD src1, regD src2, rFlagsReg cr)
10553 10505  %{
10554 10506    match(Set dst (CmpD3 src1 src2));
10555 10507    effect(KILL cr);
10556 10508  
10557 10509    ins_cost(275);
↓ open down ↓ 26 lines elided ↑ open up ↑
10584 10536              "movzbl  $dst, $dst\n"
10585 10537      "done:" %}
10586 10538  
10587 10539    opcode(0x66, 0x0F, 0x2E);
10588 10540    ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, reg_mem(src1, src2),
10589 10541               cmpfp3(dst));
10590 10542    ins_pipe(pipe_slow);
10591 10543  %}
10592 10544  
10593 10545  // Compare into -1,0,1
10594      -instruct cmpD_imm(rRegI dst, regD src1, immD src2, rFlagsReg cr)
10595      -%{
10596      -  match(Set dst (CmpD3 src1 src2));
     10546 +instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
     10547 +  match(Set dst (CmpD3 src con));
10597 10548    effect(KILL cr);
10598 10549  
10599 10550    ins_cost(275);
10600      -  format %{ "ucomisd $src1, [$src2]\n\t"
     10551 +  format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
10601 10552              "movl    $dst, #-1\n\t"
10602 10553              "jp,s    done\n\t"
10603 10554              "jb,s    done\n\t"
10604 10555              "setne   $dst\n\t"
10605 10556              "movzbl  $dst, $dst\n"
10606 10557      "done:" %}
10607      -
10608      -  opcode(0x66, 0x0F, 0x2E);
10609      -  ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
10610      -             cmpfp3(dst));
     10558 +  ins_encode %{
     10559 +    Register Rdst = $dst$$Register;
     10560 +    Label L_done;
     10561 +    __ ucomisd($src$$XMMRegister, $constantaddress($con));
     10562 +    __ movl(Rdst, -1);
     10563 +    __ jcc(Assembler::parity, L_done);
     10564 +    __ jcc(Assembler::below, L_done);
     10565 +    __ setb(Assembler::notEqual, Rdst);
     10566 +    __ movzbl(Rdst, Rdst);
     10567 +    __ bind(L_done);
     10568 +  %}
10611 10569    ins_pipe(pipe_slow);
10612 10570  %}
10613 10571  
10614 10572  instruct addF_reg(regF dst, regF src)
10615 10573  %{
10616 10574    match(Set dst (AddF dst src));
10617 10575  
10618 10576    format %{ "addss   $dst, $src" %}
10619 10577    ins_cost(150); // XXX
10620 10578    opcode(0xF3, 0x0F, 0x58);
↓ open down ↓ 5 lines elided ↑ open up ↑
10626 10584  %{
10627 10585    match(Set dst (AddF dst (LoadF src)));
10628 10586  
10629 10587    format %{ "addss   $dst, $src" %}
10630 10588    ins_cost(150); // XXX
10631 10589    opcode(0xF3, 0x0F, 0x58);
10632 10590    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10633 10591    ins_pipe(pipe_slow);
10634 10592  %}
10635 10593  
10636      -instruct addF_imm(regF dst, immF src)
10637      -%{
10638      -  match(Set dst (AddF dst src));
10639      -
10640      -  format %{ "addss   $dst, [$src]" %}
     10594 +instruct addF_imm(regF dst, immF con) %{
     10595 +  match(Set dst (AddF dst con));
     10596 +  format %{ "addss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
10641 10597    ins_cost(150); // XXX
10642      -  opcode(0xF3, 0x0F, 0x58);
10643      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
     10598 +  ins_encode %{
     10599 +    __ addss($dst$$XMMRegister, $constantaddress($con));
     10600 +  %}
10644 10601    ins_pipe(pipe_slow);
10645 10602  %}
10646 10603  
10647 10604  instruct addD_reg(regD dst, regD src)
10648 10605  %{
10649 10606    match(Set dst (AddD dst src));
10650 10607  
10651 10608    format %{ "addsd   $dst, $src" %}
10652 10609    ins_cost(150); // XXX
10653 10610    opcode(0xF2, 0x0F, 0x58);
↓ open down ↓ 5 lines elided ↑ open up ↑
10659 10616  %{
10660 10617    match(Set dst (AddD dst (LoadD src)));
10661 10618  
10662 10619    format %{ "addsd   $dst, $src" %}
10663 10620    ins_cost(150); // XXX
10664 10621    opcode(0xF2, 0x0F, 0x58);
10665 10622    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10666 10623    ins_pipe(pipe_slow);
10667 10624  %}
10668 10625  
10669      -instruct addD_imm(regD dst, immD src)
10670      -%{
10671      -  match(Set dst (AddD dst src));
10672      -
10673      -  format %{ "addsd   $dst, [$src]" %}
     10626 +instruct addD_imm(regD dst, immD con) %{
     10627 +  match(Set dst (AddD dst con));
     10628 +  format %{ "addsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
10674 10629    ins_cost(150); // XXX
10675      -  opcode(0xF2, 0x0F, 0x58);
10676      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
     10630 +  ins_encode %{
     10631 +    __ addsd($dst$$XMMRegister, $constantaddress($con));
     10632 +  %}
10677 10633    ins_pipe(pipe_slow);
10678 10634  %}
10679 10635  
10680 10636  instruct subF_reg(regF dst, regF src)
10681 10637  %{
10682 10638    match(Set dst (SubF dst src));
10683 10639  
10684 10640    format %{ "subss   $dst, $src" %}
10685 10641    ins_cost(150); // XXX
10686 10642    opcode(0xF3, 0x0F, 0x5C);
↓ open down ↓ 5 lines elided ↑ open up ↑
10692 10648  %{
10693 10649    match(Set dst (SubF dst (LoadF src)));
10694 10650  
10695 10651    format %{ "subss   $dst, $src" %}
10696 10652    ins_cost(150); // XXX
10697 10653    opcode(0xF3, 0x0F, 0x5C);
10698 10654    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10699 10655    ins_pipe(pipe_slow);
10700 10656  %}
10701 10657  
10702      -instruct subF_imm(regF dst, immF src)
10703      -%{
10704      -  match(Set dst (SubF dst src));
10705      -
10706      -  format %{ "subss   $dst, [$src]" %}
     10658 +instruct subF_imm(regF dst, immF con) %{
     10659 +  match(Set dst (SubF dst con));
     10660 +  format %{ "subss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
10707 10661    ins_cost(150); // XXX
10708      -  opcode(0xF3, 0x0F, 0x5C);
10709      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
     10662 +  ins_encode %{
     10663 +    __ subss($dst$$XMMRegister, $constantaddress($con));
     10664 +  %}
10710 10665    ins_pipe(pipe_slow);
10711 10666  %}
10712 10667  
10713 10668  instruct subD_reg(regD dst, regD src)
10714 10669  %{
10715 10670    match(Set dst (SubD dst src));
10716 10671  
10717 10672    format %{ "subsd   $dst, $src" %}
10718 10673    ins_cost(150); // XXX
10719 10674    opcode(0xF2, 0x0F, 0x5C);
↓ open down ↓ 5 lines elided ↑ open up ↑
10725 10680  %{
10726 10681    match(Set dst (SubD dst (LoadD src)));
10727 10682  
10728 10683    format %{ "subsd   $dst, $src" %}
10729 10684    ins_cost(150); // XXX
10730 10685    opcode(0xF2, 0x0F, 0x5C);
10731 10686    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10732 10687    ins_pipe(pipe_slow);
10733 10688  %}
10734 10689  
10735      -instruct subD_imm(regD dst, immD src)
10736      -%{
10737      -  match(Set dst (SubD dst src));
10738      -
10739      -  format %{ "subsd   $dst, [$src]" %}
     10690 +instruct subD_imm(regD dst, immD con) %{
     10691 +  match(Set dst (SubD dst con));
     10692 +  format %{ "subsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
10740 10693    ins_cost(150); // XXX
10741      -  opcode(0xF2, 0x0F, 0x5C);
10742      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
     10694 +  ins_encode %{
     10695 +    __ subsd($dst$$XMMRegister, $constantaddress($con));
     10696 +  %}
10743 10697    ins_pipe(pipe_slow);
10744 10698  %}
10745 10699  
10746 10700  instruct mulF_reg(regF dst, regF src)
10747 10701  %{
10748 10702    match(Set dst (MulF dst src));
10749 10703  
10750 10704    format %{ "mulss   $dst, $src" %}
10751 10705    ins_cost(150); // XXX
10752 10706    opcode(0xF3, 0x0F, 0x59);
↓ open down ↓ 5 lines elided ↑ open up ↑
10758 10712  %{
10759 10713    match(Set dst (MulF dst (LoadF src)));
10760 10714  
10761 10715    format %{ "mulss   $dst, $src" %}
10762 10716    ins_cost(150); // XXX
10763 10717    opcode(0xF3, 0x0F, 0x59);
10764 10718    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10765 10719    ins_pipe(pipe_slow);
10766 10720  %}
10767 10721  
10768      -instruct mulF_imm(regF dst, immF src)
10769      -%{
10770      -  match(Set dst (MulF dst src));
10771      -
10772      -  format %{ "mulss   $dst, [$src]" %}
     10722 +instruct mulF_imm(regF dst, immF con) %{
     10723 +  match(Set dst (MulF dst con));
     10724 +  format %{ "mulss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
10773 10725    ins_cost(150); // XXX
10774      -  opcode(0xF3, 0x0F, 0x59);
10775      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
     10726 +  ins_encode %{
     10727 +    __ mulss($dst$$XMMRegister, $constantaddress($con));
     10728 +  %}
10776 10729    ins_pipe(pipe_slow);
10777 10730  %}
10778 10731  
10779 10732  instruct mulD_reg(regD dst, regD src)
10780 10733  %{
10781 10734    match(Set dst (MulD dst src));
10782 10735  
10783 10736    format %{ "mulsd   $dst, $src" %}
10784 10737    ins_cost(150); // XXX
10785 10738    opcode(0xF2, 0x0F, 0x59);
↓ open down ↓ 5 lines elided ↑ open up ↑
10791 10744  %{
10792 10745    match(Set dst (MulD dst (LoadD src)));
10793 10746  
10794 10747    format %{ "mulsd   $dst, $src" %}
10795 10748    ins_cost(150); // XXX
10796 10749    opcode(0xF2, 0x0F, 0x59);
10797 10750    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10798 10751    ins_pipe(pipe_slow);
10799 10752  %}
10800 10753  
10801      -instruct mulD_imm(regD dst, immD src)
10802      -%{
10803      -  match(Set dst (MulD dst src));
10804      -
10805      -  format %{ "mulsd   $dst, [$src]" %}
     10754 +instruct mulD_imm(regD dst, immD con) %{
     10755 +  match(Set dst (MulD dst con));
     10756 +  format %{ "mulsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
10806 10757    ins_cost(150); // XXX
10807      -  opcode(0xF2, 0x0F, 0x59);
10808      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
     10758 +  ins_encode %{
     10759 +    __ mulsd($dst$$XMMRegister, $constantaddress($con));
     10760 +  %}
10809 10761    ins_pipe(pipe_slow);
10810 10762  %}
10811 10763  
10812 10764  instruct divF_reg(regF dst, regF src)
10813 10765  %{
10814 10766    match(Set dst (DivF dst src));
10815 10767  
10816 10768    format %{ "divss   $dst, $src" %}
10817 10769    ins_cost(150); // XXX
10818 10770    opcode(0xF3, 0x0F, 0x5E);
↓ open down ↓ 5 lines elided ↑ open up ↑
10824 10776  %{
10825 10777    match(Set dst (DivF dst (LoadF src)));
10826 10778  
10827 10779    format %{ "divss   $dst, $src" %}
10828 10780    ins_cost(150); // XXX
10829 10781    opcode(0xF3, 0x0F, 0x5E);
10830 10782    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10831 10783    ins_pipe(pipe_slow);
10832 10784  %}
10833 10785  
10834      -instruct divF_imm(regF dst, immF src)
10835      -%{
10836      -  match(Set dst (DivF dst src));
10837      -
10838      -  format %{ "divss   $dst, [$src]" %}
     10786 +instruct divF_imm(regF dst, immF con) %{
     10787 +  match(Set dst (DivF dst con));
     10788 +  format %{ "divss   $dst, [$constantaddress]\t# load from constant table: float=$con" %}
10839 10789    ins_cost(150); // XXX
10840      -  opcode(0xF3, 0x0F, 0x5E);
10841      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
     10790 +  ins_encode %{
     10791 +    __ divss($dst$$XMMRegister, $constantaddress($con));
     10792 +  %}
10842 10793    ins_pipe(pipe_slow);
10843 10794  %}
10844 10795  
10845 10796  instruct divD_reg(regD dst, regD src)
10846 10797  %{
10847 10798    match(Set dst (DivD dst src));
10848 10799  
10849 10800    format %{ "divsd   $dst, $src" %}
10850 10801    ins_cost(150); // XXX
10851 10802    opcode(0xF2, 0x0F, 0x5E);
↓ open down ↓ 5 lines elided ↑ open up ↑
10857 10808  %{
10858 10809    match(Set dst (DivD dst (LoadD src)));
10859 10810  
10860 10811    format %{ "divsd   $dst, $src" %}
10861 10812    ins_cost(150); // XXX
10862 10813    opcode(0xF2, 0x0F, 0x5E);
10863 10814    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10864 10815    ins_pipe(pipe_slow);
10865 10816  %}
10866 10817  
10867      -instruct divD_imm(regD dst, immD src)
10868      -%{
10869      -  match(Set dst (DivD dst src));
10870      -
10871      -  format %{ "divsd   $dst, [$src]" %}
     10818 +instruct divD_imm(regD dst, immD con) %{
     10819 +  match(Set dst (DivD dst con));
     10820 +  format %{ "divsd   $dst, [$constantaddress]\t# load from constant table: double=$con" %}
10872 10821    ins_cost(150); // XXX
10873      -  opcode(0xF2, 0x0F, 0x5E);
10874      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
     10822 +  ins_encode %{
     10823 +    __ divsd($dst$$XMMRegister, $constantaddress($con));
     10824 +  %}
10875 10825    ins_pipe(pipe_slow);
10876 10826  %}
10877 10827  
10878 10828  instruct sqrtF_reg(regF dst, regF src)
10879 10829  %{
10880 10830    match(Set dst (ConvD2F (SqrtD (ConvF2D src))));
10881 10831  
10882 10832    format %{ "sqrtss  $dst, $src" %}
10883 10833    ins_cost(150); // XXX
10884 10834    opcode(0xF3, 0x0F, 0x51);
↓ open down ↓ 5 lines elided ↑ open up ↑
10890 10840  %{
10891 10841    match(Set dst (ConvD2F (SqrtD (ConvF2D (LoadF src)))));
10892 10842  
10893 10843    format %{ "sqrtss  $dst, $src" %}
10894 10844    ins_cost(150); // XXX
10895 10845    opcode(0xF3, 0x0F, 0x51);
10896 10846    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10897 10847    ins_pipe(pipe_slow);
10898 10848  %}
10899 10849  
10900      -instruct sqrtF_imm(regF dst, immF src)
10901      -%{
10902      -  match(Set dst (ConvD2F (SqrtD (ConvF2D src))));
10903      -
10904      -  format %{ "sqrtss  $dst, [$src]" %}
     10850 +instruct sqrtF_imm(regF dst, immF con) %{
     10851 +  match(Set dst (ConvD2F (SqrtD (ConvF2D con))));
     10852 +  format %{ "sqrtss  $dst, [$constantaddress]\t# load from constant table: float=$con" %}
10905 10853    ins_cost(150); // XXX
10906      -  opcode(0xF3, 0x0F, 0x51);
10907      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
     10854 +  ins_encode %{
     10855 +    __ sqrtss($dst$$XMMRegister, $constantaddress($con));
     10856 +  %}
10908 10857    ins_pipe(pipe_slow);
10909 10858  %}
10910 10859  
10911 10860  instruct sqrtD_reg(regD dst, regD src)
10912 10861  %{
10913 10862    match(Set dst (SqrtD src));
10914 10863  
10915 10864    format %{ "sqrtsd  $dst, $src" %}
10916 10865    ins_cost(150); // XXX
10917 10866    opcode(0xF2, 0x0F, 0x51);
↓ open down ↓ 5 lines elided ↑ open up ↑
10923 10872  %{
10924 10873    match(Set dst (SqrtD (LoadD src)));
10925 10874  
10926 10875    format %{ "sqrtsd  $dst, $src" %}
10927 10876    ins_cost(150); // XXX
10928 10877    opcode(0xF2, 0x0F, 0x51);
10929 10878    ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, reg_mem(dst, src));
10930 10879    ins_pipe(pipe_slow);
10931 10880  %}
10932 10881  
10933      -instruct sqrtD_imm(regD dst, immD src)
10934      -%{
10935      -  match(Set dst (SqrtD src));
10936      -
10937      -  format %{ "sqrtsd  $dst, [$src]" %}
     10882 +instruct sqrtD_imm(regD dst, immD con) %{
     10883 +  match(Set dst (SqrtD con));
     10884 +  format %{ "sqrtsd  $dst, [$constantaddress]\t# load from constant table: double=$con" %}
10938 10885    ins_cost(150); // XXX
10939      -  opcode(0xF2, 0x0F, 0x51);
10940      -  ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
     10886 +  ins_encode %{
     10887 +    __ sqrtsd($dst$$XMMRegister, $constantaddress($con));
     10888 +  %}
10941 10889    ins_pipe(pipe_slow);
10942 10890  %}
10943 10891  
10944 10892  instruct absF_reg(regF dst)
10945 10893  %{
10946 10894    match(Set dst (AbsF dst));
10947 10895  
10948 10896    format %{ "andps   $dst, [0x7fffffff]\t# abs float by sign masking" %}
10949 10897    ins_encode(absF_encoding(dst));
10950 10898    ins_pipe(pipe_slow);
↓ open down ↓ 1871 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX