Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
2dedf314
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,发现更多精彩内容 >>
提交
2dedf314
编写于
10月 17, 2011
作者:
R
Richard Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
target-sparc: Implement fpack{16,32,fix}.
Signed-off-by:
N
Richard Henderson
<
rth@twiddle.net
>
上级
f888300b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
96 addition
and
1 deletion
+96
-1
target-sparc/helper.h
target-sparc/helper.h
+3
-0
target-sparc/translate.c
target-sparc/translate.c
+29
-1
target-sparc/vis_helper.c
target-sparc/vis_helper.c
+64
-0
未找到文件。
target-sparc/helper.h
浏览文件 @
2dedf314
...
...
@@ -138,6 +138,9 @@ DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_CONST | TCG_CALL_PURE, i64, i64, i64)
DEF_HELPER_FLAGS_2
(
fmuld8ulx16
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_2
(
fexpand
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_3
(
pdist
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i64
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_2
(
fpack16
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i32
,
i64
,
i64
)
DEF_HELPER_FLAGS_3
(
fpack32
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i64
,
i64
,
i64
,
i64
)
DEF_HELPER_FLAGS_2
(
fpackfix
,
TCG_CALL_CONST
|
TCG_CALL_PURE
,
i32
,
i64
,
i64
)
#define VIS_HELPER(name) \
DEF_HELPER_FLAGS_2(f ## name ## 16, TCG_CALL_CONST | TCG_CALL_PURE, \
i64, i64, i64) \
...
...
target-sparc/translate.c
浏览文件 @
2dedf314
...
...
@@ -1739,6 +1739,20 @@ static inline void gen_ne_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2,
gen_store_fpr_D
(
dc
,
rd
,
dst
);
}
static
inline
void
gen_gsr_fop_DDD
(
DisasContext
*
dc
,
int
rd
,
int
rs1
,
int
rs2
,
void
(
*
gen
)(
TCGv_i64
,
TCGv_i64
,
TCGv_i64
,
TCGv_i64
))
{
TCGv_i64
dst
,
src1
,
src2
;
src1
=
gen_load_fpr_D
(
dc
,
rs1
);
src2
=
gen_load_fpr_D
(
dc
,
rs2
);
dst
=
gen_dest_fpr_D
();
gen
(
dst
,
cpu_gsr
,
src1
,
src2
);
gen_store_fpr_D
(
dc
,
rd
,
dst
);
}
static
inline
void
gen_ne_fop_DDDD
(
DisasContext
*
dc
,
int
rd
,
int
rs1
,
int
rs2
,
void
(
*
gen
)(
TCGv_i64
,
TCGv_i64
,
TCGv_i64
,
TCGv_i64
))
{
...
...
@@ -4072,9 +4086,23 @@ static void disas_sparc_insn(DisasContext * dc)
gen_ne_fop_DDD
(
dc
,
rd
,
rs1
,
rs2
,
gen_helper_fmuld8ulx16
);
break
;
case
0x03a
:
/* VIS I fpack32 */
CHECK_FPU_FEATURE
(
dc
,
VIS1
);
gen_gsr_fop_DDD
(
dc
,
rd
,
rs1
,
rs2
,
gen_helper_fpack32
);
break
;
case
0x03b
:
/* VIS I fpack16 */
CHECK_FPU_FEATURE
(
dc
,
VIS1
);
cpu_src1_64
=
gen_load_fpr_D
(
dc
,
rs2
);
cpu_dst_32
=
gen_dest_fpr_F
();
gen_helper_fpack16
(
cpu_dst_32
,
cpu_gsr
,
cpu_src1_64
);
gen_store_fpr_F
(
dc
,
rd
,
cpu_dst_32
);
break
;
case
0x03d
:
/* VIS I fpackfix */
goto
illegal_insn
;
CHECK_FPU_FEATURE
(
dc
,
VIS1
);
cpu_src1_64
=
gen_load_fpr_D
(
dc
,
rs2
);
cpu_dst_32
=
gen_dest_fpr_F
();
gen_helper_fpackfix
(
cpu_dst_32
,
cpu_gsr
,
cpu_src1_64
);
gen_store_fpr_F
(
dc
,
rd
,
cpu_dst_32
);
break
;
case
0x03e
:
/* VIS I pdist */
CHECK_FPU_FEATURE
(
dc
,
VIS1
);
gen_ne_fop_DDDD
(
dc
,
rd
,
rs1
,
rs2
,
gen_helper_pdist
);
...
...
target-sparc/vis_helper.c
浏览文件 @
2dedf314
...
...
@@ -417,3 +417,67 @@ uint64_t helper_pdist(uint64_t sum, uint64_t src1, uint64_t src2)
return
sum
;
}
uint32_t
helper_fpack16
(
uint64_t
gsr
,
uint64_t
rs2
)
{
int
scale
=
(
gsr
>>
3
)
&
0xf
;
uint32_t
ret
=
0
;
int
byte
;
for
(
byte
=
0
;
byte
<
4
;
byte
++
)
{
uint32_t
val
;
int16_t
src
=
rs2
>>
(
byte
*
16
);
int32_t
scaled
=
src
<<
scale
;
int32_t
from_fixed
=
scaled
>>
7
;
val
=
(
from_fixed
<
0
?
0
:
from_fixed
>
255
?
255
:
from_fixed
);
ret
|=
val
<<
(
8
*
byte
);
}
return
ret
;
}
uint64_t
helper_fpack32
(
uint64_t
gsr
,
uint64_t
rs1
,
uint64_t
rs2
)
{
int
scale
=
(
gsr
>>
3
)
&
0x1f
;
uint64_t
ret
=
0
;
int
word
;
ret
=
(
rs1
<<
8
)
&
~
(
0x000000ff000000ffULL
);
for
(
word
=
0
;
word
<
2
;
word
++
)
{
uint64_t
val
;
int32_t
src
=
rs2
>>
(
word
*
32
);
int64_t
scaled
=
(
int64_t
)
src
<<
scale
;
int64_t
from_fixed
=
scaled
>>
23
;
val
=
(
from_fixed
<
0
?
0
:
(
from_fixed
>
255
)
?
255
:
from_fixed
);
ret
|=
val
<<
(
32
*
word
);
}
return
ret
;
}
uint32_t
helper_fpackfix
(
uint64_t
gsr
,
uint64_t
rs2
)
{
int
scale
=
(
gsr
>>
3
)
&
0x1f
;
uint32_t
ret
=
0
;
int
word
;
for
(
word
=
0
;
word
<
2
;
word
++
)
{
uint32_t
val
;
int32_t
src
=
rs2
>>
(
word
*
32
);
int64_t
scaled
=
src
<<
scale
;
int64_t
from_fixed
=
scaled
>>
16
;
val
=
(
from_fixed
<
-
32768
?
-
32768
:
from_fixed
>
32767
?
32767
:
from_fixed
);
ret
|=
(
val
&
0xffff
)
<<
(
word
*
16
);
}
return
ret
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录