未验证 提交 0cc170c7 编写于 作者: E Egor Bogatov 提交者: GitHub

Remove an assert from impHWIntrinsic (#72084)

上级 1a0c9cac
......@@ -770,12 +770,11 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
if (HWIntrinsicInfo::IsMultiReg(intrinsic))
{
// We don't have generic multireg APIs
assert(sizeBytes == 0);
}
else
{
assert(sizeBytes != 0);
// We want to return early here for cases where retType was TYP_STRUCT as per method signature and
// rather than deferring the decision after getting the simdBaseJitType of arg.
if (!isSupportedBaseType(intrinsic, simdBaseJitType))
......@@ -783,6 +782,7 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
return nullptr;
}
assert(sizeBytes != 0);
retType = getSIMDTypeForSize(sizeBytes);
}
}
......
......@@ -1129,6 +1129,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
}
case SN_Create: {
MonoType *etype = get_vector_t_elem_type (fsig->ret);
if (!MONO_TYPE_IS_VECTOR_PRIMITIVE (etype))
return NULL;
if (fsig->param_count == 1 && mono_metadata_type_equal (fsig->params [0], etype))
return emit_simd_ins (cfg, klass, type_to_expand_op (etype), args [0]->dreg, -1);
else if (is_create_from_half_vectors_overload (fsig))
......
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
public class Runtime_72081
{
public static int Main()
{
try
{
Vector128<UInt128> d1 = default;
Vector128<UInt128> d2 = Vector128.Create<UInt128>(111);
Vector128<UInt128> x = d1 + d2 * d1;
return d1.GetHashCode() + x.GetHashCode();
}
catch (NotSupportedException)
{
return 100;
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册