Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
ce411066
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看板
提交
ce411066
编写于
11月 16, 2016
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tcg/s390: Handle clz opcode
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
2a1d9d41
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
2 deletion
+36
-2
tcg/s390/tcg-target.h
tcg/s390/tcg-target.h
+1
-1
tcg/s390/tcg-target.inc.c
tcg/s390/tcg-target.inc.c
+35
-1
未找到文件。
tcg/s390/tcg-target.h
浏览文件 @
ce411066
...
...
@@ -110,7 +110,7 @@ extern uint64_t s390_facilities;
#define TCG_TARGET_HAS_eqv_i64 0
#define TCG_TARGET_HAS_nand_i64 0
#define TCG_TARGET_HAS_nor_i64 0
#define TCG_TARGET_HAS_clz_i64
0
#define TCG_TARGET_HAS_clz_i64
(s390_facilities & FACILITY_EXT_IMM)
#define TCG_TARGET_HAS_ctz_i64 0
#define TCG_TARGET_HAS_deposit_i64 (s390_facilities & FACILITY_GEN_INST_EXT)
#define TCG_TARGET_HAS_extract_i64 (s390_facilities & FACILITY_GEN_INST_EXT)
...
...
tcg/s390/tcg-target.inc.c
浏览文件 @
ce411066
...
...
@@ -50,7 +50,7 @@
#define TCG_REG_NONE 0
/* A scratch register that may be be used throughout the backend. */
#define TCG_TMP0 TCG_REG_R1
4
#define TCG_TMP0 TCG_REG_R1
#ifndef CONFIG_SOFTMMU
#define TCG_GUEST_BASE_REG TCG_REG_R13
...
...
@@ -133,6 +133,7 @@ typedef enum S390Opcode {
RRE_DLR
=
0xb997
,
RRE_DSGFR
=
0xb91d
,
RRE_DSGR
=
0xb90d
,
RRE_FLOGR
=
0xb983
,
RRE_LGBR
=
0xb906
,
RRE_LCGR
=
0xb903
,
RRE_LGFR
=
0xb914
,
...
...
@@ -1246,6 +1247,33 @@ static void tgen_movcond(TCGContext *s, TCGType type, TCGCond c, TCGReg dest,
}
}
static
void
tgen_clz
(
TCGContext
*
s
,
TCGReg
dest
,
TCGReg
a1
,
TCGArg
a2
,
int
a2const
)
{
/* Since this sets both R and R+1, we have no choice but to store the
result into R0, allowing R1 == TCG_TMP0 to be clobbered as well. */
QEMU_BUILD_BUG_ON
(
TCG_TMP0
!=
TCG_REG_R1
);
tcg_out_insn
(
s
,
RRE
,
FLOGR
,
TCG_REG_R0
,
a1
);
if
(
a2const
&&
a2
==
64
)
{
tcg_out_mov
(
s
,
TCG_TYPE_I64
,
dest
,
TCG_REG_R0
);
}
else
{
if
(
a2const
)
{
tcg_out_movi
(
s
,
TCG_TYPE_I64
,
dest
,
a2
);
}
else
{
tcg_out_mov
(
s
,
TCG_TYPE_I64
,
dest
,
a2
);
}
if
(
s390_facilities
&
FACILITY_LOAD_ON_COND
)
{
/* Emit: if (one bit found) dest = r0. */
tcg_out_insn
(
s
,
RRF
,
LOCGR
,
dest
,
TCG_REG_R0
,
2
);
}
else
{
/* Emit: if (no one bit found) goto over; dest = r0; over: */
tcg_out_insn
(
s
,
RI
,
BRC
,
8
,
(
4
+
4
)
>>
1
);
tcg_out_insn
(
s
,
RRE
,
LGR
,
dest
,
TCG_REG_R0
);
}
}
}
static
void
tgen_deposit
(
TCGContext
*
s
,
TCGReg
dest
,
TCGReg
src
,
int
ofs
,
int
len
,
int
z
)
{
...
...
@@ -2186,6 +2214,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
tgen_extract
(
s
,
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
]);
break
;
case
INDEX_op_clz_i64
:
tgen_clz
(
s
,
args
[
0
],
args
[
1
],
args
[
2
],
const_args
[
2
]);
break
;
case
INDEX_op_mb
:
/* The host memory model is quite strong, we simply need to
serialize the instruction stream. */
...
...
@@ -2309,6 +2341,8 @@ static const TCGTargetOpDef s390_op_defs[] = {
{
INDEX_op_bswap32_i64
,
{
"r"
,
"r"
}
},
{
INDEX_op_bswap64_i64
,
{
"r"
,
"r"
}
},
{
INDEX_op_clz_i64
,
{
"r"
,
"r"
,
"ri"
}
},
{
INDEX_op_add2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"rA"
,
"r"
}
},
{
INDEX_op_sub2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"rA"
,
"r"
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录