Skip to content

Commit

Permalink
[Backport] 8277777: [Vector API] assert(r->is_XMMRegister()) failed: …
Browse files Browse the repository at this point in the history
…must be in x86_32.ad

Summary: 8277777: [Vector API] assert(r->is_XMMRegister()) failed: must be in x86_32.ad

Test Plan: ci jtreg

Reviewed-by: JoshuaZhuwj

Issue: #569
  • Loading branch information
JinZhonghui authored and JoshuaZhuwj committed Dec 22, 2023
1 parent ef05aaf commit c77d852
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/hotspot/cpu/x86/x86_32.ad
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ static enum RC rc_class( OptoReg::Name reg ) {
assert(UseSSE < 2, "shouldn't be used in SSE2+ mode");
return rc_float;
}
if (r->is_KRegister()) return rc_kreg;
assert(r->is_XMMRegister(), "must be");
return rc_xmm;
}
Expand Down Expand Up @@ -1285,26 +1286,6 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo
return size;
}

assert( size > 0, "missed a case" );

// --------------------------------------------------------------------
// Check for second bits still needing moving.
if( src_second == dst_second )
return size; // Self copy; no move
assert( src_second_rc != rc_bad && dst_second_rc != rc_bad, "src_second & dst_second cannot be Bad" );

// Check for second word int-int move
if( src_second_rc == rc_int && dst_second_rc == rc_int )
return impl_mov_helper(cbuf,do_size,src_second,dst_second,size, st);

// Check for second word integer store
if( src_second_rc == rc_int && dst_second_rc == rc_stack )
return impl_helper(cbuf,do_size,false,ra_->reg2offset(dst_second),src_second,0x89,"MOV ",size, st);

// Check for second word integer load
if( dst_second_rc == rc_int && src_second_rc == rc_stack )
return impl_helper(cbuf,do_size,true ,ra_->reg2offset(src_second),dst_second,0x8B,"MOV ",size, st);

// AVX-512 opmask specific spilling.
if (src_first_rc == rc_stack && dst_first_rc == rc_kreg) {
assert((src_first & 1) == 0 && src_first + 1 == src_second, "invalid register pair");
Expand Down Expand Up @@ -1342,6 +1323,26 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo
return 0;
}

assert( size > 0, "missed a case" );

// --------------------------------------------------------------------
// Check for second bits still needing moving.
if( src_second == dst_second )
return size; // Self copy; no move
assert( src_second_rc != rc_bad && dst_second_rc != rc_bad, "src_second & dst_second cannot be Bad" );

// Check for second word int-int move
if( src_second_rc == rc_int && dst_second_rc == rc_int )
return impl_mov_helper(cbuf,do_size,src_second,dst_second,size, st);

// Check for second word integer store
if( src_second_rc == rc_int && dst_second_rc == rc_stack )
return impl_helper(cbuf,do_size,false,ra_->reg2offset(dst_second),src_second,0x89,"MOV ",size, st);

// Check for second word integer load
if( dst_second_rc == rc_int && src_second_rc == rc_stack )
return impl_helper(cbuf,do_size,true ,ra_->reg2offset(src_second),dst_second,0x8B,"MOV ",size, st);

Unimplemented();
return 0; // Mute compiler
}
Expand Down

0 comments on commit c77d852

Please sign in to comment.