Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
79770002
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,发现更多精彩内容 >>
提交
79770002
编写于
11月 21, 2016
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-ppc: Use ctpop helper
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
de26a584
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
18 deletion
+9
-18
target/ppc/helper.h
target/ppc/helper.h
+1
-2
target/ppc/int_helper.c
target/ppc/int_helper.c
+3
-15
target/ppc/translate.c
target/ppc/translate.c
+5
-1
未找到文件。
target/ppc/helper.h
浏览文件 @
79770002
...
...
@@ -39,12 +39,11 @@ DEF_HELPER_4(divweu, tl, env, tl, tl, i32)
DEF_HELPER_4
(
divwe
,
tl
,
env
,
tl
,
tl
,
i32
)
DEF_HELPER_FLAGS_1
(
popcntb
,
TCG_CALL_NO_RWG_SE
,
tl
,
tl
)
DEF_HELPER_FLAGS_1
(
popcntw
,
TCG_CALL_NO_RWG_SE
,
tl
,
tl
)
DEF_HELPER_FLAGS_2
(
cmpb
,
TCG_CALL_NO_RWG_SE
,
tl
,
tl
,
tl
)
DEF_HELPER_3
(
sraw
,
tl
,
env
,
tl
,
tl
)
#if defined(TARGET_PPC64)
DEF_HELPER_FLAGS_2
(
cmpeqb
,
TCG_CALL_NO_RWG_SE
,
i32
,
tl
,
tl
)
DEF_HELPER_FLAGS_1
(
popcnt
d
,
TCG_CALL_NO_RWG_SE
,
tl
,
tl
)
DEF_HELPER_FLAGS_1
(
popcnt
w
,
TCG_CALL_NO_RWG_SE
,
tl
,
tl
)
DEF_HELPER_FLAGS_2
(
bpermd
,
TCG_CALL_NO_RWG_SE
,
i64
,
i64
,
i64
)
DEF_HELPER_3
(
srad
,
tl
,
env
,
tl
,
tl
)
DEF_HELPER_0
(
darn32
,
tl
)
...
...
target/ppc/int_helper.c
浏览文件 @
79770002
...
...
@@ -272,6 +272,7 @@ target_ulong helper_srad(CPUPPCState *env, target_ulong value,
#if defined(TARGET_PPC64)
target_ulong
helper_popcntb
(
target_ulong
val
)
{
/* Note that we don't fold past bytes */
val
=
(
val
&
0x5555555555555555ULL
)
+
((
val
>>
1
)
&
0x5555555555555555ULL
);
val
=
(
val
&
0x3333333333333333ULL
)
+
((
val
>>
2
)
&
...
...
@@ -283,6 +284,7 @@ target_ulong helper_popcntb(target_ulong val)
target_ulong
helper_popcntw
(
target_ulong
val
)
{
/* Note that we don't fold past words. */
val
=
(
val
&
0x5555555555555555ULL
)
+
((
val
>>
1
)
&
0x5555555555555555ULL
);
val
=
(
val
&
0x3333333333333333ULL
)
+
((
val
>>
2
)
&
...
...
@@ -295,29 +297,15 @@ target_ulong helper_popcntw(target_ulong val)
0x0000ffff0000ffffULL
);
return
val
;
}
target_ulong
helper_popcntd
(
target_ulong
val
)
{
return
ctpop64
(
val
);
}
#else
target_ulong
helper_popcntb
(
target_ulong
val
)
{
/* Note that we don't fold past bytes */
val
=
(
val
&
0x55555555
)
+
((
val
>>
1
)
&
0x55555555
);
val
=
(
val
&
0x33333333
)
+
((
val
>>
2
)
&
0x33333333
);
val
=
(
val
&
0x0f0f0f0f
)
+
((
val
>>
4
)
&
0x0f0f0f0f
);
return
val
;
}
target_ulong
helper_popcntw
(
target_ulong
val
)
{
val
=
(
val
&
0x55555555
)
+
((
val
>>
1
)
&
0x55555555
);
val
=
(
val
&
0x33333333
)
+
((
val
>>
2
)
&
0x33333333
);
val
=
(
val
&
0x0f0f0f0f
)
+
((
val
>>
4
)
&
0x0f0f0f0f
);
val
=
(
val
&
0x00ff00ff
)
+
((
val
>>
8
)
&
0x00ff00ff
);
val
=
(
val
&
0x0000ffff
)
+
((
val
>>
16
)
&
0x0000ffff
);
return
val
;
}
#endif
/*****************************************************************************/
...
...
target/ppc/translate.c
浏览文件 @
79770002
...
...
@@ -1844,14 +1844,18 @@ static void gen_popcntb(DisasContext *ctx)
static
void
gen_popcntw
(
DisasContext
*
ctx
)
{
#if defined(TARGET_PPC64)
gen_helper_popcntw
(
cpu_gpr
[
rA
(
ctx
->
opcode
)],
cpu_gpr
[
rS
(
ctx
->
opcode
)]);
#else
tcg_gen_ctpop_i32
(
cpu_gpr
[
rA
(
ctx
->
opcode
)],
cpu_gpr
[
rS
(
ctx
->
opcode
)]);
#endif
}
#if defined(TARGET_PPC64)
/* popcntd: PowerPC 2.06 specification */
static
void
gen_popcntd
(
DisasContext
*
ctx
)
{
gen_helper_popcntd
(
cpu_gpr
[
rA
(
ctx
->
opcode
)],
cpu_gpr
[
rS
(
ctx
->
opcode
)]);
tcg_gen_ctpop_i64
(
cpu_gpr
[
rA
(
ctx
->
opcode
)],
cpu_gpr
[
rS
(
ctx
->
opcode
)]);
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录