This repository was archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 503
Wasm: implement ckfinite #8097
Merged
Merged
Wasm: implement ckfinite #8097
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here - this can be a helper method in
MathHelpers.