Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
abb6ae2c
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
abb6ae2c
编写于
9月 03, 2009
作者:
M
malc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
X86_64: Use proper jumps/calls when displacement exceeds +-2G
Signed-off-by:
N
malc
<
av1474@comtv.ru
>
上级
3c854e47
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
12 deletion
+19
-12
tcg/x86_64/tcg-target.c
tcg/x86_64/tcg-target.c
+19
-12
未找到文件。
tcg/x86_64/tcg-target.c
浏览文件 @
abb6ae2c
...
...
@@ -363,6 +363,20 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type,
}
}
static
void
tcg_out_goto
(
TCGContext
*
s
,
int
call
,
uint8_t
*
target
)
{
int32_t
disp
;
disp
=
target
-
s
->
code_ptr
-
5
;
if
(
disp
==
(
target
-
s
->
code_ptr
-
5
))
{
tcg_out8
(
s
,
call
?
0xe8
:
0xe9
);
tcg_out32
(
s
,
disp
);
}
else
{
tcg_out_movi
(
s
,
TCG_TYPE_PTR
,
TCG_REG_R10
,
(
tcg_target_long
)
target
);
tcg_out_modrm
(
s
,
0xff
,
call
?
2
:
4
,
TCG_REG_R10
);
}
}
static
inline
void
tcg_out_ld
(
TCGContext
*
s
,
TCGType
type
,
int
ret
,
int
arg1
,
tcg_target_long
arg2
)
{
...
...
@@ -559,9 +573,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
/* XXX: move that code at the end of the TB */
tcg_out_movi
(
s
,
TCG_TYPE_I32
,
TCG_REG_RSI
,
mem_index
);
tcg_out8
(
s
,
0xe8
);
tcg_out32
(
s
,
(
tcg_target_long
)
qemu_ld_helpers
[
s_bits
]
-
(
tcg_target_long
)
s
->
code_ptr
-
4
);
tcg_out_goto
(
s
,
1
,
qemu_ld_helpers
[
s_bits
]);
switch
(
opc
)
{
case
0
|
4
:
...
...
@@ -774,9 +786,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
break
;
}
tcg_out_movi
(
s
,
TCG_TYPE_I32
,
TCG_REG_RDX
,
mem_index
);
tcg_out8
(
s
,
0xe8
);
tcg_out32
(
s
,
(
tcg_target_long
)
qemu_st_helpers
[
s_bits
]
-
(
tcg_target_long
)
s
->
code_ptr
-
4
);
tcg_out_goto
(
s
,
1
,
qemu_st_helpers
[
s_bits
]);
/* jmp label2 */
tcg_out8
(
s
,
0xeb
);
...
...
@@ -865,8 +875,7 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
switch
(
opc
)
{
case
INDEX_op_exit_tb
:
tcg_out_movi
(
s
,
TCG_TYPE_PTR
,
TCG_REG_RAX
,
args
[
0
]);
tcg_out8
(
s
,
0xe9
);
/* jmp tb_ret_addr */
tcg_out32
(
s
,
tb_ret_addr
-
s
->
code_ptr
-
4
);
tcg_out_goto
(
s
,
0
,
tb_ret_addr
);
break
;
case
INDEX_op_goto_tb
:
if
(
s
->
tb_jmp_offset
)
{
...
...
@@ -885,16 +894,14 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
break
;
case
INDEX_op_call
:
if
(
const_args
[
0
])
{
tcg_out8
(
s
,
0xe8
);
tcg_out32
(
s
,
args
[
0
]
-
(
tcg_target_long
)
s
->
code_ptr
-
4
);
tcg_out_goto
(
s
,
1
,
(
void
*
)
args
[
0
]);
}
else
{
tcg_out_modrm
(
s
,
0xff
,
2
,
args
[
0
]);
}
break
;
case
INDEX_op_jmp
:
if
(
const_args
[
0
])
{
tcg_out8
(
s
,
0xe9
);
tcg_out32
(
s
,
args
[
0
]
-
(
tcg_target_long
)
s
->
code_ptr
-
4
);
tcg_out_goto
(
s
,
0
,
(
void
*
)
args
[
0
]);
}
else
{
tcg_out_modrm
(
s
,
0xff
,
4
,
args
[
0
]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录