Revision 82bb07db
b/tcg/i386/tcg-target.c | ||
---|---|---|
842 | 842 |
int data_reg, data_reg2 = 0; |
843 | 843 |
int addrlo_idx; |
844 | 844 |
#if defined(CONFIG_SOFTMMU) |
845 |
int mem_index, s_bits; |
|
845 |
int mem_index, s_bits, arg_idx;
|
|
846 | 846 |
uint8_t *label_ptr[3]; |
847 | 847 |
#endif |
848 | 848 |
|
... | ... | |
877 | 877 |
} |
878 | 878 |
|
879 | 879 |
/* XXX: move that code at the end of the TB */ |
880 |
#if TARGET_LONG_BITS == 32 |
|
881 |
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_EDX, mem_index); |
|
882 |
#else |
|
883 |
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]); |
|
884 |
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index); |
|
885 |
#endif |
|
880 |
/* EAX is already loaded. */ |
|
881 |
arg_idx = 1; |
|
882 |
if (TARGET_LONG_BITS == 64) { |
|
883 |
tcg_out_mov(s, tcg_target_call_iarg_regs[arg_idx++], |
|
884 |
args[addrlo_idx + 1]); |
|
885 |
} |
|
886 |
tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[arg_idx], |
|
887 |
mem_index); |
|
886 | 888 |
tcg_out_calli(s, (tcg_target_long)qemu_ld_helpers[s_bits]); |
887 | 889 |
|
888 | 890 |
switch(opc) { |
... | ... | |
1018 | 1020 |
} |
1019 | 1021 |
|
1020 | 1022 |
/* XXX: move that code at the end of the TB */ |
1021 |
#if TARGET_LONG_BITS == 32 |
|
1022 |
if (opc == 3) { |
|
1023 |
if (TARGET_LONG_BITS == 32) { |
|
1023 | 1024 |
tcg_out_mov(s, TCG_REG_EDX, data_reg); |
1024 |
tcg_out_mov(s, TCG_REG_ECX, data_reg2); |
|
1025 |
tcg_out_pushi(s, mem_index); |
|
1026 |
stack_adjust = 4; |
|
1027 |
} else { |
|
1028 |
switch(opc) { |
|
1029 |
case 0: |
|
1030 |
tcg_out_ext8u(s, TCG_REG_EDX, data_reg); |
|
1031 |
break; |
|
1032 |
case 1: |
|
1033 |
tcg_out_ext16u(s, TCG_REG_EDX, data_reg); |
|
1034 |
break; |
|
1035 |
case 2: |
|
1036 |
tcg_out_mov(s, TCG_REG_EDX, data_reg); |
|
1037 |
break; |
|
1025 |
if (opc == 3) { |
|
1026 |
tcg_out_mov(s, TCG_REG_ECX, data_reg2); |
|
1027 |
tcg_out_pushi(s, mem_index); |
|
1028 |
stack_adjust = 4; |
|
1029 |
} else { |
|
1030 |
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index); |
|
1031 |
stack_adjust = 0; |
|
1038 | 1032 |
} |
1039 |
tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_ECX, mem_index); |
|
1040 |
stack_adjust = 0; |
|
1041 |
} |
|
1042 |
#else |
|
1043 |
if (opc == 3) { |
|
1044 |
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]); |
|
1045 |
tcg_out_pushi(s, mem_index); |
|
1046 |
tcg_out_push(s, data_reg2); |
|
1047 |
tcg_out_push(s, data_reg); |
|
1048 |
stack_adjust = 12; |
|
1049 | 1033 |
} else { |
1050 |
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]); |
|
1051 |
switch(opc) { |
|
1052 |
case 0: |
|
1053 |
tcg_out_ext8u(s, TCG_REG_ECX, data_reg); |
|
1054 |
break; |
|
1055 |
case 1: |
|
1056 |
tcg_out_ext16u(s, TCG_REG_ECX, data_reg); |
|
1057 |
break; |
|
1058 |
case 2: |
|
1059 |
tcg_out_mov(s, TCG_REG_ECX, data_reg); |
|
1060 |
break; |
|
1034 |
if (opc == 3) { |
|
1035 |
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]); |
|
1036 |
tcg_out_pushi(s, mem_index); |
|
1037 |
tcg_out_push(s, data_reg2); |
|
1038 |
tcg_out_push(s, data_reg); |
|
1039 |
stack_adjust = 12; |
|
1040 |
} else { |
|
1041 |
tcg_out_mov(s, TCG_REG_EDX, args[addrlo_idx + 1]); |
|
1042 |
switch(opc) { |
|
1043 |
case 0: |
|
1044 |
tcg_out_ext8u(s, TCG_REG_ECX, data_reg); |
|
1045 |
break; |
|
1046 |
case 1: |
|
1047 |
tcg_out_ext16u(s, TCG_REG_ECX, data_reg); |
|
1048 |
break; |
|
1049 |
case 2: |
|
1050 |
tcg_out_mov(s, TCG_REG_ECX, data_reg); |
|
1051 |
break; |
|
1052 |
} |
|
1053 |
tcg_out_pushi(s, mem_index); |
|
1054 |
stack_adjust = 4; |
|
1061 | 1055 |
} |
1062 |
tcg_out_pushi(s, mem_index); |
|
1063 |
stack_adjust = 4; |
|
1064 | 1056 |
} |
1065 |
#endif |
|
1066 | 1057 |
|
1067 | 1058 |
tcg_out_calli(s, (tcg_target_long)qemu_st_helpers[s_bits]); |
1068 | 1059 |
|
Also available in: Unified diff