This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add support for ckfinite * Using existing OverflowException helper.
- Loading branch information
Showing
6 changed files
with
181 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// 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. | ||
|
||
.assembly extern mscorlib | ||
{ | ||
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) | ||
.ver 4:0:0:0 | ||
} | ||
|
||
.assembly CkFinite { } | ||
|
||
.class public abstract sealed CkFinite.CkFiniteTest { | ||
|
||
.method public static bool CkFinite32(float32) { | ||
.maxstack 5 | ||
try_start: | ||
ldarg 0 | ||
ckfinite | ||
pop //remove the value from the stack | ||
leave try_end | ||
try_end: | ||
ldc.i4 0x00000001 | ||
ret | ||
handler_start: | ||
pop //remove the exception ref from the stack | ||
leave done | ||
handler_end: | ||
done: | ||
ldc.i4 0x00000000 | ||
ret | ||
.try try_start to try_end catch [mscorlib]System.OverflowException handler handler_start to handler_end | ||
} | ||
|
||
.method public static bool CkFinite64(float64) { | ||
.maxstack 5 | ||
try_start: | ||
ldarg 0 | ||
ckfinite | ||
pop //remove the value from the stack | ||
leave try_end | ||
try_end: | ||
ldc.i4 0x00000001 | ||
ret | ||
handler_start: | ||
pop //remove the exception ref from the stack | ||
leave done | ||
handler_end: | ||
done: | ||
ldc.i4 0x00000000 | ||
ret | ||
.try try_start to try_end catch [mscorlib]System.OverflowException handler handler_start to handler_end | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<OutputType>Library</OutputType> | ||
<DebugType>portable</DebugType> | ||
<OutputPath>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(Platform)\</OutputPath> | ||
<IntermediateOutputPath>$(MSBuildProjectDirectory)\obj\$(Configuration)\$(Platform)\</IntermediateOutputPath> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||
|
||
<ItemGroup> | ||
<Compile Include="CkFinite.il" /> | ||
<PackageReference Include="Microsoft.NETCore.App"> | ||
<Version>$(MicrosoftNETCoreAppPackageVersion)</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters