Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
7cb6fe69
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7cb6fe69
编写于
11月 02, 2022
作者:
M
Matous Kozak
提交者:
GitHub
11月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[mono] Remove Vector128 checks for amd64 APIs (#77534)
* Remove Vector128 checks for amd64 APIs * refactor emit_sum_vector (amd64)
上级
76d4691b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
32 deletion
+5
-32
src/mono/mono/mini/simd-intrinsics.c
src/mono/mono/mini/simd-intrinsics.c
+5
-32
未找到文件。
src/mono/mono/mini/simd-intrinsics.c
浏览文件 @
7cb6fe69
...
...
@@ -582,12 +582,8 @@ static const int fast_log2 [] = { -1, -1, 1, -1, 2, -1, -1, -1, 3 };
static
MonoInst
*
emit_sum_vector
(
MonoCompile
*
cfg
,
MonoType
*
vector_type
,
MonoTypeEnum
element_type
,
MonoInst
*
arg
)
{
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
vector_type
);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Works only with Vector128
return
NULL
;
MonoClass
*
vector_class
=
mono_class_from_mono_type_internal
(
vector_type
);
int
instc0
=
-
1
;
switch
(
element_type
)
{
case
MONO_TYPE_R4
:
...
...
@@ -639,12 +635,13 @@ emit_sum_vector (MonoCompile *cfg, MonoType *vector_type, MonoTypeEnum element_t
if
(
!
is_SIMD_feature_supported
(
cfg
,
feature
))
return
NULL
;
MonoType
*
etype
=
mono_class_get_context
(
arg_class
)
->
class_inst
->
type_argv
[
0
];
int
vector_size
=
mono_class_value_size
(
vector_class
,
NULL
);
MonoType
*
etype
=
mono_class_get_context
(
vector_class
)
->
class_inst
->
type_argv
[
0
];
int
elem_size
=
mono_class_value_size
(
mono_class_from_mono_type_internal
(
etype
),
NULL
);
int
num_elems
=
size
/
elem_size
;
int
num_elems
=
vector_
size
/
elem_size
;
int
num_rounds
=
fast_log2
[
num_elems
];
MonoInst
*
tmp
=
emit_xzero
(
cfg
,
arg
_class
);
MonoInst
*
tmp
=
emit_xzero
(
cfg
,
vector
_class
);
MonoInst
*
ins
=
arg
;
// HorizontalAdds over vector log2(num_elems) times
for
(
int
i
=
0
;
i
<
num_rounds
;
++
i
)
{
...
...
@@ -1150,10 +1147,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
return
emit_simd_ins_for_sig
(
cfg
,
klass
,
OP_XOP_OVR_X_X
,
iid
,
arg0_type
,
fsig
,
args
);
#elif defined(TARGET_AMD64)
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
fsig
->
params
[
0
]);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Works only with Vector128
return
NULL
;
if
(
type_enum_is_float
(
arg0_type
))
{
// args [0] & ~vector(-0.0)
MonoInst
*
zero
=
emit_xzero
(
cfg
,
arg_class
);
// 0.0
...
...
@@ -1186,11 +1179,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
#ifdef TARGET_ARM64
return
emit_simd_ins_for_sig
(
cfg
,
klass
,
OP_ARM64_BIC
,
-
1
,
arg0_type
,
fsig
,
args
);
#elif defined(TARGET_AMD64)
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
fsig
->
params
[
0
]);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Works only with Vector128
return
NULL
;
/* Swap lhs and rhs because Vector128 needs lhs & !rhs
whereas SSE2 does !lhs & rhs */
MonoInst
*
tmp
=
args
[
0
];
...
...
@@ -1225,11 +1213,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
int
ceil_or_floor
=
id
==
SN_Ceiling
?
INTRINS_AARCH64_ADV_SIMD_FRINTP
:
INTRINS_AARCH64_ADV_SIMD_FRINTM
;
return
emit_simd_ins_for_sig
(
cfg
,
klass
,
OP_XOP_OVR_X_X
,
ceil_or_floor
,
arg0_type
,
fsig
,
args
);
#elif defined(TARGET_AMD64)
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
fsig
->
params
[
0
]);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Supported only on Vector128
return
NULL
;
if
(
!
is_SIMD_feature_supported
(
cfg
,
MONO_CPU_X86_SSE41
))
return
NULL
;
...
...
@@ -1335,11 +1318,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
return
emit_sum_vector
(
cfg
,
fsig
->
params
[
0
],
arg0_type
,
pairwise_multiply
);
#elif defined(TARGET_AMD64)
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
fsig
->
params
[
0
]);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Works only with Vector128
return
NULL
;
int
instc
=-
1
;
if
(
type_enum_is_float
(
arg0_type
))
{
if
(
is_SIMD_feature_supported
(
cfg
,
MONO_CPU_X86_SSE41
))
{
...
...
@@ -1609,11 +1587,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
#ifdef TARGET_ARM64
return
emit_simd_ins_for_sig
(
cfg
,
klass
,
OP_XOP_OVR_X_X
,
INTRINS_AARCH64_ADV_SIMD_FSQRT
,
arg0_type
,
fsig
,
args
);
#elif defined(TARGET_AMD64)
MonoClass
*
arg_class
=
mono_class_from_mono_type_internal
(
fsig
->
params
[
0
]);
int
size
=
mono_class_value_size
(
arg_class
,
NULL
);
if
(
size
!=
16
)
// Only works with Vector128
return
NULL
;
int
instc0
=
arg0_type
==
MONO_TYPE_R4
?
INTRINS_SSE_SQRT_PS
:
INTRINS_SSE_SQRT_PD
;
return
emit_simd_ins_for_sig
(
cfg
,
klass
,
OP_XOP_X_X
,
instc0
,
arg0_type
,
fsig
,
args
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录