Skip to content

Updating the x64 casting behavior to be IEEE 754 compliant and to use saturation for overflow - #61761

Closed
tannergooding wants to merge 6 commits into
dotnet:mainfrom
tannergooding:fp-casting
Closed

Updating the x64 casting behavior to be IEEE 754 compliant and to use saturation for overflow#61761
tannergooding wants to merge 6 commits into
dotnet:mainfrom
tannergooding:fp-casting

Conversation

@tannergooding

@tannergoodingtannergooding commented Nov 18, 2021

Copy link
Copy Markdown
Member

CC. @jkotas, @davidwrighton, @VSadov, @jeffhandley

This came up as part of #61649 and so I figured it might be time to finally fix this and making it IEEE 754 compliant, also making it inline with ARM64 (at least for inputs that have a well-defined result).

The integer to floating-point impl here is based on the Clang/LLVM codegen which is Apache 2.0 w/ LLVM Exception.
The floating-point to integer impl is based on the Rust codegen which is Apache 2.0 and MIT.

The floating-point to integer impl is matching the Rust behavior of saturating too large/too smal values and treating 0 as NaN: rust-lang/rust#10184

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 18, 2021
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

CC. @jkotas, @davidwrighton, @VSadov, @jeffhandley

This came up as part of #61649 and so I figured it might be time to finally fix this and making it IEEE 754 compliant, also making it inline with ARM64 (at least for inputs that have a well-defined result).

Leaving it in draft as I believe the CORINFO_HELP_* needs to be updated for x86 and I need to finish doing testing of some edge cases + adding additional validation tests here.

Author:tannergooding
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@tannergooding

Copy link
Copy Markdown
MemberAuthor

Codegen generally looks good/improved:

- mov rax, qword ptr [rdx]- vxorps xmm0, xmm0- vcvtsi2sd xmm0, rax- test rax, rax- jge SHORT G_M51675_IG03- vaddsd xmm0, qword ptr [reloc @RWD00]+ vmovd xmm0, qword ptr [rdx]+ vpunpckldq xmm0, xmm0, xmmword ptr [reloc @RWD00]+ vsubpd xmm0, xmm0, xmmword ptr [reloc @RWD16]+ vpshufd xmm1, xmm0, 78+ vaddsd xmm0, xmm0, xmm1

and

- vmovsd xmm0, qword ptr [rsi]- call CORINFO_HELP_DBL2ULNG+ vmovsd xmm0, qword ptr [rdx]+ vcvttsd2si rax, xmm0+ mov r8, rax+ sar r8, 63+ vsubsd xmm0, xmm0, qword ptr [reloc @RWD00]+ vcvttsd2si r9, xmm0+ and r8, r9+ or rax, r8

It looks like I need to adjust handling for u32_to_f32 as it looks to be emitting vcvtsi2ss xmm0, ecx where it should be vcvtsi2ss xmm0, rcx

@jkotas

Copy link
Copy Markdown
Member

This will need a breaking change notification that describes what exactly changed. I am supportive of the idea of getting the behavior standardized between platforms.

@jkotasjkotas added the breaking-change Issue or PR that represents a breaking API or functional change over a previous release. label Nov 18, 2021
@ghostghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Nov 18, 2021
@ghost

Copy link
Copy Markdown

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

Comment threadsrc/coreclr/vm/jithelpers.cpp Outdated
@tannergoodingtannergooding changed the title Updating the x64 casting behavior to be IEEE 754 compliant based on the Clang implUpdating the x64 casting behavior to be IEEE 754 compliant and to use saturation for overflowNov 20, 2021
@tannergooding

tannergooding commented Nov 20, 2021

Copy link
Copy Markdown
MemberAuthor

@jkotas, I've updated this to include the relevant helper APIs and tests to validate the saturating behavior.

Notably, the unchecked versions of Double -> UInt64 (and therefore Double -> UInt32) needs to be tweaked to account for saturation and so we'll see the following failures still:

Unchecked conversion for Double -> System.UInt32 failed; Input: ∞; Expected 4294967295; Actual 0
Unchecked conversion for Double -> System.UInt32 failed; Input: -1; Expected 0; Actual 4294967295
Unchecked conversion for Double -> System.UInt32 failed; Input: 4294967296; Expected 4294967295; Actual 0
Unchecked conversion for Double -> System.UInt32 failed; Input: -3.141592653589793; Expected 0; Actual 4294967293
Unchecked conversion for Double -> System.UInt64 failed; Input: -1; Expected 0; Actual 18446744073709551615
Unchecked conversion for Double -> System.UInt64 failed; Input: -3.141592653589793; Expected 0; Actual 18446744073709551613

Some diffs are as follows.

For double -> sbyte (basically the same for double -> short, double->byte, and double->ushort):

- vcvttss2si eax, xmm0+ vmovss xmm1, dword ptr [reloc @RWD00] ; for byte, ushort; this is vxorps xmm1, xmm1, xmm1+ vmaxss xmm1, xmm1, xmm0+ vmovss xmm2, dword ptr [reloc @RWD04]+ vminss xmm1, xmm2, xmm1+ vcvttss2si esi, xmm1+ cmp esi, 0xD1FFAB1E+ jne SHORT G_M31120_IG04+ G_M31120_IG03:+ vcvtss2sd xmm0, xmm0 ; Only for input type float+ call CORINFO_HELP_DoubleToInt8+ G_M31120_IG04:+ mov eax, esi+ G_M31120_IG05:
movsx rax, al

For double -> int (and basically the same for double -> long):

 vcvttss2si eax, xmm0
+ cmp eax, 0xD1FFAB1E+ jne SHORT G_M61232_IG04+ G_M61232_IG03:+ vcvtss2sd xmm0, xmm0 ; Only for input type float+ call CORINFO_HELP_DoubleToInt32+ jmp SHORT G_M61232_IG04 ; This seems to be a side-effect of the QMARK+ G_M61232_IG04:

@tannergooding

tannergooding commented Nov 20, 2021

Copy link
Copy Markdown
MemberAuthor

There are also some positive diffs around the overflow helpers for byte, sbyte, short, and ushort:

 vcvtss2sd xmm0, xmm0
+ call CORINFO_HELP_DoubleToInt8_OVF- call CORINFO_HELP_DBL2INT_OVF- cmp eax, 127- jg SHORT G_M39883_IG04- cmp eax, -128- jl SHORT G_M39883_IG04
; ...
- G_M39883_IG04:- call CORINFO_HELP_OVERFLOW- int3

Comment threadsrc/coreclr/jit/importer.cpp Outdated
Comment threadsrc/coreclr/jit/lowerarmarch.cpp Outdated
Comment threadsrc/coreclr/jit/lowerarmarch.cpp Outdated
Comment threadsrc/coreclr/jit/lowerxarch.cpp Outdated
Comment threadsrc/coreclr/jit/morph.cpp Outdated
Comment threadsrc/coreclr/vm/i386/jithelp.S Outdated
Comment threadsrc/coreclr/jit/gentree.cpp Outdated
@tannergooding

Copy link
Copy Markdown
MemberAuthor

x64 diffs are below. Improvements are places where small casts w/ overflow were converted into helper calls rather than being inline conversions, checks, and throwing the overflow exception.

x64 --frameworks --pmi
Found 359 files with textual diffs.
Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 61789802
Total bytes of diff: 61811355
Total bytes of delta: 21553 (0.03 % of base)
Total relative delta: 188.31
diff is a regression.
relative diff is a regression.
Top file regressions (bytes):
8760 : System.Private.CoreLib.dasm (0.16% of base)
1224 : Microsoft.CodeAnalysis.VisualBasic.dasm (0.02% of base)
1056 : System.Collections.Concurrent.dasm (0.27% of base)
872 : Microsoft.Diagnostics.Tracing.TraceEvent.dasm (0.02% of base)
716 : System.Private.Xml.dasm (0.02% of base)
715 : System.Data.Common.dasm (0.04% of base)
714 : System.Drawing.Common.dasm (0.17% of base)
667 : System.Drawing.Primitives.dasm (1.58% of base)
612 : System.Collections.dasm (0.11% of base)
529 : System.Text.RegularExpressions.dasm (0.07% of base)
513 : FSharp.Core.dasm (0.01% of base)
502 : System.Net.Http.dasm (0.06% of base)
433 : System.Speech.dasm (0.10% of base)
398 : Microsoft.CodeAnalysis.CSharp.dasm (0.01% of base)
343 : System.Linq.Expressions.dasm (0.04% of base)
333 : System.Text.Json.dasm (0.03% of base)
318 : Microsoft.CSharp.dasm (0.08% of base)
230 : System.Formats.Asn1.dasm (0.29% of base)
228 : System.Threading.Tasks.Dataflow.dasm (0.02% of base)
224 : ILCompiler.Reflection.ReadyToRun.dasm (0.11% of base)
Top file improvements (bytes):
-269 : Microsoft.VisualBasic.Core.dasm (-0.05% of base)
-102 : System.Net.WebSockets.dasm (-0.09% of base)
-23 : System.Net.Requests.dasm (-0.02% of base)
61 total files with Code Size differences (3 improved, 58 regressed), 211 unchanged.
Top method regressions (bytes):
398 ( 7.61% of base) : Microsoft.CodeAnalysis.CSharp.dasm - Binder:DoUncheckedConversion(byte,ConstantValue):Object
395 (80.78% of base) : System.Linq.Expressions.dasm - Unchecked:ConvertDouble(double):Object:this
360 (41.67% of base) : System.Private.CoreLib.dasm - Task`1:WaitAsync(TimeSpan,CancellationToken):Task`1:this (8 methods)
318 (29.94% of base) : Microsoft.CSharp.dasm - ExpressionBinder:bindConstantCast(Expr,CType,bool,byref,bool):int:this
312 (90.70% of base) : System.Private.CoreLib.dasm - List`1:TrimExcess():this (8 methods)
312 (90.70% of base) : System.Private.CoreLib.dasm - Queue`1:TrimExcess():this (8 methods)
312 (90.70% of base) : System.Collections.dasm - SortedList`2:TrimExcess():this (8 methods)
288 (32.14% of base) : System.Private.CoreLib.dasm - Task`1:WaitAsync(TimeSpan):Task`1:this (8 methods)
272 (280.41% of base) : System.Private.CoreLib.dasm - Vector:ConvertToUInt64(Vector`1):Vector`1
272 (438.71% of base) : System.Private.CoreLib.dasm - Vector128:ConvertToUInt32(Vector128`1):Vector128`1
272 (280.41% of base) : System.Private.CoreLib.dasm - Vector256:ConvertToUInt64(Vector256`1):Vector256`1
247 (36.81% of base) : System.Data.Common.dasm - SqlDecimal:.ctor(double):this
243 (42.56% of base) : FSharp.Core.dasm - groupByRefType@1071-1:Invoke(KeyValuePair`2):Unit:this (8 methods)
243 (42.56% of base) : FSharp.Core.dasm - groupByValueType@1068-1:Invoke(KeyValuePair`2):Unit:this (8 methods)
230 ( 5.17% of base) : System.Formats.Asn1.dasm - AsnDecoder:ParseGeneralizedTime(int,ReadOnlySpan`1):DateTimeOffset
224 ( 9.96% of base) : System.Collections.Concurrent.dasm - BlockingCollection`1:ValidateTimeout(TimeSpan) (8 methods)
224 ( 7.96% of base) : ILCompiler.Reflection.ReadyToRun.dasm - SignatureDecoder:ParseHelper(StringBuilder):this
208 (21.69% of base) : System.Collections.Concurrent.dasm - BlockingCollection`1:TryTake(byref,TimeSpan):bool:this (8 methods)
208 (22.39% of base) : System.Collections.Concurrent.dasm - BlockingCollection`1:TryTakeFromAny(ref,byref,TimeSpan):int (8 methods)
208 ( 6.13% of base) : System.Text.RegularExpressions.dasm - SymbolicRegexMatcher`1:FindMatch(bool,String,int,int):SymbolicMatch:this (8 methods)
Top method improvements (bytes):
-124 (-8.94% of base) : System.Net.WebSockets.dasm - <WaitForServerToCloseConnectionAsync>d__66:MoveNext():this
-88 (-13.71% of base) : System.Linq.Expressions.dasm - Checked:ConvertDouble(double):Object:this
-88 (-7.69% of base) : Microsoft.VisualBasic.Core.dasm - ShortType:FromObject(Object):short
-76 (-4.47% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToShort(Object):short
-71 (-5.00% of base) : System.Net.Requests.dasm - FtpWebRequest:GetResponse():WebResponse:this
-68 (-4.11% of base) : System.Net.Http.dasm - <DrainAsync>d__10:MoveNext():this
-65 (-4.11% of base) : System.Net.Http.dasm - <DrainAsync>d__17:MoveNext():this
-62 (-4.81% of base) : System.Private.CoreLib.dasm - <WaitUntilCountOrTimeoutAsync>d__31:MoveNext():this
-56 (-3.28% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToSByte(Object):byte
-44 (-4.09% of base) : Microsoft.VisualBasic.Core.dasm - ByteType:FromObject(Object):ubyte
-44 (-25.58% of base) : FSharp.Core.dasm - LanguagePrimitives:ExplicitDynamic(__Canon):Nullable`1
-36 (-2.17% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToByte(Object):ubyte
-36 (-2.20% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToUShort(Object):ushort
-30 (-15.15% of base) : System.Speech.dasm - RuleNode:Find(int,int):RuleNode:this
-24 (-1.81% of base) : Microsoft.VisualBasic.Core.dasm - Conversion:Val(String):double
-22 (-0.53% of base) : System.DirectoryServices.dasm - DirectorySearcher:SetSearchPreferences(IDirectorySearch,bool):this
-22 (-1.92% of base) : System.Drawing.Common.dasm - PrinterSettings:Get_PaperSizes():ref:this
-19 (-51.35% of base) : System.Private.CoreLib.dasm - Int16:System.INumber<System.Int16>.Create(double):short
-16 (-8.33% of base) : System.Private.CoreLib.dasm - Vector128:ConvertToSingle(Vector128`1):Vector128`1 (2 methods)
-15 (-45.45% of base) : System.Private.CoreLib.dasm - SByte:System.INumber<System.SByte>.Create(double):byte
Top method regressions (percentages):
51 (566.67% of base) : System.Private.CoreLib.dasm - Int16:System.INumber<System.Int16>.CreateTruncating(double):short
42 (466.67% of base) : System.Private.CoreLib.dasm - UInt32:System.INumber<System.UInt32>.CreateTruncating(double):int
272 (438.71% of base) : System.Private.CoreLib.dasm - Vector128:ConvertToUInt32(Vector128`1):Vector128`1
47 (427.27% of base) : System.Private.CoreLib.dasm - Byte:System.INumber<System.Byte>.CreateTruncating(double):ubyte
47 (427.27% of base) : System.Private.CoreLib.dasm - Char:System.INumber<System.Char>.CreateTruncating(double):ushort
47 (427.27% of base) : System.Private.CoreLib.dasm - UInt16:System.INumber<System.UInt16>.CreateTruncating(double):ushort
51 (425.00% of base) : System.Private.CoreLib.dasm - SByte:System.INumber<System.SByte>.CreateTruncating(double):byte
143 (397.22% of base) : System.Drawing.Primitives.dasm - Rectangle:Truncate(RectangleF):Rectangle
67 (372.22% of base) : System.Private.CoreLib.dasm - UInt64:System.INumber<System.UInt64>.CreateTruncating(double):long
67 (372.22% of base) : System.Private.CoreLib.dasm - UIntPtr:System.INumber<nuint>.CreateTruncating(double):long
30 (333.33% of base) : System.Private.CoreLib.dasm - Int64:System.INumber<System.Int64>.CreateTruncating(double):long
30 (333.33% of base) : System.Private.CoreLib.dasm - IntPtr:System.INumber<nint>.CreateTruncating(double):long
272 (280.41% of base) : System.Private.CoreLib.dasm - Vector:ConvertToUInt64(Vector`1):Vector`1
272 (280.41% of base) : System.Private.CoreLib.dasm - Vector256:ConvertToUInt64(Vector256`1):Vector256`1
67 (279.17% of base) : Microsoft.CodeAnalysis.VisualBasic.dasm - CompileTimeCalculations:UncheckedCULng(double):long
22 (275.00% of base) : System.Private.CoreLib.dasm - Int32:System.INumber<System.Int32>.CreateTruncating(double):int
52 (247.62% of base) : System.Private.CoreLib.dasm - TimeOnly:AddHours(double,byref):TimeOnly:this
52 (247.62% of base) : System.Private.CoreLib.dasm - TimeOnly:AddMinutes(double,byref):TimeOnly:this
55 (220.00% of base) : System.Private.CoreLib.dasm - Scalar`1:Sqrt(short):short
126 (217.24% of base) : System.Private.CoreLib.dasm - Vector128:ConvertToInt32(Vector128`1):Vector128`1
Top method improvements (percentages):
-19 (-51.35% of base) : System.Private.CoreLib.dasm - Int16:System.INumber<System.Int16>.Create(double):short
-15 (-45.45% of base) : System.Private.CoreLib.dasm - SByte:System.INumber<System.SByte>.Create(double):byte
-12 (-40.00% of base) : System.Private.CoreLib.dasm - Byte:System.INumber<System.Byte>.Create(double):ubyte
-12 (-40.00% of base) : System.Private.CoreLib.dasm - Char:System.INumber<System.Char>.Create(double):ushort
-12 (-40.00% of base) : System.Private.CoreLib.dasm - UInt16:System.INumber<System.UInt16>.Create(double):ushort
-44 (-25.58% of base) : FSharp.Core.dasm - LanguagePrimitives:ExplicitDynamic(__Canon):Nullable`1
-4 (-21.05% of base) : System.Private.CoreLib.dasm - UInt32:System.IConvertible.ToSingle(IFormatProvider):float:this
-6 (-19.35% of base) : System.Private.CoreLib.dasm - Convert:ToSingle(int):float (2 methods)
-30 (-15.15% of base) : System.Speech.dasm - RuleNode:Find(int,int):RuleNode:this
-88 (-13.71% of base) : System.Linq.Expressions.dasm - Checked:ConvertDouble(double):Object:this
-124 (-8.94% of base) : System.Net.WebSockets.dasm - <WaitForServerToCloseConnectionAsync>d__66:MoveNext():this
-16 (-8.33% of base) : System.Private.CoreLib.dasm - Vector128:ConvertToSingle(Vector128`1):Vector128`1 (2 methods)
-88 (-7.69% of base) : Microsoft.VisualBasic.Core.dasm - ShortType:FromObject(Object):short
-2 (-7.41% of base) : System.Private.CoreLib.dasm - Convert:ToDouble(int):double (2 methods)
-2 (-7.14% of base) : System.Private.CoreLib.dasm - <>c:<OnEventCommand>b__32_14():double:this
-71 (-5.00% of base) : System.Net.Requests.dasm - FtpWebRequest:GetResponse():WebResponse:this
-13 (-4.98% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToShort(String):short
-13 (-4.98% of base) : Microsoft.VisualBasic.Core.dasm - ShortType:FromString(String):short
-62 (-4.81% of base) : System.Private.CoreLib.dasm - <WaitUntilCountOrTimeoutAsync>d__31:MoveNext():this
-76 (-4.47% of base) : Microsoft.VisualBasic.Core.dasm - Conversions:ToShort(Object):short
474 total methods with Code Size differences (44 improved, 430 regressed), 279448 unchanged.
x64 --benchmarks --pmi
Found 117 files with textual diffs.
Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 496361
Total bytes of diff: 498625
Total bytes of delta: 2264 (0.46 % of base)
Total relative delta: 18.64
diff is a regression.
relative diff is a regression.
Top file regressions (bytes):
744 : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm (2.27% of base)
429 : Benchstones\BenchF\MatInv4\MatInv4\MatInv4.dasm (11.49% of base)
379 : SIMD\RayTracer\RayTracer\RayTracer.dasm (1.59% of base)
314 : Benchstones\BenchF\LLoops\LLoops\LLoops.dasm (2.06% of base)
143 : Benchstones\MDBenchF\MDLLoops\MDLLoops\MDLLoops.dasm (1.04% of base)
102 : Benchstones\BenchF\Whetsto\Whetsto\Whetsto.dasm (4.52% of base)
75 : SIMD\SeekUnroll\SeekUnroll\SeekUnroll.dasm (3.43% of base)
56 : Burgers\Burgers\Burgers.dasm (1.09% of base)
28 : Benchstones\BenchF\DMath\DMath\DMath.dasm (4.53% of base)
25 : Span\Indexer\Indexer.dasm (0.22% of base)
25 : Span\SpanBench\SpanBench.dasm (0.05% of base)
Top file improvements (bytes):
-56 : V8\Crypto\Crypto\Crypto.dasm (-0.14% of base)
12 total files with Code Size differences (1 improved, 11 regressed), 86 unchanged.
Top method regressions (bytes):
314 ( 3.64% of base) : Benchstones\BenchF\LLoops\LLoops\LLoops.dasm - LLoops:Main1(int):this
252 (18.54% of base) : Benchstones\BenchF\MatInv4\MatInv4\MatInv4.dasm - MatInv4:MinV2(ref,byref,byref,ref,ref)
177 (13.43% of base) : Benchstones\BenchF\MatInv4\MatInv4\MatInv4.dasm - MatInv4:MinV1(ref,byref,byref,ref,ref)
143 ( 1.34% of base) : Benchstones\MDBenchF\MDLLoops\MDLLoops\MDLLoops.dasm - MDLLoops:Main1(int):this
102 (147.83% of base) : Benchstones\BenchF\Whetsto\Whetsto\Whetsto.dasm - Whetsto:Escape(int,int,int,double,double,double,double)
92 (84.40% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Color:ToInt32():int:this
84 ( 3.85% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ConsoleMandel:Bench(int,int)
79 (15.31% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
77 (12.44% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,ParallelLoopState,float):float:this
69 (13.02% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:RenderSequential(Scene,ref):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass6_1:<RenderSingleThreadedWithADT>b__1(double,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass6_1:<RenderSingleThreadedWithADT>b__1(float,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass7_1:<RenderSingleThreadedNoADT>b__1(double,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass7_1:<RenderSingleThreadedNoADT>b__1(float,int):this
56 ( 2.75% of base) : Burgers\Burgers\Burgers.dasm - Burgers:Main():int
53 ( 3.43% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracerBench:RenderLoop(int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass4_1:<RenderMultiThreadedWithADT>b__2(double,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass4_1:<RenderMultiThreadedWithADT>b__2(float,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass5_1:<RenderMultiThreadedNoADT>b__2(double,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass5_1:<RenderMultiThreadedNoADT>b__2(float,int):this
Top method improvements (bytes):
-89 (-4.32% of base) : V8\Crypto\Crypto\Crypto.dasm - BigInteger:divRemTo(BigInteger,BigInteger,BigInteger):this
-24 (-3.20% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Camera:Create(Vector,Vector):Camera
-24 (-2.55% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:GetNaturalColor(SceneObject,Vector,Vector,Vector,Scene):Color:this
-8 (-2.86% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:GetPoint(double,double,Camera):Vector:this
-8 (-5.97% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Sphere:Normal(Vector):Vector:this
-8 (-7.27% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Vector:Norm(Vector):Vector
-5 (-2.14% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarDoubleRenderer:RenderMultiThreadedNoADT(float,float,float,float,float):this
-5 (-2.14% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarDoubleRenderer:RenderMultiThreadedWithADT(float,float,float,float,float):this
Top method regressions (percentages):
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass6_1:<RenderSingleThreadedWithADT>b__1(double,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass6_1:<RenderSingleThreadedWithADT>b__1(float,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass7_1:<RenderSingleThreadedNoADT>b__1(double,int):this
62 (167.57% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass7_1:<RenderSingleThreadedNoADT>b__1(float,int):this
102 (147.83% of base) : Benchstones\BenchF\Whetsto\Whetsto\Whetsto.dasm - Whetsto:Escape(int,int,int,double,double,double,double)
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass4_1:<RenderMultiThreadedWithADT>b__2(double,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass4_1:<RenderMultiThreadedWithADT>b__2(float,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass5_1:<RenderMultiThreadedNoADT>b__2(double,int):this
52 (140.54% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - <>c__DisplayClass5_1:<RenderMultiThreadedNoADT>b__2(float,int):this
51 (130.77% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Color:ToByte(float):ubyte
30 (103.45% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Color:ToInt32(float):int
92 (84.40% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Color:ToInt32():int:this
252 (18.54% of base) : Benchstones\BenchF\MatInv4\MatInv4\MatInv4.dasm - MatInv4:MinV2(ref,byref,byref,ref,ref)
79 (15.31% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
14 (14.74% of base) : V8\Crypto\Crypto\Crypto.dasm - BigInteger:chunkSize(int):int:this
177 (13.43% of base) : Benchstones\BenchF\MatInv4\MatInv4\MatInv4.dasm - MatInv4:MinV1(ref,byref,byref,ref,ref)
69 (13.02% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:RenderSequential(Scene,ref):this
77 (12.44% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,ParallelLoopState,float):float:this
23 (10.95% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarFloatRenderer:RenderMultiThreadedNoADT(float,float,float,float,float):this
23 (10.95% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarFloatRenderer:RenderMultiThreadedWithADT(float,float,float,float,float):this
Top method improvements (percentages):
-8 (-7.27% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Vector:Norm(Vector):Vector
-8 (-5.97% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Sphere:Normal(Vector):Vector:this
-89 (-4.32% of base) : V8\Crypto\Crypto\Crypto.dasm - BigInteger:divRemTo(BigInteger,BigInteger,BigInteger):this
-24 (-3.20% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - Camera:Create(Vector,Vector):Camera
-8 (-2.86% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:GetPoint(double,double,Camera):Vector:this
-24 (-2.55% of base) : SIMD\RayTracer\RayTracer\RayTracer.dasm - RayTracer:GetNaturalColor(SceneObject,Vector,Vector,Vector,Scene):Color:this
-5 (-2.14% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarDoubleRenderer:RenderMultiThreadedNoADT(float,float,float,float,float):this
-5 (-2.14% of base) : SIMD\ConsoleMandel\ConsoleMandel\ConsoleMandel.dasm - ScalarDoubleRenderer:RenderMultiThreadedWithADT(float,float,float,float,float):this
47 total methods with Code Size differences (8 improved, 39 regressed), 1748 unchanged.
x64 --tests --pmi
Found 4205 files with textual diffs.
Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 175645635
Total bytes of diff: 175801565
Total bytes of delta: 155930 (0.09 % of base)
Total relative delta: 737.43
diff is a regression.
relative diff is a regression.
Total byte diff includes 17480 bytes from reconciling methods
Base had 0 unique methods, 0 unique bytes
Diff had 16 unique methods, 17480 unique bytes
Top file regressions (bytes):
17480 : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm (24.03% of base)
8760 : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm (0.16% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\Sqrt_r\Sqrt_r.dasm (1.38% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar.Int64_r\MoveScalar.Int64_r.dasm (1.38% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar_r\MoveScalar_r.dasm (1.38% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\MultiplyHigh_r\MultiplyHigh_r.dasm (1.37% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar.UInt64_r\MoveScalar.UInt64_r.dasm (1.38% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\Multiply_r\Multiply_r.dasm (1.38% of base)
5892 : JIT\HardwareIntrinsics\X86\Sse2\SqrtScalar_r\SqrtScalar_r.dasm (1.38% of base)
4036 : JIT\Methodical\fp\exgen\10w5d_cs_r\10w5d_cs_r.dasm (0.28% of base)
4036 : JIT\Methodical\fp\exgen\10w5d_cs_d\10w5d_cs_d.dasm (0.28% of base)
2377 : JIT\SIMD\VectorConvert_r_Target_64Bit\VectorConvert_r_Target_64Bit.dasm (1.92% of base)
2349 : JIT\HardwareIntrinsics\General\Vector256\Vector256_ro\Vector256_ro.dasm (0.09% of base)
2169 : JIT\HardwareIntrinsics\General\Vector64\Vector64_r\Vector64_r.dasm (0.07% of base)
2169 : JIT\HardwareIntrinsics\General\Vector256\Vector256_r\Vector256_r.dasm (0.06% of base)
2169 : JIT\HardwareIntrinsics\General\Vector128\Vector128_r\Vector128_r.dasm (0.07% of base)
1808 : JIT\HardwareIntrinsics\Arm\AdvSimd\AdvSimd_Part3_ro\AdvSimd_Part3_ro.dasm (0.31% of base)
1772 : JIT\Methodical\divrem\div\u8div_cs_do\u8div_cs_do.dasm (1.33% of base)
1772 : JIT\Methodical\divrem\div\u8div_cs_ro\u8div_cs_ro.dasm (1.33% of base)
1743 : JIT\Methodical\divrem\rem\u8rem_cs_do\u8rem_cs_do.dasm (1.24% of base)
Top file improvements (bytes):
-2084 : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm (-4.00% of base)
-1180 : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm (-8.95% of base)
-1180 : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm (-8.95% of base)
-1156 : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm (-8.87% of base)
-1156 : Interop\IJW\FixupCallsHostWhenLoaded\FixupCallsHostWhenLoaded\IjwNativeDll.dasm (-8.87% of base)
-1150 : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm (-8.55% of base)
-159 : JIT\jit64\rtchecks\overflow\overflow03_div\overflow03_div.dasm (-4.94% of base)
-56 : JIT\Performance\CodeQuality\V8\Crypto\Crypto\Crypto.dasm (-0.14% of base)
-55 : JIT\jit64\rtchecks\overflow\overflow04_div\overflow04_div.dasm (-2.83% of base)
-51 : JIT\jit64\rtchecks\overflow\overflow01_div\overflow01_div.dasm (-2.53% of base)
-45 : Interop\COM\Dynamic\Dynamic\Dynamic.dasm (-0.02% of base)
-20 : JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b31878\b31878\b31878.dasm (-7.78% of base)
-15 : JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b14068\b14068\b14068.dasm (-13.76% of base)
-14 : JIT\jit64\rtchecks\overflow\overflow02_div\overflow02_div.dasm (-0.84% of base)
-6 : JIT\Directed\perffix\primitivevt\callconv3_il_d\helper.dasm (-3.09% of base)
-6 : JIT\Directed\perffix\primitivevt\callconv3_il_r\helper.dasm (-3.09% of base)
-6 : JIT\Directed\PREFIX\PrimitiveVT\helper\helper.dasm (-3.09% of base)
-4 : JIT\Regression\CLR-x86-JIT\V1-M11-Beta1\b41621\b41621\b41621.dasm (-0.79% of base)
-2 : JIT\Regression\JitBlue\DevDiv_370233\DevDiv_370233\DevDiv_370233.dasm (-1.04% of base)
267 total files with Code Size differences (19 improved, 248 regressed), 3331 unchanged.
Top method regressions (bytes):
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_d_DblCast_d_:_DblCast_d_DblCast_d_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_do_DblCast_do_:_DblCast_do_DblCast_do_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_r_DblCast_r_:_DblCast_r_DblCast_r_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_ro_DblCast_ro_:_DblCast_ro_DblCast_ro_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_d_FltCast_d_:_FltCast_d_FltCast_d_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_do_FltCast_do_:_FltCast_do_FltCast_do_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_r_FltCast_r_:_FltCast_r_FltCast_r_cmd():this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_ro_FltCast_ro_:_FltCast_ro_FltCast_ro_cmd():this (0 base, 1 diff methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\Sqrt_r\Sqrt_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar.Int64_r\MoveScalar.Int64_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar_r\MoveScalar_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\MultiplyHigh_r\MultiplyHigh_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\MoveScalar.UInt64_r\MoveScalar.UInt64_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\Multiply_r\Multiply_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1776 ( 8.17% of base) : JIT\HardwareIntrinsics\X86\Sse2\SqrtScalar_r\SqrtScalar_r.dasm - TestUtilities:InitializeWithContinuosIndependentNumbering(ref,ref) (8 methods)
1772 ( 1.34% of base) : JIT\Methodical\divrem\div\u8div_cs_do\u8div_cs_do.dasm - u8div:Main():int
1772 ( 1.34% of base) : JIT\Methodical\divrem\div\u8div_cs_ro\u8div_cs_ro.dasm - u8div:Main():int
1743 ( 1.25% of base) : JIT\Methodical\divrem\rem\u8rem_cs_do\u8rem_cs_do.dasm - u8rem:Main():int
1743 ( 1.25% of base) : JIT\Methodical\divrem\rem\u8rem_cs_ro\u8rem_cs_ro.dasm - u8rem:Main():int
1430 ( 1.52% of base) : JIT\Methodical\fp\exgen\1000w1d_cs_d\1000w1d_cs_d.dasm - testout1:Func_0():int
Top method improvements (bytes):
-469 (-51.43% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\FixupCallsHostWhenLoaded\FixupCallsHostWhenLoaded\IjwNativeDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-144 (-14.65% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:_exit_callback()
-144 (-14.65% of base) : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm - <Module>:_exit_callback()
-144 (-14.65% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - <Module>:_exit_callback()
-144 (-14.65% of base) : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm - <Module>:_exit_callback()
-144 (-14.65% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - <Module>:_exit_callback()
-144 (-14.65% of base) : Interop\IJW\FixupCallsHostWhenLoaded\FixupCallsHostWhenLoaded\IjwNativeDll.dasm - <Module>:_exit_callback()
-141 (-1.76% of base) : JIT\Methodical\explicit\coverage\expl_gc_byte_1_r\expl_gc_byte_1_r.dasm - TestApp:Main():int
-141 (-1.72% of base) : JIT\Methodical\explicit\coverage\seq_gc_byte_1_r\seq_gc_byte_1_r.dasm - TestApp:Main():int
-89 (-4.32% of base) : JIT\Performance\CodeQuality\V8\Crypto\Crypto\Crypto.dasm - BigInteger:divRemTo(BigInteger,BigInteger,BigInteger):this
-74 (-12.89% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:_app_exit_callback()
-74 (-12.89% of base) : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm - <Module>:_app_exit_callback()
-74 (-12.89% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - <Module>:_app_exit_callback()
-74 (-12.89% of base) : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm - <Module>:_app_exit_callback()
-74 (-12.89% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - <Module>:_app_exit_callback()
Top method regressions (percentages):
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_d_DblCast_d_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_d_DblCast_d_:_DblCast_d_DblCast_d_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_do_DblCast_do_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_do_DblCast_do_:_DblCast_do_DblCast_do_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_r_DblCast_r_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_r_DblCast_r_:_DblCast_r_DblCast_r_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_ro_DblCast_ro_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _DblCast_ro_DblCast_ro_:_DblCast_ro_DblCast_ro_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_d_FltCast_d_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_d_FltCast_d_:_FltCast_d_FltCast_d_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_do_FltCast_do_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_do_FltCast_do_:_FltCast_do_FltCast_do_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_r_FltCast_r_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_r_FltCast_r_:_FltCast_r_FltCast_r_cmd():this (0 base, 1 diff methods)
11 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_ro_FltCast_ro_:.ctor(ITestOutputHelper):this (0 base, 1 diff methods)
2174 ( ∞ of base) : JIT\CodeGenBringUpTests\JIT.CodeGenBringUpTests.XUnitWrapper.dasm - _FltCast_ro_FltCast_ro_:_FltCast_ro_FltCast_ro_cmd():this (0 base, 1 diff methods)
51 (566.67% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - Int16:System.INumber<System.Int16>.CreateTruncating(double):short
33 (550.00% of base) : JIT\Directed\callconv\ThisCall\ThisCallTest\ThisCallTest.dasm - <>c:<get_ManagedVtable>b__20_2(long):IntWrapper:this
31 (516.67% of base) : JIT\Regression\JitBlue\DevDiv_544983\DevDiv_544983\DevDiv_544983.dasm - DevDiv_544983:Test(int):int
42 (466.67% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - UInt32:System.INumber<System.UInt32>.CreateTruncating(double):int
Top method improvements (percentages):
-469 (-51.43% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-469 (-51.43% of base) : Interop\IJW\FixupCallsHostWhenLoaded\FixupCallsHostWhenLoaded\IjwNativeDll.dasm - <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize(long) (2 base, 1 diff methods)
-19 (-51.35% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - Int16:System.INumber<System.Int16>.Create(double):short
-15 (-45.45% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - SByte:System.INumber<System.SByte>.Create(double):byte
-6 (-42.86% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-6 (-42.86% of base) : Interop\IJW\ManagedCallingNative\ManagedCallingNative\IjwNativeDll.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-6 (-42.86% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-6 (-42.86% of base) : Interop\IJW\CopyConstructorMarshaler\CopyConstructorMarshaler\IjwCopyConstructorMarshaler.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-6 (-42.86% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-6 (-42.86% of base) : Interop\IJW\FixupCallsHostWhenLoaded\FixupCallsHostWhenLoaded\IjwNativeDll.dasm - <Module>:?A0xdf573d4b.??__E?IsDefaultDomain@CurrentDomain@<CrtImplementationDetails>@@$$Q2_NA@@YMXXZ()
-12 (-40.00% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - Byte:System.INumber<System.Byte>.Create(double):ubyte
-12 (-40.00% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - Char:System.INumber<System.Char>.Create(double):ushort
-12 (-40.00% of base) : Interop\ICastable\ICastable.CoreLib\System.Private.CoreLib.dasm - UInt16:System.INumber<System.UInt16>.Create(double):ushort
-6 (-27.27% of base) : Interop\IJW\NativeCallingManaged\NativeCallingManaged\IjwNativeCallingManagedDll.dasm - TestClass:.cctor()
-6 (-27.27% of base) : Interop\IJW\LoadIjwFromModuleHandle\LoadIjwFromModuleHandle\IjwNativeCallingManagedDll.dasm - TestClass:.cctor()
-4 (-26.67% of base) : Interop\IJW\NativeVarargs\NativeVarargsTest\IjwNativeVarargs.dasm - <Module>:?A0xdf573d4b.??__E?Initialized@CurrentDomain@<CrtImplementationDetails>@@$$Q2HA@@YMXXZ()
2799 total methods with Code Size differences (860 improved, 1939 regressed), 543613 unchanged.

@tannergooding

Copy link
Copy Markdown
MemberAuthor

ARM64 diffs are similar (can't use jitutils though):

ConvertDoubleTo* for Int8/Int16/UInt8/UInt16 are all effectively (noting the redundant moves look to be a more general and existing codegen issue):

- 1E780000 fcvtzs w0, d0- 13001C00 sxtb w0, w0+ 5C000150 ldr d16, [@RWD00]+ 1E604210 fmov d16, d16+ 1E704810 fmax d16, d0, d16+ 5C000131 ldr d17, [@RWD08]+ 1E604231 fmov d17, d17+ 1E715A10 fmin d16, d16, d17+ 1E780200 fcvtzs w0, d16

No Changes for ConvertDoubleTo* for Int32/Int64/UInt32/UInt64

Comment threadsrc/tests/JIT/Directed/Convert/out_of_range_fp_to_int_conversions.cs Outdated
Comment threadsrc/tests/JIT/Directed/Convert/out_of_range_fp_to_int_conversions.cs Outdated
@ghostghost closed this Dec 23, 2021
@ghost

Copy link
Copy Markdown

Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it.

@tannergooding

Copy link
Copy Markdown
MemberAuthor

Rebased onto dotnet/main

@tannergooding

Copy link
Copy Markdown
MemberAuthor

Going to need help from someone on the Mono team to figure out the Browser wasm and llvmfullaot issues as I'm not seeing what extra logic they require to go down the relevant paths.

Was initially trying to get everything working and then would look at only enabling it where necessary and optimizing (helpers aren't needed on Arm64, for example).

@tannergooding

Copy link
Copy Markdown
MemberAuthor

Going to need help from someone on the Mono team to figure out the Browser wasm and llvmfullaot issues as I'm not seeing what extra logic they require to go down the relevant paths.

@vargaz, is this something you or someone from the mono team could help me investigate? I'm not finding what isn't being handled correctly here and its preventing the last of the prototype work to try and finalize the behavior to be deterministic.

After mono is all passing, then I'll be able to finish getting perf numbers and writing up the breaking-change doc.

@vargaz

Copy link
Copy Markdown
Contributor

Will look into it.

Comment threadsrc/mono/mono/mini/interp/interp.c Outdated
@vargaz

Copy link
Copy Markdown
Contributor

The mono changes look ok to me.

@tannergooding

Copy link
Copy Markdown
MemberAuthor

@vargaz, Thanks for the help!

I'm still seeing

Attempting to JIT compile method '(wrapper managed-to-native) long object:__icall_wrapper___emul_fconv_to_i8 (double)' while running in aot-only mode.

and then for OSX

Checked conversion for Single -> System.Byte failed; Input: 255.99998; Expected 255; Actual 0


For the first one, I'd expect there is some handling or other consideration I'm missing for AOT around https://github.com/dotnet/runtime/pull/61761/files#diff-ca87147826c7221d1c277d7a22d042444f21defad5b7a901d771c158243d6e14R4767

It's not clear why this is being "jitted". I thought that this was supposed to be treated as a call to the native helper and so it should just work for AOT. Notably, the new entries match up to register_opcode_emulation (OP_FCONV_TO_U8, __emul_fconv_to_u8, mono_icall_sig_ulong_double, mono_fconv_u8, FALSE); which was pre-existing. The only notable difference might be handling in method-to-ir (there is special handling that picks the right opcode under MONO_CEE_CONV_U) but it's not clear to me what would need to be changed here, as I thought/expected this was already handled by the unops_op_map.


For the second issue, it's not clear why this is only showing up on OSX.

Perhaps there is some improper handling around the new mono_icall_sig_ entries like for interp? But that's somewhat unexpected to me since there were already similar entries that took/returned int8/int16, so it's not clear where to look next.

I'm notably not able to reproduce this on Windows and debugging, even for interp/aot mode, looks to be doing all the right things here.

@vargaz

Copy link
Copy Markdown
Contributor

Will look into it.

@vargaz

Copy link
Copy Markdown
Contributor

#66268

Comment threadsrc/mono/mono/utils/mono-math.h
@ghostghost closed this Apr 10, 2022
@ghost

Copy link
Copy Markdown

Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it.

@ghostghost locked as resolved and limited conversation to collaborators May 11, 2022
@jeffhandleyjeffhandley removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Apr 4, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@tannergooding@jkotas@vargaz@SingleAccretion@jeffhandley