- Timestamp:
- Dec 12, 2008 3:05:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/tcg/i386/tcg-target.c
r15173 r15373 389 389 } 390 390 391 #ifdef VBOX 392 void 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 391 399 static void tcg_out_jxx(TCGContext *s, int opc, int label_index) 392 400 { … … 868 876 int addr_reg2; 869 877 #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 870 885 871 886 data_reg = *args++; … … 944 959 tcg_out_mov(s, TCG_REG_EDX, data_reg); 945 960 tcg_out_mov(s, TCG_REG_ECX, data_reg2); 961 #ifdef VBOX 962 tcg_out_subi(s, TCG_REG_ESP, bias1); 963 #endif 946 964 tcg_out8(s, 0x6a); /* push Ib */ 947 965 tcg_out8(s, mem_index); … … 952 970 tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] - 953 971 (tcg_target_long)s->code_ptr - 4); 972 #ifdef VBOX 973 tcg_out_addi(s, TCG_REG_ESP, 4+bias1); 974 #else 954 975 tcg_out_addi(s, TCG_REG_ESP, 4); 976 #endif 955 977 } else { 956 978 switch(opc) { … … 978 1000 if (opc == 3) { 979 1001 tcg_out_mov(s, TCG_REG_EDX, addr_reg2); 1002 # ifdef VBOX 1003 tcg_out_subi(s, TCG_REG_ESP, bias3); 1004 # endif 980 1005 tcg_out8(s, 0x6a); /* push Ib */ 981 1006 tcg_out8(s, mem_index); … … 988 1013 tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] - 989 1014 (tcg_target_long)s->code_ptr - 4); 1015 #ifdef VBOX 1016 tcg_out_addi(s, TCG_REG_ESP, 12+bias3); 1017 #else 990 1018 tcg_out_addi(s, TCG_REG_ESP, 12); 1019 #endif 991 1020 } else { 992 1021 tcg_out_mov(s, TCG_REG_EDX, addr_reg2); … … 1004 1033 break; 1005 1034 } 1006 # if defined(VBOX) && defined(RT_OS_DARWIN)1007 t gen_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); 1008 1037 # endif 1009 1038 tcg_out8(s, 0x6a); /* push Ib */ … … 1016 1045 tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] - 1017 1046 (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); 1020 1049 # else 1021 1050 tcg_out_addi(s, TCG_REG_ESP, 4);
Note:
See TracChangeset
for help on using the changeset viewer.