VirtualBox

Changeset 15373 in vbox for trunk/src


Ignore:
Timestamp:
Dec 12, 2008 3:05:46 PM (16 years ago)
Author:
vboxsync
Message:

rem: fixed Mac builds and alignment problems

File:
1 edited

Legend:

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

    r15173 r15373  
    389389}
    390390
     391#ifdef VBOX
     392void tcg_out_subi(TCGContext *s, int reg, tcg_target_long val)
     393{
     394    if (val != 0)
     395        tgen_arithi(s, ARITH_SUB, reg, val);
     396}
     397#endif
     398
    391399static void tcg_out_jxx(TCGContext *s, int opc, int label_index)
    392400{
     
    868876    int addr_reg2;
    869877#endif
     878#ifdef VBOX
     879# ifdef RT_OS_DARWIN
     880    int bias1 = 12, bias2 = 8, bias3 = 4;
     881# else
     882    int bias1 = bias2 = bias3 = 0;
     883# endif
     884#endif
    870885
    871886    data_reg = *args++;
     
    944959        tcg_out_mov(s, TCG_REG_EDX, data_reg);
    945960        tcg_out_mov(s, TCG_REG_ECX, data_reg2);
     961#ifdef VBOX
     962        tcg_out_subi(s, TCG_REG_ESP, bias1);
     963#endif
    946964        tcg_out8(s, 0x6a); /* push Ib */
    947965        tcg_out8(s, mem_index);
     
    952970        tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] -
    953971                  (tcg_target_long)s->code_ptr - 4);
     972#ifdef VBOX
     973        tcg_out_addi(s, TCG_REG_ESP, 4+bias1);
     974#else
    954975        tcg_out_addi(s, TCG_REG_ESP, 4);
     976#endif
    955977    } else {
    956978        switch(opc) {
     
    9781000    if (opc == 3) {
    9791001        tcg_out_mov(s, TCG_REG_EDX, addr_reg2);
     1002# ifdef VBOX
     1003        tcg_out_subi(s, TCG_REG_ESP, bias3);
     1004# endif
    9801005        tcg_out8(s, 0x6a); /* push Ib */
    9811006        tcg_out8(s, mem_index);
     
    9881013        tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] -
    9891014                  (tcg_target_long)s->code_ptr - 4);
     1015#ifdef VBOX
     1016        tcg_out_addi(s, TCG_REG_ESP, 12+bias3);
     1017#else
    9901018        tcg_out_addi(s, TCG_REG_ESP, 12);
     1019#endif
    9911020    } else {
    9921021        tcg_out_mov(s, TCG_REG_EDX, addr_reg2);
     
    10041033            break;
    10051034        }
    1006 # if defined(VBOX) && defined(RT_OS_DARWIN)
    1007         tgen_arithi(s, ARITH_SUB, TCG_REG_ESP, 12); /** @todo FIXME: This is not 100% correct (assumes a bunch of things), but it works around the current issue it seems... */
     1035# ifdef VBOX
     1036        tcg_out_subi(s, TCG_REG_ESP, bias1);
    10081037# endif
    10091038        tcg_out8(s, 0x6a); /* push Ib */
     
    10161045        tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] -
    10171046                  (tcg_target_long)s->code_ptr - 4);
    1018 # if defined(VBOX) && defined(RT_OS_DARWIN)
    1019         tcg_out_addi(s, TCG_REG_ESP, 12+4);
     1047# if defined(VBOX)
     1048        tcg_out_addi(s, TCG_REG_ESP, 4 + bias1);
    10201049# else
    10211050        tcg_out_addi(s, TCG_REG_ESP, 4);
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