Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
5cabc5cc
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看板
提交
5cabc5cc
编写于
1月 10, 2011
作者:
E
Edgar E. Iglesias
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cris: Allow more TB chaining for crisv10
Signed-off-by:
N
Edgar E. Iglesias
<
edgar@axis.com
>
上级
b09cd072
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
14 deletion
+33
-14
target-cris/translate.c
target-cris/translate.c
+27
-10
target-cris/translate_v10.c
target-cris/translate_v10.c
+6
-4
未找到文件。
target-cris/translate.c
浏览文件 @
5cabc5cc
...
...
@@ -120,9 +120,10 @@ typedef struct DisasContext {
unsigned
int
tb_flags
;
/* tb dependent flags. */
int
is_jmp
;
#define JMP_NOJMP 0
#define JMP_DIRECT 1
#define JMP_INDIRECT 2
#define JMP_NOJMP 0
#define JMP_DIRECT 1
#define JMP_DIRECT_CC 2
#define JMP_INDIRECT 3
int
jmp
;
/* 0=nojmp, 1=direct, 2=indirect. */
uint32_t
jmp_pc
;
...
...
@@ -1127,7 +1128,7 @@ static void gen_tst_cc (DisasContext *dc, TCGv cc, int cond)
static
void
cris_store_direct_jmp
(
DisasContext
*
dc
)
{
/* Store the direct jmp state into the cpu-state. */
if
(
dc
->
jmp
==
JMP_DIRECT
)
{
if
(
dc
->
jmp
==
JMP_DIRECT
||
dc
->
jmp
==
JMP_DIRECT_CC
)
{
tcg_gen_movi_tl
(
env_btarget
,
dc
->
jmp_pc
);
dc
->
jmp
=
JMP_INDIRECT
;
}
...
...
@@ -1139,7 +1140,7 @@ static void cris_prepare_cc_branch (DisasContext *dc,
/* This helps us re-schedule the micro-code to insns in delay-slots
before the actual jump. */
dc
->
delayed_branch
=
2
;
dc
->
jmp
=
JMP_DIRECT
;
dc
->
jmp
=
JMP_DIRECT
_CC
;
dc
->
jmp_pc
=
dc
->
pc
+
offset
;
gen_tst_cc
(
dc
,
env_btaken
,
cond
);
...
...
@@ -1155,7 +1156,9 @@ static inline void cris_prepare_jmp (DisasContext *dc, unsigned int type)
before the actual jump. */
dc
->
delayed_branch
=
2
;
dc
->
jmp
=
type
;
tcg_gen_movi_tl
(
env_btaken
,
1
);
if
(
type
==
JMP_INDIRECT
)
{
tcg_gen_movi_tl
(
env_btaken
,
1
);
}
}
static
void
gen_load64
(
DisasContext
*
dc
,
TCGv_i64
dst
,
TCGv
addr
)
...
...
@@ -3193,10 +3196,13 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
qemu_log_try_set_file
(
stderr
);
if
(
env
->
pregs
[
PR_VR
]
==
32
)
if
(
env
->
pregs
[
PR_VR
]
==
32
)
{
dc
->
decoder
=
crisv32_decoder
;
else
dc
->
clear_locked_irq
=
0
;
}
else
{
dc
->
decoder
=
crisv10_decoder
;
dc
->
clear_locked_irq
=
1
;
}
/* Odd PC indicates that branch is rexecuting due to exception in the
* delayslot, like in real hw.
...
...
@@ -3218,7 +3224,6 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
dc
->
cc_mask
=
0
;
dc
->
update_cc
=
0
;
dc
->
clear_prefix
=
0
;
dc
->
clear_locked_irq
=
1
;
cris_update_cc_op
(
dc
,
CC_OP_FLAGS
,
4
);
dc
->
cc_size_uptodate
=
-
1
;
...
...
@@ -3312,7 +3317,14 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
||
(
dc
->
flags_x
!=
(
tb
->
flags
&
X_FLAG
)))
{
cris_store_direct_jmp
(
dc
);
}
if
(
dc
->
jmp
==
JMP_DIRECT
)
{
if
(
dc
->
clear_locked_irq
)
{
dc
->
clear_locked_irq
=
0
;
t_gen_mov_env_TN
(
locked_irq
,
tcg_const_tl
(
0
));
}
if
(
dc
->
jmp
==
JMP_DIRECT_CC
)
{
int
l1
;
l1
=
gen_new_label
();
...
...
@@ -3326,6 +3338,11 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
gen_goto_tb
(
dc
,
0
,
dc
->
pc
);
dc
->
is_jmp
=
DISAS_TB_JUMP
;
dc
->
jmp
=
JMP_NOJMP
;
}
else
if
(
dc
->
jmp
==
JMP_DIRECT
)
{
cris_evaluate_flags
(
dc
);
gen_goto_tb
(
dc
,
0
,
dc
->
jmp_pc
);
dc
->
is_jmp
=
DISAS_TB_JUMP
;
dc
->
jmp
=
JMP_NOJMP
;
}
else
{
t_gen_cc_jmp
(
env_btarget
,
tcg_const_tl
(
dc
->
pc
));
...
...
target-cris/translate_v10.c
浏览文件 @
5cabc5cc
...
...
@@ -1060,15 +1060,15 @@ static unsigned int dec10_ind(DisasContext *dc)
break
;
case
CRISV10_IND_JUMP_M
:
if
(
dc
->
src
==
15
)
{
LOG_DIS
(
"jump.%d %d r%d r%d
\n
"
,
size
,
LOG_DIS
(
"jump.%d %d r%d r%d
direct
\n
"
,
size
,
dc
->
opcode
,
dc
->
src
,
dc
->
dst
);
imm
=
ldl_code
(
dc
->
pc
+
2
);
if
(
dc
->
mode
==
CRISV10_MODE_AUTOINC
)
insn_len
+=
size
;
t_gen_mov_preg_TN
(
dc
,
dc
->
dst
,
tcg_const_tl
(
dc
->
pc
+
insn_len
));
tcg_gen_movi_tl
(
env_btarget
,
imm
)
;
cris_prepare_jmp
(
dc
,
JMP_
IN
DIRECT
);
dc
->
jmp_pc
=
imm
;
cris_prepare_jmp
(
dc
,
JMP_DIRECT
);
dc
->
delayed_branch
--
;
/* v10 has no dslot here. */
}
else
{
if
(
dc
->
dst
==
14
)
{
...
...
@@ -1184,7 +1184,9 @@ static unsigned int crisv10_decoder(DisasContext *dc)
if
(
dc
->
clear_prefix
&&
dc
->
tb_flags
&
PFIX_FLAG
)
{
dc
->
tb_flags
&=
~
PFIX_FLAG
;
tcg_gen_andi_tl
(
cpu_PR
[
PR_CCS
],
cpu_PR
[
PR_CCS
],
~
PFIX_FLAG
);
dc
->
cpustate_changed
=
1
;
if
(
dc
->
tb_flags
!=
dc
->
tb
->
flags
)
{
dc
->
cpustate_changed
=
1
;
}
}
/* CRISv10 locks out interrupts on dslots. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录