Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
411edc22
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,发现更多精彩内容 >>
提交
411edc22
编写于
9月 10, 2012
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-s390: Implement LOAD/SET FP AND SIGNAL
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
a12000b9
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
40 addition
and
8 deletion
+40
-8
target-s390x/fpu_helper.c
target-s390x/fpu_helper.c
+29
-8
target-s390x/helper.h
target-s390x/helper.h
+1
-0
target-s390x/insn-data.def
target-s390x/insn-data.def
+4
-0
target-s390x/translate.c
target-s390x/translate.c
+6
-0
未找到文件。
target-s390x/fpu_helper.c
浏览文件 @
411edc22
...
...
@@ -674,19 +674,40 @@ uint64_t HELPER(sqxb)(CPUS390XState *env, uint64_t ah, uint64_t al)
return
RET128
(
ret
);
}
/* set fpc */
void
HELPER
(
sfpc
)(
CPUS390XState
*
env
,
uint64_t
fpc
)
{
static
const
int
rnd
[
4
]
=
{
static
const
int
fpc_to_rnd
[
4
]
=
{
float_round_nearest_even
,
float_round_to_zero
,
float_round_up
,
float_round_down
};
};
/* set fpc */
void
HELPER
(
sfpc
)(
CPUS390XState
*
env
,
uint64_t
fpc
)
{
/* Install everything in the main FPC. */
env
->
fpc
=
fpc
;
/* Install the rounding mode in the shadow fpu_status. */
set_float_rounding_mode
(
rnd
[
fpc
&
3
],
&
env
->
fpu_status
);
set_float_rounding_mode
(
fpc_to_rnd
[
fpc
&
3
],
&
env
->
fpu_status
);
}
/* set fpc and signal */
void
HELPER
(
sfas
)(
CPUS390XState
*
env
,
uint64_t
val
)
{
uint32_t
signalling
=
env
->
fpc
;
uint32_t
source
=
val
;
uint32_t
s390_exc
;
/* The contents of the source operand are placed in the FPC register;
then the flags in the FPC register are set to the logical OR of the
signalling flags and the source flags. */
env
->
fpc
=
source
|
(
signalling
&
0x00ff0000
);
set_float_rounding_mode
(
fpc_to_rnd
[
source
&
3
],
&
env
->
fpu_status
);
/* If any signalling flag is 1 and the corresponding source mask
is also 1, a simulated-iee-exception trap occurs. */
s390_exc
=
(
signalling
>>
16
)
&
(
source
>>
24
);
if
(
s390_exc
)
{
ieee_exception
(
env
,
s390_exc
|
3
,
GETPC
());
}
}
target-s390x/helper.h
浏览文件 @
411edc22
...
...
@@ -87,6 +87,7 @@ DEF_HELPER_4(tr, void, env, i32, i64, i64)
DEF_HELPER_4
(
cksm
,
i64
,
env
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_5
(
calc_cc
,
TCG_CALL_NO_RWG_SE
,
i32
,
env
,
i32
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_2
(
sfpc
,
TCG_CALL_NO_RWG
,
void
,
env
,
i64
)
DEF_HELPER_FLAGS_2
(
sfas
,
TCG_CALL_NO_WG
,
void
,
env
,
i64
)
DEF_HELPER_FLAGS_1
(
popcnt
,
TCG_CALL_NO_RWG_SE
,
i64
,
i64
)
#ifndef CONFIG_USER_ONLY
...
...
target-s390x/insn-data.def
浏览文件 @
411edc22
...
...
@@ -433,6 +433,8 @@
/* LOAD FPC */
C(0xb29d, LFPC, S, Z, 0, m2_32u, 0, 0, sfpc, 0)
/* LOAD FPC AND SIGNAL */
C(0xb2bd, LFAS, S, IEEEE_SIM, 0, m2_32u, 0, 0, sfas, 0)
/* LOAD LENGTHENED */
C(0xb304, LDEBR, RRE, Z, 0, e2, f1, 0, ldeb, 0)
...
...
@@ -566,6 +568,8 @@
C(0xb24e, SAR, RRE, Z, 0, r2_o, 0, 0, sar, 0)
/* SET FPC */
C(0xb384, SFPC, RRE, Z, 0, r1_o, 0, 0, sfpc, 0)
/* SET FPC AND SIGNAL */
C(0xb385, SFASR, RRE, IEEEE_SIM, 0, r1_o, 0, 0, sfas, 0)
/* SET BFP ROUNDING MODE */
C(0xb299, SRNM, S, Z, 0, 0, 0, 0, srnm, 0)
C(0xb2b8, SRNMB, S, FPE, 0, 0, 0, 0, srnm, 0)
...
...
target-s390x/translate.c
浏览文件 @
411edc22
...
...
@@ -2921,6 +2921,12 @@ static ExitStatus op_sfpc(DisasContext *s, DisasOps *o)
return
NO_EXIT
;
}
static
ExitStatus
op_sfas
(
DisasContext
*
s
,
DisasOps
*
o
)
{
gen_helper_sfas
(
cpu_env
,
o
->
in2
);
return
NO_EXIT
;
}
static
ExitStatus
op_srnm
(
DisasContext
*
s
,
DisasOps
*
o
)
{
int
b2
=
get_field
(
s
->
fields
,
b2
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录