VirtualBox

Ignore:
Timestamp:
Aug 5, 2012 4:26:25 PM (12 years ago)
Author:
vboxsync
Message:

REM: Initial changes to make it work (seemingly) with MinGW-w64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/tcg/i386/tcg-target.c

    r38064 r42601  
    4444    TCG_REG_R10,
    4545    TCG_REG_R11,
     46# if !defined(VBOX) || !defined(__MINGW64__)
    4647    TCG_REG_R9,
    4748    TCG_REG_R8,
    4849    TCG_REG_RCX,
    4950    TCG_REG_RDX,
     51# endif
    5052    TCG_REG_RSI,
    5153    TCG_REG_RDI,
     54# if defined(VBOX) && defined(__MINGW64__)
     55    TCG_REG_R9,
     56    TCG_REG_R8,
     57    TCG_REG_RDX,
     58    TCG_REG_RCX,
     59# endif
    5260    TCG_REG_RAX,
    5361#else
     
    6472static const int tcg_target_call_iarg_regs[] = {
    6573#if TCG_TARGET_REG_BITS == 64
     74# if defined(VBOX) && defined(__MINGW64__)
     75    TCG_REG_RCX,
     76    TCG_REG_RDX,
     77# else
    6678    TCG_REG_RDI,
    6779    TCG_REG_RSI,
    6880    TCG_REG_RDX,
    6981    TCG_REG_RCX,
     82# endif
    7083    TCG_REG_R8,
    7184    TCG_REG_R9,
     
    197210        if (TCG_TARGET_REG_BITS == 64) {
    198211            tcg_regset_set32(ct->u.regs, 0, 0xffff);
     212#if defined(VBOX) && defined(__MINGW64__)
     213            tcg_regset_reset_reg(ct->u.regs, tcg_target_call_iarg_regs[2]);
     214            tcg_regset_reset_reg(ct->u.regs, tcg_target_call_iarg_regs[1]);
     215            tcg_regset_reset_reg(ct->u.regs, tcg_target_call_iarg_regs[0]);
     216#else
     217            /** @todo figure why RDX isn't mentioned here. */
    199218            tcg_regset_reset_reg(ct->u.regs, TCG_REG_RSI);
    200219            tcg_regset_reset_reg(ct->u.regs, TCG_REG_RDI);
     220#endif
    201221        } else {
    202222            tcg_regset_set32(ct->u.regs, 0, 0xff);
     
    759779}
    760780
    761 #ifdef VBOX
     781#ifdef VBOX_16_BYTE_STACK_ALIGN
    762782static void tcg_out_subi(TCGContext *s, int reg, tcg_target_long val)
    763783{
     
    13901410    *label_ptr[2] = s->code_ptr - label_ptr[2] - 1;
    13911411#else
     1412# if defined(VBOX) && defined(__MINGW64__)
     1413#  error port me
     1414# endif
    13921415    {
    13931416        int32_t offset = GUEST_BASE;
     
    15261549    /* XXX: move that code at the end of the TB */
    15271550    if (TCG_TARGET_REG_BITS == 64) {
     1551#  if defined(VBOX) && defined(__MINGW64__)
     1552        tcg_out_mov(s, (opc == 3 ? TCG_TYPE_I64 : TCG_TYPE_I32),
     1553                    tcg_target_call_iarg_regs[1], data_reg);
     1554        tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[2], mem_index);
     1555#  else
    15281556        tcg_out_mov(s, (opc == 3 ? TCG_TYPE_I64 : TCG_TYPE_I32),
    15291557                    TCG_REG_RSI, data_reg);
    15301558        tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_RDX, mem_index);
     1559#  endif
    15311560        stack_adjust = 0;
    15321561    } else if (TARGET_LONG_BITS == 32) {
     
    15971626    *label_ptr[2] = s->code_ptr - label_ptr[2] - 1;
    15981627#else
     1628# if defined(VBOX) && defined(__MINGW64__)
     1629#  error port me
     1630# endif
    15991631    {
    16001632        int32_t offset = GUEST_BASE;
     
    20922124    TCG_REG_RBP,
    20932125    TCG_REG_RBX,
     2126# if defined(VBOX) && defined(__MINGW64__)
     2127    TCG_REG_RSI,
     2128    TCG_REG_RDI,
     2129# endif
    20942130    TCG_REG_R12,
    20952131    TCG_REG_R13,
     
    21322168
    21332169    frame_size = push_size + TCG_STATIC_CALL_ARGS_SIZE;
     2170#if defined(VBOX) && defined(__MINGW64__)
     2171    frame_size += TCG_TARGET_CALL_STACK_OFFSET;
     2172#endif
    21342173    frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1) &
    21352174        ~(TCG_TARGET_STACK_ALIGN - 1);
     
    21762215    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_ECX);
    21772216    if (TCG_TARGET_REG_BITS == 64) {
     2217# if !defined(VBOX) || !defined(__MINGW64__)
    21782218        tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_RDI);
    21792219        tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_RSI);
     2220# endif
    21802221        tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R8);
    21812222        tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R9);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette