Skip to content

Instantly share code, notes, and snippets.

// Found by Antigen
// Reduced from 350.82 KB to 346.59 KB.

// EnvVars: DOTNET_HeapVerify=1|DOTNET_JitCFGUseDispatcher=0|DOTNET_JitStressEvexEncoding=1|DOTNET_JitVTableProfiling=1|DOTNET_JitForceControlFlowGuard=1|DOTNET_JitClassProfiling=0|DOTNET_TieredCompilation=0|DOTNET_PreferredVectorBitWidth=512|DOTNET_JitStress=0|DOTNET_JitThrowOnAssertionFailure=1|DOTNET_LegacyExceptionHandling=1
//
// 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.
//
SVE_AQ_3A
SVE_FY_3A
SVE_AB_3A
SVE_EC_1A
SVE_ER_3A
SVE_AB_3B
SVE_AA_3A
SVE_BS_1A
SVE_AM_2A
SVE_AN_3A
@kunalspathak
kunalspathak / all_r.txt
Created July 26, 2024 22:05
LoadVectorFirstFault, GatherVectorFirstFault
Starting test: D:\kpathak\Core_Root_firstfaulting\Core_Root\corerun.exe -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true D:\kpathak\tests\firstfaulting\HardwareIntrinsics\HardwareIntrinsics_Arm_r\HardwareIntrinsics_Arm_r.dll Sve_Ffr
===================Running default===================
------------------- {} -------------------
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_byte() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_short() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_int() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_long() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_sbyte() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_ushort() : 7
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Ffr_uint() : 7
@kunalspathak
kunalspathak / ffr_code_examples.md
Last active September 24, 2024 16:57
FFR ABI examples
// save/restore FFR because liveness crosses call boundaries
public Vector<long> Test(Vector<long> mask)
{
  Sve.SetFfr(mask);
  return Sve.GetFfrInt64();
}

/*
    ptrue   p0.d
@kunalspathak
kunalspathak / all_r.txt
Last active July 5, 2024 16:37
Compare and AbsoluteCompare*
Starting test: D:\kpathak\Core_Root_absolutecompare\Core_Root\corerun.exe -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true D:\kpathak\tests\absolutecompare\HardwareIntrinsics\HardwareIntrinsics_Arm_r\HardwareIntrinsics_Arm_r.dll Sve_AbsoluteCompare
===================Running default===================
------------------- {} -------------------
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteCompareGreaterThan_float() : 33
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteCompareGreaterThan_double() : 33
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteCompareGreaterThanOrEqual_float() : 33
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteCompareGreaterThanOrEqual_double() : 33
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteCompareLessThan_float() : 33
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm
@kunalspathak
kunalspathak / all_r.txt
Created July 3, 2024 18:08
cndsel(mask, op1, embMask(op2))
Starting test: D:\kpathak\Core_Root_cndsel\Core_Root\corerun.exe -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true D:\kpathak\tests\cndsel\HardwareIntrinsics\HardwareIntrinsics_Arm_r\HardwareIntrinsics_Arm_r.dll Sve_
===================Running default===================
------------------- {} -------------------
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_float() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_double() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_sbyte() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_short() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_int() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_long() : 25
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteDifference_float() : 31
@kunalspathak
kunalspathak / all_r.txt
Created June 27, 2024 01:10
All stress results
Starting test: D:\kpathak\Core_Root_callee_Save\Core_Root\corerun.exe -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true D:\kpathak\tests\callee-save-all\HardwareIntrinsics\HardwareIntrinsics_Arm_r\HardwareIntrinsics_Arm_r.dll Sve_
===================Running default===================
------------------- {} -------------------
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_float() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_double() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_sbyte() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_short() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_int() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_Abs_long() : 16
Passed test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AbsoluteDifference_float() : 19
@kunalspathak
kunalspathak / calling_convetion.md
Last active June 25, 2024 22:25
sve_calling_convention
sve1()
{
   ; prolog - save z8-z23, p0-p3

     ...      
   ; save v0-v7                                 - LIVE-ONLY
   ; save v24-v31                               - LIVE-ONLY
   ; save p0-p3                                 - LIVE-ONLY
   
@kunalspathak
kunalspathak / HardwareIntrinsics_Arm_r.md
Last active June 22, 2024 16:03
GatherVector test failure
D:\kpathak\Core_Root_callee_Save\Core_Root\corerun.exe -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  D:\kpathak\tests\caller-save\HardwareIntrinsics\HardwareIntrinsics_Arm_r\HardwareIntrinsics_Arm_r.dll Sve_GatherVector_Bases_double_ulong
09:01:49.183 Running test: _Sve_r::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_GatherVector_Bases_double_ulong()
Supported ISAs:
  AdvSimd:   True
  Aes:       True
  ArmBase:   True
  Crc32:     True
  Dp:        True
  Rdm:       False
; Assembly listing for method System.Text.Unicode.Utf16Utility:GetPointerToFirstInvalidChar(ulong,int,byref,byref):ulong (FullOpts)
; Emitting BLENDED_CODE for generic ARM64 - Windows
; FullOpts code
; optimized code
; optimized using Static PGO
; fp based frame
; fully interruptible
; with Static PGO: fgCalledCount is 100
; PGO data available, but IL did not match