Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
993508e4
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看板
提交
993508e4
编写于
11月 22, 2016
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tcg/i386: Handle ctpop opcode
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
33e75fb9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
3 deletion
+14
-3
tcg/i386/tcg-target.h
tcg/i386/tcg-target.h
+3
-2
tcg/i386/tcg-target.inc.c
tcg/i386/tcg-target.inc.c
+11
-1
未找到文件。
tcg/i386/tcg-target.h
浏览文件 @
993508e4
...
...
@@ -76,6 +76,7 @@ typedef enum {
#endif
extern
bool
have_bmi1
;
extern
bool
have_popcnt
;
/* optional instructions */
#define TCG_TARGET_HAS_div2_i32 1
...
...
@@ -95,7 +96,7 @@ extern bool have_bmi1;
#define TCG_TARGET_HAS_nor_i32 0
#define TCG_TARGET_HAS_clz_i32 1
#define TCG_TARGET_HAS_ctz_i32 1
#define TCG_TARGET_HAS_ctpop_i32
0
#define TCG_TARGET_HAS_ctpop_i32
have_popcnt
#define TCG_TARGET_HAS_deposit_i32 1
#define TCG_TARGET_HAS_extract_i32 1
#define TCG_TARGET_HAS_sextract_i32 1
...
...
@@ -130,7 +131,7 @@ extern bool have_bmi1;
#define TCG_TARGET_HAS_nor_i64 0
#define TCG_TARGET_HAS_clz_i64 1
#define TCG_TARGET_HAS_ctz_i64 1
#define TCG_TARGET_HAS_ctpop_i64
0
#define TCG_TARGET_HAS_ctpop_i64
have_popcnt
#define TCG_TARGET_HAS_deposit_i64 1
#define TCG_TARGET_HAS_extract_i64 1
#define TCG_TARGET_HAS_sextract_i64 0
...
...
tcg/i386/tcg-target.inc.c
浏览文件 @
993508e4
...
...
@@ -130,9 +130,10 @@ static bool have_movbe;
# define have_movbe 0
#endif
/* We need th
is symbol
in tcg-target.h, and we can't properly conditionalize
/* We need th
ese symbols
in tcg-target.h, and we can't properly conditionalize
it there. Therefore we always define the variable. */
bool
have_bmi1
;
bool
have_popcnt
;
#if defined(CONFIG_CPUID_H) && defined(bit_BMI2)
static
bool
have_bmi2
;
...
...
@@ -337,6 +338,7 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type,
#define OPC_MOVZBL (0xb6 | P_EXT)
#define OPC_MOVZWL (0xb7 | P_EXT)
#define OPC_POP_r32 (0x58)
#define OPC_POPCNT (0xb8 | P_EXT | P_SIMDF3)
#define OPC_PUSH_r32 (0x50)
#define OPC_PUSH_Iv (0x68)
#define OPC_PUSH_Ib (0x6a)
...
...
@@ -2083,6 +2085,9 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
OP_32_64
(
clz
)
:
tcg_out_clz
(
s
,
rexw
,
args
[
0
],
args
[
1
],
args
[
2
],
const_args
[
2
]);
break
;
OP_32_64
(
ctpop
)
:
tcg_out_modrm
(
s
,
OPC_POPCNT
+
rexw
,
a0
,
a1
);
break
;
case
INDEX_op_brcond_i32
:
tcg_out_brcond32
(
s
,
a2
,
a0
,
a1
,
const_args
[
1
],
arg_label
(
args
[
3
]),
0
);
...
...
@@ -2398,6 +2403,8 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op)
case
INDEX_op_extract_i32
:
case
INDEX_op_extract_i64
:
case
INDEX_op_sextract_i32
:
case
INDEX_op_ctpop_i32
:
case
INDEX_op_ctpop_i64
:
return
&
r_r
;
case
INDEX_op_deposit_i32
:
...
...
@@ -2601,6 +2608,9 @@ static void tcg_target_init(TCGContext *s)
/* MOVBE is only available on Intel Atom and Haswell CPUs, so we
need to probe for it. */
have_movbe
=
(
c
&
bit_MOVBE
)
!=
0
;
#endif
#ifdef bit_POPCNT
have_popcnt
=
(
c
&
bit_POPCNT
)
!=
0
;
#endif
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录