You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@@ -39,10 +39,10 @@ Global
|
||||
{D9906F1A-A41A-43CD-81D2-BA94CF0001C9}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{D9906F1A-A41A-43CD-81D2-BA94CF0001C9}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{D9906F1A-A41A-43CD-81D2-BA94CF0001C9}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
|
||||
{53134B0C-0D57-481B-B84E-D1991E8D54FF}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
|
||||
{650277B5-9423-4ACE-BB54-2659995B21C7}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{650277B5-9423-4ACE-BB54-2659995B21C7}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{650277B5-9423-4ACE-BB54-2659995B21C7}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<MinClientVersion>2.8.6</MinClientVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<HarvestIncludePaths Include="ref\netstandard1.0;ref\netstandard2.0">
|
||||
<SupportedFramework>netcore45;wp8;wpa81;netcoreapp1.0;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
</HarvestIncludePaths>
|
||||
<ProjectReference Include="..\ref\System.Numerics.Vectors.csproj">
|
||||
<SupportedFramework>net45;netcore45;wp8;wpa81;netcoreapp1.0;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
<!-- Make sure this doesn't get stripped during harvesting.
|
||||
We have an implementation that will work on desktop, thus needs a unique assembly version -->
|
||||
<Preserve>true</Preserve>
|
||||
<SupportedFramework>net45</SupportedFramework>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\src\System.Numerics.Vectors.csproj" />
|
||||
</ItemGroup>
|
||||
@@ -21,15 +21,8 @@
|
||||
<InboxOnTargetFramework Include="xamarinmac20" />
|
||||
<InboxOnTargetFramework Include="xamarintvos10" />
|
||||
<InboxOnTargetFramework Include="xamarinwatchos10" />
|
||||
|
||||
<!-- Since UAP and .NETCoreApp are package based we still want to enable
|
||||
OOBing libraries that happen to overlap with their framework package.
|
||||
This avoids us having to lock the API in our NuGet packages just
|
||||
to match what shipped inbox: since we can provide a new library
|
||||
we can update it to add API without raising the netstandard version. -->
|
||||
<ValidatePackageSuppression Include="TreatAsOutOfBox">
|
||||
<Value>.NETCoreApp;UAP</Value>
|
||||
</ValidatePackageSuppression>
|
||||
<InboxOnTargetFramework Include="netcoreapp2.0" />
|
||||
<InboxOnTargetFramework Include="uap10.0.16299" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
@@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<PackageConfigurations>
|
||||
netstandard1.0;
|
||||
net45;
|
||||
netstandard;
|
||||
net46;
|
||||
</PackageConfigurations>
|
||||
|
||||
@@ -301,6 +301,9 @@ namespace System.Numerics
|
||||
public Vector(T value) { throw null; }
|
||||
public Vector(T[] values) { throw null; }
|
||||
public Vector(T[] values, int index) { throw null; }
|
||||
#if HAS_SPAN
|
||||
public Vector(Span<T> values) { throw null; }
|
||||
#endif
|
||||
public static int Count { get { throw null; } }
|
||||
public T this[int index] { get { throw null; } }
|
||||
public static System.Numerics.Vector<T> One { get { throw null; } }
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{650277B5-9423-4ACE-BB54-2659995B21C7}</ProjectGuid>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx' OR '$(TargetGroup)' == 'net46'">true</IsPartialFacadeAssembly>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetsNetFx)'=='true' AND '$(TargetGroup)' != 'net45'">true</IsPartialFacadeAssembly>
|
||||
<DefineConstants Condition="'$(TargetsNetCoreApp)'=='true' OR '$(TargetsUap)' == 'true'">$(DefineConstants);HAS_SPAN</DefineConstants>
|
||||
<!-- Must match version supported by frameworks which support 4.1.* inbox.
|
||||
Can be removed when API is added and this assembly is versioned to 4.2.* -->
|
||||
<AssemblyVersion Condition="'$(TargetsNetFx)' != 'true'">4.1.3.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
|
||||
@@ -20,14 +26,14 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="System.Numerics.Vectors.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' == 'netfx' OR '$(TargetGroup)' == 'net46'">
|
||||
<ItemGroup Condition="'$(TargetsNetFx)'=='true'">
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System.Numerics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.0'">
|
||||
<Reference Include="System.Runtime" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' OR '$(TargetGroup)' == 'uap'">
|
||||
<ItemGroup Condition="'$(TargetsNetCoreApp)'=='true' OR '$(TargetsUap)' == 'true'">
|
||||
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
|
||||
1
external/corefx/src/System.Numerics.Vectors/src/ApiCompatBaseline.uapaot.txt
vendored
Normal file
1
external/corefx/src/System.Numerics.Vectors/src/ApiCompatBaseline.uapaot.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
MembersMustExist : Member 'System.Numerics.Vector<T>..ctor(System.Span<T>)' does not exist in the implementation but it does exist in the contract.
|
||||
@@ -7,10 +7,12 @@
|
||||
net46;
|
||||
</PackageConfigurations>
|
||||
<BuildConfigurations>
|
||||
uapaot-Windows_NT;
|
||||
uap-Windows_NT;
|
||||
netfx-Windows_NT;
|
||||
netcoreapp;
|
||||
netcoreapp-Windows_NT;
|
||||
netcoreapp-Unix;
|
||||
$(PackageConfigurations)
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -70,4 +70,7 @@
|
||||
<data name="Arg_TypeNotSupported" xml:space="preserve">
|
||||
<value>Specified type is not supported</value>
|
||||
</data>
|
||||
<data name="Arg_InsufficientNumberOfElements" xml:space="preserve">
|
||||
<value>At least {0} element(s) are expected in the parameter "{1}".</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -6,13 +6,17 @@
|
||||
<RootNamespace>System.Numerics</RootNamespace>
|
||||
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='net46'">true</IsPartialFacadeAssembly>
|
||||
<IsTargetingNetFx Condition="'$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='net46'">true</IsTargetingNetFx>
|
||||
<IsTargetingNetCoreApp Condition="'$(TargetGroup)'=='netcoreapp' OR '$(TargetGroup)'=='uap' OR '$(TargetGroup)'=='uapaot'">true</IsTargetingNetCoreApp>
|
||||
<IsPartialFacadeAssembly Condition="'$(IsTargetingNetFx)'=='true' OR '$(IsTargetingNetCoreApp)'=='true'">true</IsPartialFacadeAssembly>
|
||||
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.0'">netstandard1.0;portable-net45+win8+wp8+wpa81</PackageTargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
@@ -21,37 +25,49 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard1.0-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
|
||||
<!-- Shared -->
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Common\src\System\Numerics\Hashing\HashHelpers.cs">
|
||||
<Compile Include="$(CommonPath)\System\Numerics\Hashing\HashHelpers.cs">
|
||||
<Link>Common\System\Numerics\Hashing\HashHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="System\Numerics\ConstantHelper.cs">
|
||||
<Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\IntrinsicAttribute.cs">
|
||||
<Link>System\Runtime\CompilerServices\IntrinsicAttribute.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- On .NET Core, Vector<T> is in System.Private.CoreLib -->
|
||||
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' != 'true'">
|
||||
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\ConstantHelper.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>ConstantHelper.tt</DependentUpon>
|
||||
<Link>System\Numerics\ConstantHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="System\Numerics\JitIntrinsicAttribute.cs" />
|
||||
<Compile Include="System\Numerics\Register.cs">
|
||||
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\Register.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Register.tt</DependentUpon>
|
||||
<Link>System\Numerics\Register.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="System\Numerics\Vector.cs">
|
||||
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\Vector.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Vector.tt</DependentUpon>
|
||||
<Link>System\Numerics\Vector.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\Vector_Operations.cs">
|
||||
<Link>System\Numerics\Vector_Operations.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="System\Numerics\Vector_Operations.cs" />
|
||||
</ItemGroup>
|
||||
<!-- Carry a copy of MathF where not available -->
|
||||
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true' OR $(TargetGroup.StartsWith('netstandard'))">
|
||||
<Compile Include="..\..\Common\src\System\MathF.netstandard.cs">
|
||||
<ItemGroup Condition="'$(IsTargetingNetFx)' == 'true' OR $(TargetGroup.StartsWith('netstandard'))">
|
||||
<Compile Include="$(CommonPath)\System\MathF.netstandard.cs">
|
||||
<Link>System\MathF.netstandard.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- Portable version only -->
|
||||
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
|
||||
<ItemGroup Condition="'$(IsTargetingNetFx)' != 'true'">
|
||||
<Compile Include="System\Numerics\Matrix3x2.cs" />
|
||||
<Compile Include="System\Numerics\Matrix4x4.cs" />
|
||||
<Compile Include="System\Numerics\Plane.cs" />
|
||||
@@ -63,24 +79,34 @@
|
||||
<Compile Include="System\Numerics\Vector4.cs" />
|
||||
<Compile Include="System\Numerics\Vector4_Intrinsics.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true'">
|
||||
<ItemGroup Condition="'$(IsTargetingNetFx)' == 'true'">
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System.Numerics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="System\Numerics\GenerationConfig.ttinclude" />
|
||||
<Content Include="System\Numerics\ConstantHelper.tt">
|
||||
<None Include="$(CommonPath)\CoreLib\System\Numerics\GenerationConfig.ttinclude">
|
||||
<Link>System\Numerics\GenerationConfig.ttinclude</Link>
|
||||
</None>
|
||||
<Content Include="$(CommonPath)\CoreLib\System\Numerics\ConstantHelper.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>ConstantHelper.cs</LastGenOutput>
|
||||
<Link>System\Numerics\ConstantHelper.tt</Link>
|
||||
</Content>
|
||||
<Content Include="System\Numerics\Register.tt">
|
||||
<Content Include="$(CommonPath)\CoreLib\System\Numerics\Register.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>Register.cs</LastGenOutput>
|
||||
<Link>System\Numerics\Register.tt</Link>
|
||||
</Content>
|
||||
<Content Include="System\Numerics\Vector.tt">
|
||||
<Content Include="$(CommonPath)\CoreLib\System\Numerics\Vector.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>Vector.cs</LastGenOutput>
|
||||
<Link>System\Numerics\Vector.tt</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' == 'true'">
|
||||
<ReferenceFromRuntime Include="System.Private.CoreLib" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' != 'true'">
|
||||
<Reference Include="System.Diagnostics.Tools" />
|
||||
<Reference Include="System.Globalization" />
|
||||
<Reference Include="System.Resources.ResourceManager" />
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
internal class ConstantHelper
|
||||
{
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Byte GetByteWithAllBitsSet()
|
||||
{
|
||||
Byte value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Byte*)&value) = (Byte)0xff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static SByte GetSByteWithAllBitsSet()
|
||||
{
|
||||
SByte value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((SByte*)&value) = (SByte)0xff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt16 GetUInt16WithAllBitsSet()
|
||||
{
|
||||
UInt16 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt16*)&value) = (UInt16)0xffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int16 GetInt16WithAllBitsSet()
|
||||
{
|
||||
Int16 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int16*)&value) = (Int16)0xffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt32 GetUInt32WithAllBitsSet()
|
||||
{
|
||||
UInt32 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt32*)&value) = (UInt32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int32 GetInt32WithAllBitsSet()
|
||||
{
|
||||
Int32 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int32*)&value) = (Int32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt64 GetUInt64WithAllBitsSet()
|
||||
{
|
||||
UInt64 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt64*)&value) = (UInt64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int64 GetInt64WithAllBitsSet()
|
||||
{
|
||||
Int64 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int64*)&value) = (Int64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Single GetSingleWithAllBitsSet()
|
||||
{
|
||||
Single value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int32*)&value) = (Int32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Double GetDoubleWithAllBitsSet()
|
||||
{
|
||||
Double value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int64*)&value) = (Int64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<#@ template debug="true" hostSpecific="true" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ Assembly Name="System.Core.dll" #>
|
||||
<#@ Assembly Name="System.Xml.dll" #>
|
||||
<#@ Assembly Name="System.Xml.Linq.dll" #>
|
||||
<#@ Assembly Name="System.Windows.Forms.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Diagnostics" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Xml.Linq" #>
|
||||
<#@ import namespace="System.Collections" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.Runtime.InteropServices" #>
|
||||
<#@ include file="GenerationConfig.ttinclude" #><# GenerateCopyrightHeader(); #>
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
internal class ConstantHelper
|
||||
{
|
||||
<# foreach (var type in supportedTypes)
|
||||
{
|
||||
string hexValue = "0x" + new string('f', Marshal.SizeOf(type) * 2);
|
||||
#>
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static <#= type.Name #> Get<#= type.Name #>WithAllBitsSet()
|
||||
{
|
||||
<#= type.Name #> value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((<#= GetIntegralEquivalent(type).Name #>*)&value) = (<#=GetIntegralEquivalent(type).Name#>)<#= hexValue #>;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
}<#+
|
||||
public Type GetIntegralEquivalent(Type type)
|
||||
{
|
||||
if (type == typeof(Single))
|
||||
{
|
||||
return typeof(Int32);
|
||||
}
|
||||
else if (type == typeof(double))
|
||||
{
|
||||
return typeof(Int64);
|
||||
}
|
||||
else
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
#>
|
||||
@@ -1,147 +0,0 @@
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#+
|
||||
/* This file includes static data used as compilation configuration for the rest of the code generation.
|
||||
It is shared here to ensure that all generated code compiles with the same constants and configurations. */
|
||||
|
||||
// The set of supported numeric types to compile
|
||||
public static Type[] supportedTypes = new[]
|
||||
{
|
||||
typeof(Byte), typeof(SByte), typeof(UInt16), typeof(Int16),
|
||||
typeof(UInt32), typeof(Int32), typeof(UInt64), typeof(Int64),
|
||||
typeof(Single), typeof(Double)
|
||||
};
|
||||
|
||||
// The set of unsigned types, a subset of the above. Used for excluding from certain methods, i.e. Abs and Negate
|
||||
public static Type[] unsignedTypes = new[]
|
||||
{
|
||||
typeof(Byte), typeof(UInt16), typeof(UInt32), typeof(UInt64)
|
||||
};
|
||||
|
||||
public static Type[] integralTypes = new[]
|
||||
{
|
||||
typeof(Byte), typeof(SByte), typeof(UInt16), typeof(Int16),
|
||||
typeof(UInt32), typeof(Int32), typeof(UInt64), typeof(Int64)
|
||||
};
|
||||
|
||||
public static Type[] nonClsCompliantTypes = new[]
|
||||
{
|
||||
typeof(SByte), typeof(UInt16),
|
||||
typeof(UInt32), typeof(UInt64)
|
||||
};
|
||||
|
||||
// The total register size, in bytes. 16 for SSE2, 32 for AVX, 64 for AVX512
|
||||
public static int totalSize = 16;
|
||||
|
||||
/* General template helper procedures */
|
||||
|
||||
// Returns the constructed register field name for the given type and index.
|
||||
public string GetRegisterFieldName(Type t, int index)
|
||||
{
|
||||
return "register." + t.Name.ToLowerInvariant() + "_" + index;
|
||||
}
|
||||
|
||||
// Returns the number of fields for a given type, based on the current configuration's register size
|
||||
public int GetNumFields(Type t, int totalSize)
|
||||
{
|
||||
return totalSize / Marshal.SizeOf(t);
|
||||
}
|
||||
|
||||
public static HashSet<Type> WidenableTypes { get; private set; } = new HashSet<Type>()
|
||||
{
|
||||
typeof(byte),
|
||||
typeof(ushort),
|
||||
typeof(uint),
|
||||
typeof(sbyte),
|
||||
typeof(short),
|
||||
typeof(int),
|
||||
typeof(float),
|
||||
};
|
||||
|
||||
private static Dictionary<Type, Type> s_widenTargets = new Dictionary<Type, Type>()
|
||||
{
|
||||
{ typeof(byte), typeof(ushort) },
|
||||
{ typeof(ushort), typeof(uint) },
|
||||
{ typeof(uint), typeof(ulong) },
|
||||
{ typeof(sbyte), typeof(short) },
|
||||
{ typeof(short), typeof(int) },
|
||||
{ typeof(int), typeof(long) },
|
||||
{ typeof(float), typeof(double) },
|
||||
};
|
||||
|
||||
public Type GetWidenTarget(Type t)
|
||||
{
|
||||
Type target;
|
||||
if (!s_widenTargets.TryGetValue(t, out target))
|
||||
{
|
||||
throw new InvalidOperationException("No widen target for " + t.Name);
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
public static HashSet<Type> NarrowableTypes { get; private set; } = new HashSet<Type>()
|
||||
{
|
||||
typeof(ushort),
|
||||
typeof(uint),
|
||||
typeof(ulong),
|
||||
typeof(short),
|
||||
typeof(int),
|
||||
typeof(long),
|
||||
typeof(double),
|
||||
};
|
||||
|
||||
private static Dictionary<Type, Type> s_narrowTargets = new Dictionary<Type, Type>()
|
||||
{
|
||||
{ typeof(ulong), typeof(uint) },
|
||||
{ typeof(uint), typeof(ushort) },
|
||||
{ typeof(ushort), typeof(byte) },
|
||||
{ typeof(long), typeof(int) },
|
||||
{ typeof(int), typeof(short) },
|
||||
{ typeof(short), typeof(sbyte) },
|
||||
{ typeof(double), typeof(float) },
|
||||
};
|
||||
|
||||
public Type GetNarrowTarget(Type t)
|
||||
{
|
||||
Type target;
|
||||
if (!s_narrowTargets.TryGetValue(t, out target))
|
||||
{
|
||||
throw new InvalidOperationException("No narrow target for " + t.Name);
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
public static List<KeyValuePair<Type, Type>> SameSizeConversionPairs = new List<KeyValuePair<Type, Type>>()
|
||||
{
|
||||
new KeyValuePair<Type, Type>(typeof(int), typeof(float)),
|
||||
new KeyValuePair<Type, Type>(typeof(uint), typeof(float)),
|
||||
new KeyValuePair<Type, Type>(typeof(long), typeof(double)),
|
||||
new KeyValuePair<Type, Type>(typeof(ulong), typeof(double)),
|
||||
new KeyValuePair<Type, Type>(typeof(float), typeof(int)),
|
||||
new KeyValuePair<Type, Type>(typeof(float), typeof(uint)),
|
||||
new KeyValuePair<Type, Type>(typeof(double), typeof(long)),
|
||||
new KeyValuePair<Type, Type>(typeof(double), typeof(ulong)),
|
||||
};
|
||||
|
||||
public void GenerateCopyrightHeader()
|
||||
{
|
||||
#>// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
<#+
|
||||
}
|
||||
|
||||
public string GenerateIfStatementHeader(Type type)
|
||||
{
|
||||
string keyword = (type == supportedTypes[0]) ? "if" : "else if";
|
||||
return string.Format("{0} (typeof(T) == typeof({1}))", keyword, type.Name);
|
||||
}
|
||||
|
||||
public string GenerateIfStatementHeader(Type type, IEnumerable<Type> allTypes)
|
||||
{
|
||||
string keyword = (type == allTypes.ToArray()[0]) ? "if" : "else if";
|
||||
return string.Format("{0} (typeof(T) == typeof({1}))", keyword, type.Name);
|
||||
}
|
||||
#>
|
||||
@@ -1,14 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
/// <summary>
|
||||
/// An attribute that can be attached to JIT Intrinsic methods/properties
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
|
||||
internal class JitIntrinsicAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
/// <summary>
|
||||
/// A structure describing the layout of an SSE2-sized register.
|
||||
/// Contains overlapping fields representing the set of valid numeric types.
|
||||
/// Allows the generic Vector'T struct to contain an explicit field layout.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Register
|
||||
{
|
||||
#region Internal Storage Fields
|
||||
// Internal System.Byte Fields
|
||||
[FieldOffset(0)]
|
||||
internal Byte byte_0;
|
||||
[FieldOffset(1)]
|
||||
internal Byte byte_1;
|
||||
[FieldOffset(2)]
|
||||
internal Byte byte_2;
|
||||
[FieldOffset(3)]
|
||||
internal Byte byte_3;
|
||||
[FieldOffset(4)]
|
||||
internal Byte byte_4;
|
||||
[FieldOffset(5)]
|
||||
internal Byte byte_5;
|
||||
[FieldOffset(6)]
|
||||
internal Byte byte_6;
|
||||
[FieldOffset(7)]
|
||||
internal Byte byte_7;
|
||||
[FieldOffset(8)]
|
||||
internal Byte byte_8;
|
||||
[FieldOffset(9)]
|
||||
internal Byte byte_9;
|
||||
[FieldOffset(10)]
|
||||
internal Byte byte_10;
|
||||
[FieldOffset(11)]
|
||||
internal Byte byte_11;
|
||||
[FieldOffset(12)]
|
||||
internal Byte byte_12;
|
||||
[FieldOffset(13)]
|
||||
internal Byte byte_13;
|
||||
[FieldOffset(14)]
|
||||
internal Byte byte_14;
|
||||
[FieldOffset(15)]
|
||||
internal Byte byte_15;
|
||||
|
||||
// Internal System.SByte Fields
|
||||
[FieldOffset(0)]
|
||||
internal SByte sbyte_0;
|
||||
[FieldOffset(1)]
|
||||
internal SByte sbyte_1;
|
||||
[FieldOffset(2)]
|
||||
internal SByte sbyte_2;
|
||||
[FieldOffset(3)]
|
||||
internal SByte sbyte_3;
|
||||
[FieldOffset(4)]
|
||||
internal SByte sbyte_4;
|
||||
[FieldOffset(5)]
|
||||
internal SByte sbyte_5;
|
||||
[FieldOffset(6)]
|
||||
internal SByte sbyte_6;
|
||||
[FieldOffset(7)]
|
||||
internal SByte sbyte_7;
|
||||
[FieldOffset(8)]
|
||||
internal SByte sbyte_8;
|
||||
[FieldOffset(9)]
|
||||
internal SByte sbyte_9;
|
||||
[FieldOffset(10)]
|
||||
internal SByte sbyte_10;
|
||||
[FieldOffset(11)]
|
||||
internal SByte sbyte_11;
|
||||
[FieldOffset(12)]
|
||||
internal SByte sbyte_12;
|
||||
[FieldOffset(13)]
|
||||
internal SByte sbyte_13;
|
||||
[FieldOffset(14)]
|
||||
internal SByte sbyte_14;
|
||||
[FieldOffset(15)]
|
||||
internal SByte sbyte_15;
|
||||
|
||||
// Internal System.UInt16 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt16 uint16_0;
|
||||
[FieldOffset(2)]
|
||||
internal UInt16 uint16_1;
|
||||
[FieldOffset(4)]
|
||||
internal UInt16 uint16_2;
|
||||
[FieldOffset(6)]
|
||||
internal UInt16 uint16_3;
|
||||
[FieldOffset(8)]
|
||||
internal UInt16 uint16_4;
|
||||
[FieldOffset(10)]
|
||||
internal UInt16 uint16_5;
|
||||
[FieldOffset(12)]
|
||||
internal UInt16 uint16_6;
|
||||
[FieldOffset(14)]
|
||||
internal UInt16 uint16_7;
|
||||
|
||||
// Internal System.Int16 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int16 int16_0;
|
||||
[FieldOffset(2)]
|
||||
internal Int16 int16_1;
|
||||
[FieldOffset(4)]
|
||||
internal Int16 int16_2;
|
||||
[FieldOffset(6)]
|
||||
internal Int16 int16_3;
|
||||
[FieldOffset(8)]
|
||||
internal Int16 int16_4;
|
||||
[FieldOffset(10)]
|
||||
internal Int16 int16_5;
|
||||
[FieldOffset(12)]
|
||||
internal Int16 int16_6;
|
||||
[FieldOffset(14)]
|
||||
internal Int16 int16_7;
|
||||
|
||||
// Internal System.UInt32 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt32 uint32_0;
|
||||
[FieldOffset(4)]
|
||||
internal UInt32 uint32_1;
|
||||
[FieldOffset(8)]
|
||||
internal UInt32 uint32_2;
|
||||
[FieldOffset(12)]
|
||||
internal UInt32 uint32_3;
|
||||
|
||||
// Internal System.Int32 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int32 int32_0;
|
||||
[FieldOffset(4)]
|
||||
internal Int32 int32_1;
|
||||
[FieldOffset(8)]
|
||||
internal Int32 int32_2;
|
||||
[FieldOffset(12)]
|
||||
internal Int32 int32_3;
|
||||
|
||||
// Internal System.UInt64 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt64 uint64_0;
|
||||
[FieldOffset(8)]
|
||||
internal UInt64 uint64_1;
|
||||
|
||||
// Internal System.Int64 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int64 int64_0;
|
||||
[FieldOffset(8)]
|
||||
internal Int64 int64_1;
|
||||
|
||||
// Internal System.Single Fields
|
||||
[FieldOffset(0)]
|
||||
internal Single single_0;
|
||||
[FieldOffset(4)]
|
||||
internal Single single_1;
|
||||
[FieldOffset(8)]
|
||||
internal Single single_2;
|
||||
[FieldOffset(12)]
|
||||
internal Single single_3;
|
||||
|
||||
// Internal System.Double Fields
|
||||
[FieldOffset(0)]
|
||||
internal Double double_0;
|
||||
[FieldOffset(8)]
|
||||
internal Double double_1;
|
||||
|
||||
#endregion Internal Storage Fields
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<#@ template debug="true" hostSpecific="true" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ Assembly Name="System.Core.dll" #>
|
||||
<#@ Assembly Name="System.Xml.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Runtime.InteropServices" #>
|
||||
<#@ import namespace="System.Diagnostics" #>
|
||||
<#@ include file="GenerationConfig.ttinclude" #><# GenerateCopyrightHeader(); #>
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
/// <summary>
|
||||
/// A structure describing the layout of an SSE2-sized register.
|
||||
/// Contains overlapping fields representing the set of valid numeric types.
|
||||
/// Allows the generic Vector'T struct to contain an explicit field layout.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Register
|
||||
{
|
||||
#region Internal Storage Fields
|
||||
<#
|
||||
foreach (var type in supportedTypes)
|
||||
{
|
||||
Debug.Assert(
|
||||
totalSize % Marshal.SizeOf(type) == 0,
|
||||
"The size of supported structs must be a factor of the supported register size.");
|
||||
#>
|
||||
// Internal <#= type.FullName #> Fields
|
||||
<#
|
||||
for (int g = 0; g < totalSize / Marshal.SizeOf(type); g++)
|
||||
{
|
||||
#>
|
||||
[FieldOffset(<#=Marshal.SizeOf(type) * g#>)]
|
||||
internal <#=type.Name#> <#= type.Name.ToLowerInvariant() + "_" + g #>;
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
<#
|
||||
}
|
||||
#> #endregion Internal Storage Fields
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
9e4eb703aaceb3c7a02e8fb8d863320bf33bca56
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@ namespace System.Numerics
|
||||
/// Constructs a vector whose elements are all the single specified value.
|
||||
/// </summary>
|
||||
/// <param name="value">The element to fill the vector with.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector2(Single value) : this(value, value) { }
|
||||
|
||||
/// <summary>
|
||||
@@ -35,7 +35,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="x">The X component.</param>
|
||||
/// <param name="y">The Y component.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector2(Single x, Single y)
|
||||
{
|
||||
X = x;
|
||||
@@ -86,7 +86,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="other">The Vector2 to compare this instance to.</param>
|
||||
/// <returns>True if the other Vector2 is equal to this instance; False otherwise.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public bool Equals(Vector2 other)
|
||||
{
|
||||
return this.X == other.X && this.Y == other.Y;
|
||||
@@ -100,7 +100,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first vector.</param>
|
||||
/// <param name="value2">The second vector.</param>
|
||||
/// <returns>The dot product.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Dot(Vector2 value1, Vector2 value2)
|
||||
{
|
||||
@@ -114,7 +114,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector.</param>
|
||||
/// <param name="value2">The second source vector.</param>
|
||||
/// <returns>The minimized vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 Min(Vector2 value1, Vector2 value2)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector</param>
|
||||
/// <param name="value2">The second source vector</param>
|
||||
/// <returns>The maximized vector</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 Max(Vector2 value1, Vector2 value2)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The absolute value vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 Abs(Vector2 value)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The square root vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 SquareRoot(Vector2 value)
|
||||
{
|
||||
@@ -170,7 +170,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The summed vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator +(Vector2 left, Vector2 right)
|
||||
{
|
||||
@@ -183,7 +183,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The difference vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator -(Vector2 left, Vector2 right)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The product vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator *(Vector2 left, Vector2 right)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The scalar value.</param>
|
||||
/// <param name="right">The source vector.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator *(Single left, Vector2 right)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The source vector.</param>
|
||||
/// <param name="right">The scalar value.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator *(Vector2 left, Single right)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The vector resulting from the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator /(Vector2 left, Vector2 right)
|
||||
{
|
||||
@@ -248,14 +248,10 @@ namespace System.Numerics
|
||||
/// <param name="value1">The source vector.</param>
|
||||
/// <param name="value2">The scalar value.</param>
|
||||
/// <returns>The result of the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector2 operator /(Vector2 value1, float value2)
|
||||
{
|
||||
float invDiv = 1.0f / value2;
|
||||
return new Vector2(
|
||||
value1.X * invDiv,
|
||||
value1.Y * invDiv);
|
||||
return value1 / new Vector2(value2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace System.Numerics
|
||||
/// Constructs a vector whose elements are all the single specified value.
|
||||
/// </summary>
|
||||
/// <param name="value">The element to fill the vector with.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector3(Single value) : this(value, value, value) { }
|
||||
|
||||
/// <summary>
|
||||
@@ -48,7 +48,7 @@ namespace System.Numerics
|
||||
/// <param name="x">The X component.</param>
|
||||
/// <param name="y">The Y component.</param>
|
||||
/// <param name="z">The Z component.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector3(Single x, Single y, Single z)
|
||||
{
|
||||
X = x;
|
||||
@@ -74,7 +74,7 @@ namespace System.Numerics
|
||||
/// <exception cref="RankException">If array is multidimensional.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">If index is greater than end of the array or index is less than zero.</exception>
|
||||
/// <exception cref="ArgumentException">If number of elements in source vector is greater than those available in destination array.</exception>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CopyTo(Single[] array, int index)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="other">The Vector3 to compare this instance to.</param>
|
||||
/// <returns>True if the other Vector3 is equal to this instance; False otherwise.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public bool Equals(Vector3 other)
|
||||
{
|
||||
return X == other.X &&
|
||||
@@ -117,7 +117,7 @@ namespace System.Numerics
|
||||
/// <param name="vector1">The first vector.</param>
|
||||
/// <param name="vector2">The second vector.</param>
|
||||
/// <returns>The dot product.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Dot(Vector3 vector1, Vector3 vector2)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector.</param>
|
||||
/// <param name="value2">The second source vector.</param>
|
||||
/// <returns>The minimized vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public static Vector3 Min(Vector3 value1, Vector3 value2)
|
||||
{
|
||||
return new Vector3(
|
||||
@@ -147,7 +147,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector.</param>
|
||||
/// <param name="value2">The second source vector.</param>
|
||||
/// <returns>The maximized vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 Max(Vector3 value1, Vector3 value2)
|
||||
{
|
||||
@@ -162,7 +162,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The absolute value vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 Abs(Vector3 value)
|
||||
{
|
||||
@@ -174,7 +174,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The square root vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 SquareRoot(Vector3 value)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The summed vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator +(Vector3 left, Vector3 right)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The difference vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator -(Vector3 left, Vector3 right)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The product vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator *(Vector3 left, Vector3 right)
|
||||
{
|
||||
@@ -228,7 +228,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The source vector.</param>
|
||||
/// <param name="right">The scalar value.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator *(Vector3 left, Single right)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The scalar value.</param>
|
||||
/// <param name="right">The source vector.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator *(Single left, Vector3 right)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The vector resulting from the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator /(Vector3 left, Vector3 right)
|
||||
{
|
||||
@@ -267,16 +267,10 @@ namespace System.Numerics
|
||||
/// <param name="value1">The source vector.</param>
|
||||
/// <param name="value2">The scalar value.</param>
|
||||
/// <returns>The result of the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector3 operator /(Vector3 value1, float value2)
|
||||
{
|
||||
float invDiv = 1.0f / value2;
|
||||
|
||||
return new Vector3(
|
||||
value1.X * invDiv,
|
||||
value1.Y * invDiv,
|
||||
value1.Z * invDiv);
|
||||
return value1 / new Vector3(value2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -296,7 +290,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first vector to compare.</param>
|
||||
/// <param name="right">The second vector to compare.</param>
|
||||
/// <returns>True if the vectors are equal; False otherwise.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Vector3 left, Vector3 right)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace System.Numerics
|
||||
/// Constructs a vector whose elements are all the single specified value.
|
||||
/// </summary>
|
||||
/// <param name="value">The element to fill the vector with.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector4(Single value)
|
||||
: this(value, value, value, value)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ namespace System.Numerics
|
||||
/// <param name="x">X component.</param>
|
||||
/// <param name="y">Y component.</param>
|
||||
/// <param name="z">Z component.</param>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public Vector4(Single x, Single y, Single z, Single w)
|
||||
{
|
||||
W = w;
|
||||
@@ -102,7 +102,7 @@ namespace System.Numerics
|
||||
/// <exception cref="RankException">If array is multidimensional.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">If index is greater than end of the array or index is less than zero.</exception>
|
||||
/// <exception cref="ArgumentException">If number of elements in source vector is greater than those available in destination array.</exception>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CopyTo(Single[] array, int index)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="other">The Vector4 to compare this instance to.</param>
|
||||
/// <returns>True if the other Vector4 is equal to this instance; False otherwise.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
public bool Equals(Vector4 other)
|
||||
{
|
||||
return this.X == other.X
|
||||
@@ -147,7 +147,7 @@ namespace System.Numerics
|
||||
/// <param name="vector1">The first vector.</param>
|
||||
/// <param name="vector2">The second vector.</param>
|
||||
/// <returns>The dot product.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Dot(Vector4 vector1, Vector4 vector2)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector.</param>
|
||||
/// <param name="value2">The second source vector.</param>
|
||||
/// <returns>The minimized vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 Min(Vector4 value1, Vector4 value2)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ namespace System.Numerics
|
||||
/// <param name="value1">The first source vector.</param>
|
||||
/// <param name="value2">The second source vector.</param>
|
||||
/// <returns>The maximized vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 Max(Vector4 value1, Vector4 value2)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The absolute value vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 Abs(Vector4 value)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ namespace System.Numerics
|
||||
/// </summary>
|
||||
/// <param name="value">The source vector.</param>
|
||||
/// <returns>The square root vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 SquareRoot(Vector4 value)
|
||||
{
|
||||
@@ -223,7 +223,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The summed vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator +(Vector4 left, Vector4 right)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The difference vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator -(Vector4 left, Vector4 right)
|
||||
{
|
||||
@@ -249,7 +249,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The product vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator *(Vector4 left, Vector4 right)
|
||||
{
|
||||
@@ -262,7 +262,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The source vector.</param>
|
||||
/// <param name="right">The scalar value.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator *(Vector4 left, Single right)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The scalar value.</param>
|
||||
/// <param name="right">The source vector.</param>
|
||||
/// <returns>The scaled vector.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator *(Single left, Vector4 right)
|
||||
{
|
||||
@@ -288,7 +288,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first source vector.</param>
|
||||
/// <param name="right">The second source vector.</param>
|
||||
/// <returns>The vector resulting from the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator /(Vector4 left, Vector4 right)
|
||||
{
|
||||
@@ -301,17 +301,10 @@ namespace System.Numerics
|
||||
/// <param name="value1">The source vector.</param>
|
||||
/// <param name="value2">The scalar value.</param>
|
||||
/// <returns>The result of the division.</returns>
|
||||
[JitIntrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Vector4 operator /(Vector4 value1, float value2)
|
||||
{
|
||||
float invDiv = 1.0f / value2;
|
||||
|
||||
return new Vector4(
|
||||
value1.X * invDiv,
|
||||
value1.Y * invDiv,
|
||||
value1.Z * invDiv,
|
||||
value1.W * invDiv);
|
||||
return value1 / new Vector4(value2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -331,7 +324,7 @@ namespace System.Numerics
|
||||
/// <param name="left">The first vector to compare.</param>
|
||||
/// <param name="right">The second vector to compare.</param>
|
||||
/// <returns>True if the vectors are equal; False otherwise.</returns>
|
||||
[JitIntrinsic]
|
||||
[Intrinsic]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(Vector4 left, Vector4 right)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user