src/cpu/x86/vm/x86_32.ad

changeset 2085
f55c4f82ab9d
parent 1934
e9ff18c4ace7
child 2103
3e8fbc61cee8
     1.1 --- a/src/cpu/x86/vm/x86_32.ad	Wed Aug 18 01:22:16 2010 -0700
     1.2 +++ b/src/cpu/x86/vm/x86_32.ad	Thu Aug 19 14:51:47 2010 -0700
     1.3 @@ -852,6 +852,39 @@
     1.4    }
     1.5  }
     1.6  
     1.7 +static int impl_movgpr2x_helper( CodeBuffer *cbuf, bool do_size, int src_lo, int dst_lo,
     1.8 +                            int src_hi, int dst_hi, int size, outputStream* st ) {
     1.9 +  // 32-bit
    1.10 +  if (cbuf) {
    1.11 +    emit_opcode(*cbuf, 0x66);
    1.12 +    emit_opcode(*cbuf, 0x0F);
    1.13 +    emit_opcode(*cbuf, 0x6E);
    1.14 +    emit_rm(*cbuf, 0x3, Matcher::_regEncode[dst_lo] & 7, Matcher::_regEncode[src_lo] & 7);
    1.15 +#ifndef PRODUCT
    1.16 +  } else if (!do_size) {
    1.17 +    st->print("movdl   %s, %s\t# spill", Matcher::regName[dst_lo], Matcher::regName[src_lo]);
    1.18 +#endif
    1.19 +  }
    1.20 +  return 4;
    1.21 +}
    1.22 +
    1.23 +
    1.24 +static int impl_movx2gpr_helper( CodeBuffer *cbuf, bool do_size, int src_lo, int dst_lo,
    1.25 +                                 int src_hi, int dst_hi, int size, outputStream* st ) {
    1.26 +  // 32-bit
    1.27 +  if (cbuf) {
    1.28 +    emit_opcode(*cbuf, 0x66);
    1.29 +    emit_opcode(*cbuf, 0x0F);
    1.30 +    emit_opcode(*cbuf, 0x7E);
    1.31 +    emit_rm(*cbuf, 0x3, Matcher::_regEncode[src_lo] & 7, Matcher::_regEncode[dst_lo] & 7);
    1.32 +#ifndef PRODUCT
    1.33 +  } else if (!do_size) {
    1.34 +    st->print("movdl   %s, %s\t# spill", Matcher::regName[dst_lo], Matcher::regName[src_lo]);
    1.35 +#endif
    1.36 +  }
    1.37 +  return 4;
    1.38 +}
    1.39 +
    1.40  static int impl_mov_helper( CodeBuffer *cbuf, bool do_size, int src, int dst, int size, outputStream* st ) {
    1.41    if( cbuf ) {
    1.42      emit_opcode(*cbuf, 0x8B );
    1.43 @@ -947,6 +980,12 @@
    1.44    if( dst_first_rc == rc_int && src_first_rc == rc_stack )
    1.45      size = impl_helper(cbuf,do_size,true ,ra_->reg2offset(src_first),dst_first,0x8B,"MOV ",size, st);
    1.46  
    1.47 +  // Check for integer reg-xmm reg copy
    1.48 +  if( src_first_rc == rc_int && dst_first_rc == rc_xmm ) {
    1.49 +    assert( (src_second_rc == rc_bad && dst_second_rc == rc_bad),
    1.50 +            "no 64 bit integer-float reg moves" );
    1.51 +    return impl_movgpr2x_helper(cbuf,do_size,src_first,dst_first,src_second, dst_second, size, st);
    1.52 +  }
    1.53    // --------------------------------------
    1.54    // Check for float reg-reg copy
    1.55    if( src_first_rc == rc_float && dst_first_rc == rc_float ) {
    1.56 @@ -1018,6 +1057,13 @@
    1.57      return impl_movx_helper(cbuf,do_size,src_first,dst_first,src_second, dst_second, size, st);
    1.58    }
    1.59  
    1.60 +  // Check for xmm reg-integer reg copy
    1.61 +  if( src_first_rc == rc_xmm && dst_first_rc == rc_int ) {
    1.62 +    assert( (src_second_rc == rc_bad && dst_second_rc == rc_bad),
    1.63 +            "no 64 bit float-integer reg moves" );
    1.64 +    return impl_movx2gpr_helper(cbuf,do_size,src_first,dst_first,src_second, dst_second, size, st);
    1.65 +  }
    1.66 +
    1.67    // Check for xmm store
    1.68    if( src_first_rc == rc_xmm && dst_first_rc == rc_stack ) {
    1.69      return impl_x_helper(cbuf,do_size,false,ra_->reg2offset(dst_first),src_first, src_second, size, st);

mercurial