Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[MihaZupan] JIT: Optimize const ShiftRightLogical for byte values on XArch #83

Open
MihuBot opened this issue Jul 6, 2023 · 0 comments

Comments

@MihuBot
Copy link
Owner

MihuBot commented Jul 6, 2023

Build completed in 1 hour 6 minutes.
dotnet/runtime#86841

CoreLib diffs

Found 2 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6459853
Total bytes of diff: 6457327
Total bytes of delta: -2526 (-0.04 % of base)
Total relative delta: -4.94
    diff is an improvement.
    relative diff is an improvement.


Top file improvements (bytes):
       -2526 : System.Private.CoreLib.dasm (-0.04 % of base)

1 total files with Code Size differences (1 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
        -632 (-88.89 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[byte],int):System.Runtime.Intrinsics.Vector512`1[byte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -207 (-72.13 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[byte],int):System.Runtime.Intrinsics.Vector256`1[byte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
         -14 (-1.32 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IndexOfAnyVectorized(byref,byref,int,System.ReadOnlySpan`1[ushort]):int (FullOpts)
          -4 (-3.01 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSet(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-2.94 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSetAvx2(System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte]):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
          -3 (-4.92 % of base) : System.Private.CoreLib.dasm - System.Buffers.IndexOfAnyAsciiSearcher:IndexOfAnyLookupCore(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)

Top method improvements (percentages):
        -632 (-88.89 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[byte],int):System.Runtime.Intrinsics.Vector512`1[byte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -207 (-72.13 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[byte],int):System.Runtime.Intrinsics.Vector256`1[byte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
          -3 (-4.92 % of base) : System.Private.CoreLib.dasm - System.Buffers.IndexOfAnyAsciiSearcher:IndexOfAnyLookupCore(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-3.01 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSet(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-2.94 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSetAvx2(System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte]):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
         -14 (-1.32 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IndexOfAnyVectorized(byref,byref,int,System.ReadOnlySpan`1[ushort]):int (FullOpts)

10 total methods with Code Size differences (10 improved, 0 regressed), 52355 unchanged.

--------------------------------------------------------------------------------

Frameworks diffs

Diffs
Found 257 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 37842722
Total bytes of diff: 37840196
Total bytes of delta: -2526 (-0.01 % of base)
Total relative delta: -4.94
    diff is an improvement.
    relative diff is an improvement.


Top file improvements (bytes):
       -2526 : System.Private.CoreLib.dasm (-0.04 % of base)

1 total files with Code Size differences (1 improved, 0 regressed), 254 unchanged.

Top method improvements (bytes):
        -632 (-88.89 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[byte],int):System.Runtime.Intrinsics.Vector512`1[byte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -207 (-72.13 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[byte],int):System.Runtime.Intrinsics.Vector256`1[byte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
         -14 (-1.32 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IndexOfAnyVectorized(byref,byref,int,System.ReadOnlySpan`1[ushort]):int (FullOpts)
          -4 (-3.01 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSet(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-2.94 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSetAvx2(System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte]):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
          -3 (-4.92 % of base) : System.Private.CoreLib.dasm - System.Buffers.IndexOfAnyAsciiSearcher:IndexOfAnyLookupCore(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)

Top method improvements (percentages):
        -632 (-88.89 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[byte],int):System.Runtime.Intrinsics.Vector512`1[byte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512:ShiftRightLogical(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -628 (-88.83 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector512`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector512`1[ubyte],int):System.Runtime.Intrinsics.Vector512`1[ubyte] (FullOpts)
        -207 (-72.13 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[byte],int):System.Runtime.Intrinsics.Vector256`1[byte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256:ShiftRightLogical(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
        -203 (-71.73 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector256`1[ubyte]:op_UnsignedRightShift(System.Runtime.Intrinsics.Vector256`1[ubyte],int):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
          -3 (-4.92 % of base) : System.Private.CoreLib.dasm - System.Buffers.IndexOfAnyAsciiSearcher:IndexOfAnyLookupCore(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-3.01 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSet(System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte],System.Runtime.Intrinsics.Vector128`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
          -4 (-2.94 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IsCharBitSetAvx2(System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte],System.Runtime.Intrinsics.Vector256`1[ubyte]):System.Runtime.Intrinsics.Vector256`1[ubyte] (FullOpts)
         -14 (-1.32 % of base) : System.Private.CoreLib.dasm - System.Buffers.ProbabilisticMap:IndexOfAnyVectorized(byref,byref,int,System.ReadOnlySpan`1[ushort]):int (FullOpts)

10 total methods with Code Size differences (10 improved, 0 regressed), 232920 unchanged.

--------------------------------------------------------------------------------

Artifacts:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant