private void emitPrimCast(Wrapper from,Wrapper to){
  if (from == to) {
    return;
  }
  if (from.isSubwordOrInt()) {
    emitI2X(to);
  }
 else {
    if (to.isSubwordOrInt()) {
      emitX2I(from);
      if (to.bitWidth() < 32) {
        emitI2X(to);
      }
    }
 else {
      boolean error=false;
switch (from) {
case LONG:
switch (to) {
case FLOAT:
          mv.visitInsn(Opcodes.L2F);
        break;
case DOUBLE:
      mv.visitInsn(Opcodes.L2D);
    break;
default :
  error=true;
break;
}
break;
case FLOAT:
switch (to) {
case LONG:
mv.visitInsn(Opcodes.F2L);
break;
case DOUBLE:
mv.visitInsn(Opcodes.F2D);
break;
default :
error=true;
break;
}
break;
case DOUBLE:
switch (to) {
case LONG:
mv.visitInsn(Opcodes.D2L);
break;
case FLOAT:
mv.visitInsn(Opcodes.D2F);
break;
default :
error=true;
break;
}
break;
default :
error=true;
break;
}
if (error) {
throw new IllegalStateException("unhandled prim cast: " + from + "2"+ to);
}
}
}
}

private void emitPrimCast ( Wrapper from , Wrapper to ) { if ( from == to ) { return ; } if ( from . isSubwordOrInt ( ) ) { emitI2X ( to ) ; } else { if ( to . isSubwordOrInt ( ) ) { emitX2I ( from ) ; if ( to . bitWidth ( ) < 32 ) { emitI2X ( to ) ; } } else { boolean error = false ; switch ( from ) { case LONG : switch ( to ) { case FLOAT : mv . visitInsn ( Opcodes . L2F ) ; break ; case DOUBLE : mv . visitInsn ( Opcodes . L2D ) ; break ; default : error = true ; break ; } break ; case FLOAT : switch ( to ) { case LONG : mv . visitInsn ( Opcodes . F2L ) ; break ; case DOUBLE : mv . visitInsn ( Opcodes . F2D ) ; break ; default : error = true ; break ; } break ; case DOUBLE : switch ( to ) { case LONG : mv . visitInsn ( Opcodes . D2L ) ; break ; case FLOAT : mv . visitInsn ( Opcodes . D2F ) ; break ; default : error = true ; break ; } break ; default : error = true ; break ; } if ( error ) { throw new IllegalStateException ( "unhandled prim cast: " + from + "2" + to ) ; } } } }
emit a type conversion bytecode casting from " from " to " to " .
