Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose and implement generic math interfaces on core types #54650

Merged
merged 15 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
<!-- Opt-in/out repo features -->
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
<!-- TODO: Upgrade compiler version to enable Static Abstracts in Interfaces; remove this once the employed SDK uses a new enough version. -->
<MicrosoftNetCompilersToolsetVersion>4.0.0-2.21323.11</MicrosoftNetCompilersToolsetVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to push any more changes, might be worth bumping this up to the latest available at the time.

<UsingToolMicrosoftNetILLinkTasks>true</UsingToolMicrosoftNetILLinkTasks>
<UsingToolIbcOptimization>false</UsingToolIbcOptimization>
<UsingToolXliff>false</UsingToolXliff>
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<FeaturePerfTracing>true</FeaturePerfTracing>
<FeatureTypeEquivalence>true</FeatureTypeEquivalence>
<FeatureBasicFreeze>true</FeatureBasicFreeze>
<FeatureGenericMath>true</FeatureGenericMath>
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
</PropertyGroup>

Expand Down Expand Up @@ -58,7 +59,8 @@
<DefineConstants Condition="'$(FeatureBasicFreeze)' == 'true'">$(DefineConstants);FEATURE_BASICFREEZE</DefineConstants>
<DefineConstants Condition="'$(FeaturePortableShuffleThunks)' == 'true'">$(DefineConstants);FEATURE_PORTABLE_SHUFFLE_THUNKS</DefineConstants>
<DefineConstants Condition="'$(FeatureICastable)' == 'true'">$(DefineConstants);FEATURE_ICASTABLE</DefineConstants>

<DefineConstants Condition="'$(FeatureGenericMath)' == 'true'">$(DefineConstants);FEATURE_GENERIC_MATH</DefineConstants>

<DefineConstants Condition="'$(ProfilingSupportedBuild)' == 'true'">$(DefineConstants);PROFILING_SUPPORTED</DefineConstants>
<DefineConstants Condition="'$(FeatureProfAttach)' == 'true'">$(DefineConstants);FEATURE_PROFAPI_ATTACH_DETACH</DefineConstants>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/vm/typedesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,11 @@ BOOL TypeVarTypeDesc::SatisfiesConstraints(SigTypeContext *pTypeContextOfConstra
}
CONTRACTL_END;

// During EEStartup, we cannot safely validate constraints, but we can also be confident that the code doesn't violate them
// Just skip validation and declare that the constraints are satisfied.
if (g_fEEInit)
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
return TRUE;

IMDInternalImport* pInternalImport = GetModule()->GetMDImport();
mdGenericParamConstraint tkConstraint;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2254,4 +2254,27 @@
<Link>Interop\Windows\Kernel32\Interop.Threading.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(FeatureGenericMath)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\IAdditionOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IAdditiveIdentity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IBitwiseOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IComparisonOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IDecrementOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IDivisionOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IEqualityOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IFloatingPoint.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IIncrementOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IInteger.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IMinMaxValue.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IModulusOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IMultiplicativeIdentity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IMultiplyOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\INumber.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IParseable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IShiftOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ISpanParseable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ISubtractionOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IUnaryNegationOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IUnaryPlusOperators.cs" />
</ItemGroup>
</Project>
Loading