Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
ad19b358
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看板
提交
ad19b358
编写于
3月 31, 2014
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tcg-s390: Allow immediate operands to add2 and sub2
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
f167dc37
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
52 addition
and
12 deletion
+52
-12
tcg/s390/tcg-target.c
tcg/s390/tcg-target.c
+52
-12
未找到文件。
tcg/s390/tcg-target.c
浏览文件 @
ad19b358
...
...
@@ -42,6 +42,7 @@
#define TCG_CT_CONST_ORI 0x200
#define TCG_CT_CONST_XORI 0x400
#define TCG_CT_CONST_CMPI 0x800
#define TCG_CT_CONST_ADLI 0x1000
/* Several places within the instruction set 0 means "no register"
rather than TCG_REG_R0. */
...
...
@@ -403,6 +404,9 @@ static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
tcg_regset_clear
(
ct
->
u
.
regs
);
tcg_regset_set_reg
(
ct
->
u
.
regs
,
TCG_REG_R3
);
break
;
case
'A'
:
ct
->
ct
|=
TCG_CT_CONST_ADLI
;
break
;
case
'K'
:
ct
->
ct
|=
TCG_CT_CONST_MULI
;
break
;
...
...
@@ -507,6 +511,20 @@ static int tcg_match_cmpi(TCGType type, tcg_target_long val)
}
}
/* Immediates to be used with add2/sub2. */
static
int
tcg_match_add2i
(
TCGType
type
,
tcg_target_long
val
)
{
if
(
facilities
&
FACILITY_EXT_IMM
)
{
if
(
type
==
TCG_TYPE_I32
)
{
return
1
;
}
else
if
(
val
>=
-
0xffffffffll
&&
val
<=
0xffffffffll
)
{
return
1
;
}
}
return
0
;
}
/* Test if a constant matches the constraint. */
static
int
tcg_target_const_match
(
tcg_target_long
val
,
TCGType
type
,
const
TCGArgConstraint
*
arg_ct
)
...
...
@@ -532,6 +550,8 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type,
}
else
{
return
val
==
(
int16_t
)
val
;
}
}
else
if
(
ct
&
TCG_CT_CONST_ADLI
)
{
return
tcg_match_add2i
(
type
,
val
);
}
else
if
(
ct
&
TCG_CT_CONST_ORI
)
{
return
tcg_match_ori
(
type
,
val
);
}
else
if
(
ct
&
TCG_CT_CONST_XORI
)
{
...
...
@@ -1780,13 +1800,19 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
break
;
case
INDEX_op_add2_i32
:
/* ??? Make use of ALFI. */
tcg_out_insn
(
s
,
RR
,
ALR
,
args
[
0
],
args
[
4
]);
if
(
const_args
[
4
])
{
tcg_out_insn
(
s
,
RIL
,
ALFI
,
args
[
0
],
args
[
4
]);
}
else
{
tcg_out_insn
(
s
,
RR
,
ALR
,
args
[
0
],
args
[
4
]);
}
tcg_out_insn
(
s
,
RRE
,
ALCR
,
args
[
1
],
args
[
5
]);
break
;
case
INDEX_op_sub2_i32
:
/* ??? Make use of SLFI. */
tcg_out_insn
(
s
,
RR
,
SLR
,
args
[
0
],
args
[
4
]);
if
(
const_args
[
4
])
{
tcg_out_insn
(
s
,
RIL
,
SLFI
,
args
[
0
],
args
[
4
]);
}
else
{
tcg_out_insn
(
s
,
RR
,
SLR
,
args
[
0
],
args
[
4
]);
}
tcg_out_insn
(
s
,
RRE
,
SLBR
,
args
[
1
],
args
[
5
]);
break
;
...
...
@@ -1987,13 +2013,27 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
break
;
case
INDEX_op_add2_i64
:
/* ??? Make use of ALGFI and SLGFI. */
tcg_out_insn
(
s
,
RRE
,
ALGR
,
args
[
0
],
args
[
4
]);
if
(
const_args
[
4
])
{
if
((
int64_t
)
args
[
4
]
>=
0
)
{
tcg_out_insn
(
s
,
RIL
,
ALGFI
,
args
[
0
],
args
[
4
]);
}
else
{
tcg_out_insn
(
s
,
RIL
,
SLGFI
,
args
[
0
],
-
args
[
4
]);
}
}
else
{
tcg_out_insn
(
s
,
RRE
,
ALGR
,
args
[
0
],
args
[
4
]);
}
tcg_out_insn
(
s
,
RRE
,
ALCGR
,
args
[
1
],
args
[
5
]);
break
;
case
INDEX_op_sub2_i64
:
/* ??? Make use of ALGFI and SLGFI. */
tcg_out_insn
(
s
,
RRE
,
SLGR
,
args
[
0
],
args
[
4
]);
if
(
const_args
[
4
])
{
if
((
int64_t
)
args
[
4
]
>=
0
)
{
tcg_out_insn
(
s
,
RIL
,
SLGFI
,
args
[
0
],
args
[
4
]);
}
else
{
tcg_out_insn
(
s
,
RIL
,
ALGFI
,
args
[
0
],
-
args
[
4
]);
}
}
else
{
tcg_out_insn
(
s
,
RRE
,
SLGR
,
args
[
0
],
args
[
4
]);
}
tcg_out_insn
(
s
,
RRE
,
SLBGR
,
args
[
1
],
args
[
5
]);
break
;
...
...
@@ -2066,8 +2106,8 @@ static const TCGTargetOpDef s390_op_defs[] = {
{
INDEX_op_bswap16_i32
,
{
"r"
,
"r"
}
},
{
INDEX_op_bswap32_i32
,
{
"r"
,
"r"
}
},
{
INDEX_op_add2_i32
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r"
,
"r"
}
},
{
INDEX_op_sub2_i32
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r"
,
"r"
}
},
{
INDEX_op_add2_i32
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r
A
"
,
"r"
}
},
{
INDEX_op_sub2_i32
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r
A
"
,
"r"
}
},
{
INDEX_op_brcond_i32
,
{
"r"
,
"rC"
}
},
{
INDEX_op_setcond_i32
,
{
"r"
,
"r"
,
"rC"
}
},
...
...
@@ -2124,8 +2164,8 @@ static const TCGTargetOpDef s390_op_defs[] = {
{
INDEX_op_bswap32_i64
,
{
"r"
,
"r"
}
},
{
INDEX_op_bswap64_i64
,
{
"r"
,
"r"
}
},
{
INDEX_op_add2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r"
,
"r"
}
},
{
INDEX_op_sub2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r"
,
"r"
}
},
{
INDEX_op_add2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r
A
"
,
"r"
}
},
{
INDEX_op_sub2_i64
,
{
"r"
,
"r"
,
"0"
,
"1"
,
"r
A
"
,
"r"
}
},
{
INDEX_op_brcond_i64
,
{
"r"
,
"rC"
}
},
{
INDEX_op_setcond_i64
,
{
"r"
,
"r"
,
"rC"
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录