Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
111994ee
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,发现更多精彩内容 >>
提交
111994ee
编写于
1月 10, 2013
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-i386: Implement MOVBE
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
701ed211
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
110 addition
and
28 deletion
+110
-28
target-i386/cpu.c
target-i386/cpu.c
+13
-3
target-i386/translate.c
target-i386/translate.c
+97
-25
未找到文件。
target-i386/cpu.c
浏览文件 @
111994ee
...
@@ -389,10 +389,15 @@ typedef struct x86_def_t {
...
@@ -389,10 +389,15 @@ typedef struct x86_def_t {
CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
#define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
CPUID_EXT_HYPERVISOR)
CPUID_EXT_
MOVBE | CPUID_EXT_
HYPERVISOR)
/* missing:
/* missing:
CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
CPUID_EXT_PCLMULQDQ, CPUID_EXT_DTES64, CPUID_EXT_DSCPL,
CPUID_EXT_TM2, CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_XSAVE */
CPUID_EXT_VMX, CPUID_EXT_SMX, CPUID_EXT_EST, CPUID_EXT_TM2,
CPUID_EXT_CID, CPUID_EXT_FMA, CPUID_EXT_XTPR, CPUID_EXT_PDCM,
CPUID_EXT_PCID, CPUID_EXT_DCA, CPUID_EXT_SSE41, CPUID_EXT_SSE42,
CPUID_EXT_X2APIC, CPUID_EXT_TSC_DEADLINE_TIMER, CPUID_EXT_AES,
CPUID_EXT_XSAVE, CPUID_EXT_OSXSAVE, CPUID_EXT_AVX,
CPUID_EXT_F16C, CPUID_EXT_RDRAND */
#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
...
@@ -402,6 +407,11 @@ typedef struct x86_def_t {
...
@@ -402,6 +407,11 @@ typedef struct x86_def_t {
CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
#define TCG_SVM_FEATURES 0
#define TCG_SVM_FEATURES 0
#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP)
#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP)
/* missing:
CPUID_7_0_EBX_FSGSBASE, CPUID_7_0_EBX_BMI1, CPUID_7_0_EBX_HLE,
CPUID_7_0_EBX_AVX2, CPUID_7_0_EBX_BMI2, CPUID_7_0_EBX_ERMS,
CPUID_7_0_EBX_INVPCID, CPUID_7_0_EBX_RTM, CPUID_7_0_EBX_RDSEED,
CPUID_7_0_EBX_ADX */
/* built-in CPU model definitions
/* built-in CPU model definitions
*/
*/
...
...
target-i386/translate.c
浏览文件 @
111994ee
...
@@ -3837,11 +3837,13 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
...
@@ -3837,11 +3837,13 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
gen_op_mov_reg_T0
(
OT_LONG
,
reg
);
gen_op_mov_reg_T0
(
OT_LONG
,
reg
);
break
;
break
;
case
0x138
:
case
0x138
:
if
(
s
->
prefix
&
PREFIX_REPNZ
)
goto
crc32
;
case
0x038
:
case
0x038
:
b
=
modrm
;
b
=
modrm
;
if
((
b
&
0xf0
)
==
0xf0
)
{
goto
do_0f_38_fx
;
}
modrm
=
cpu_ldub_code
(
env
,
s
->
pc
++
);
modrm
=
cpu_ldub_code
(
env
,
s
->
pc
++
);
rm
=
modrm
&
7
;
rm
=
modrm
&
7
;
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
...
@@ -3914,36 +3916,106 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
...
@@ -3914,36 +3916,106 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b,
set_cc_op
(
s
,
CC_OP_EFLAGS
);
set_cc_op
(
s
,
CC_OP_EFLAGS
);
}
}
break
;
break
;
case
0x338
:
/* crc32 */
crc32:
case
0x238
:
b
=
modrm
;
case
0x338
:
do_0f_38_fx:
/* Various integer extensions at 0f 38 f[0-f]. */
b
=
modrm
|
(
b1
<<
8
);
modrm
=
cpu_ldub_code
(
env
,
s
->
pc
++
);
modrm
=
cpu_ldub_code
(
env
,
s
->
pc
++
);
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
reg
=
((
modrm
>>
3
)
&
7
)
|
rex_r
;
if
(
b
!=
0xf0
&&
b
!=
0xf1
)
switch
(
b
)
{
goto
illegal_op
;
case
0x3f0
:
/* crc32 Gd,Eb */
if
(
!
(
s
->
cpuid_ext_features
&
CPUID_EXT_SSE42
))
case
0x3f1
:
/* crc32 Gd,Ey */
goto
illegal_op
;
do_crc32:
if
(
!
(
s
->
cpuid_ext_features
&
CPUID_EXT_SSE42
))
{
goto
illegal_op
;
}
if
((
b
&
0xff
)
==
0xf0
)
{
ot
=
OT_BYTE
;
}
else
if
(
s
->
dflag
!=
2
)
{
ot
=
(
s
->
prefix
&
PREFIX_DATA
?
OT_WORD
:
OT_LONG
);
}
else
{
ot
=
OT_QUAD
;
}
if
(
b
==
0xf0
)
gen_op_mov_TN_reg
(
OT_LONG
,
0
,
reg
);
ot
=
OT_BYTE
;
tcg_gen_trunc_tl_i32
(
cpu_tmp2_i32
,
cpu_T
[
0
]);
else
if
(
b
==
0xf1
&&
s
->
dflag
!=
2
)
gen_ldst_modrm
(
env
,
s
,
modrm
,
ot
,
OR_TMP0
,
0
);
if
(
s
->
prefix
&
PREFIX_DATA
)
gen_helper_crc32
(
cpu_T
[
0
],
cpu_tmp2_i32
,
ot
=
OT_WORD
;
cpu_T
[
0
],
tcg_const_i32
(
8
<<
ot
));
else
ot
=
OT_LONG
;
else
ot
=
OT_QUAD
;
gen_op_mov_TN_reg
(
OT_LONG
,
0
,
reg
);
ot
=
(
s
->
dflag
==
2
)
?
OT_QUAD
:
OT_LONG
;
tcg_gen_trunc_tl_i32
(
cpu_tmp2_i32
,
cpu_T
[
0
]);
gen_op_mov_reg_T0
(
ot
,
reg
);
gen_ldst_modrm
(
env
,
s
,
modrm
,
ot
,
OR_TMP0
,
0
);
break
;
gen_helper_crc32
(
cpu_T
[
0
],
cpu_tmp2_i32
,
cpu_T
[
0
],
tcg_const_i32
(
8
<<
ot
));
ot
=
(
s
->
dflag
==
2
)
?
OT_QUAD
:
OT_LONG
;
case
0x1f0
:
/* crc32 or movbe */
gen_op_mov_reg_T0
(
ot
,
reg
);
case
0x1f1
:
/* For these insns, the f3 prefix is supposed to have priority
over the 66 prefix, but that's not what we implement above
setting b1. */
if
(
s
->
prefix
&
PREFIX_REPNZ
)
{
goto
do_crc32
;
}
/* FALLTHRU */
case
0x0f0
:
/* movbe Gy,My */
case
0x0f1
:
/* movbe My,Gy */
if
(
!
(
s
->
cpuid_ext_features
&
CPUID_EXT_MOVBE
))
{
goto
illegal_op
;
}
if
(
s
->
dflag
!=
2
)
{
ot
=
(
s
->
prefix
&
PREFIX_DATA
?
OT_WORD
:
OT_LONG
);
}
else
{
ot
=
OT_QUAD
;
}
/* Load the data incoming to the bswap. Note that the TCG
implementation of bswap requires the input be zero
extended. In the case of the loads, we simply know that
gen_op_ld_v via gen_ldst_modrm does that already. */
if
((
b
&
1
)
==
0
)
{
gen_ldst_modrm
(
env
,
s
,
modrm
,
ot
,
OR_TMP0
,
0
);
}
else
{
switch
(
ot
)
{
case
OT_WORD
:
tcg_gen_ext16u_tl
(
cpu_T
[
0
],
cpu_regs
[
reg
]);
break
;
default:
tcg_gen_ext32u_tl
(
cpu_T
[
0
],
cpu_regs
[
reg
]);
break
;
case
OT_QUAD
:
tcg_gen_mov_tl
(
cpu_T
[
0
],
cpu_regs
[
reg
]);
break
;
}
}
switch
(
ot
)
{
case
OT_WORD
:
tcg_gen_bswap16_tl
(
cpu_T
[
0
],
cpu_T
[
0
]);
break
;
default:
tcg_gen_bswap32_tl
(
cpu_T
[
0
],
cpu_T
[
0
]);
break
;
#ifdef TARGET_X86_64
case
OT_QUAD
:
tcg_gen_bswap64_tl
(
cpu_T
[
0
],
cpu_T
[
0
]);
break
;
#endif
}
if
((
b
&
1
)
==
0
)
{
gen_op_mov_reg_T0
(
ot
,
reg
);
}
else
{
gen_ldst_modrm
(
env
,
s
,
modrm
,
ot
,
OR_TMP0
,
1
);
}
break
;
default:
goto
illegal_op
;
}
break
;
break
;
case
0x03a
:
case
0x03a
:
case
0x13a
:
case
0x13a
:
b
=
modrm
;
b
=
modrm
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录