File tree Expand file tree Collapse file tree
Lagrange.Proto/Primitives Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System . Buffers ;
2+ using System . Runtime . Intrinsics . X86 ;
23using Lagrange . Proto . Primitives ;
34
45namespace Lagrange . Proto . Test ;
@@ -72,6 +73,8 @@ public void TestLongInt()
7273 [ Test ]
7374 public void TestReadTwoInt ( )
7475 {
76+ if ( ! Sse3 . IsSupported ) Assert . Ignore ( "SSE3 is not supported on this platform." ) ;
77+
7578 var reader = new ProtoReader ( _twoInt ) ;
7679 var ( number1 , number2 ) = reader . DecodeVarIntUnsafe < int , int > ( _twoInt ) ;
7780
@@ -85,6 +88,8 @@ public void TestReadTwoInt()
8588 [ Test ]
8689 public void TestReadLongInt ( )
8790 {
91+ if ( ! Sse3 . IsSupported ) Assert . Ignore ( "SSE3 is not supported on this platform." ) ;
92+
8893 var reader = new ProtoReader ( _longInt ) ;
8994 var ( number1 , number2 ) = reader . DecodeVarIntUnsafe < long , int > ( _longInt ) ;
9095
@@ -98,6 +103,8 @@ public void TestReadLongInt()
98103 [ Test ]
99104 public void TestUnsafeRead ( )
100105 {
106+ if ( ! Sse3 . IsSupported ) Assert . Ignore ( "SSE3 is not supported on this platform." ) ;
107+
101108 Span < byte > longerBuffer = stackalloc byte [ 256 ] ;
102109 _longInt . AsSpan ( ) . CopyTo ( longerBuffer ) ;
103110
Original file line number Diff line number Diff line change @@ -171,8 +171,6 @@ public void WriteRawBytes(ReadOnlySpan<byte> bytes)
171171 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
172172 private unsafe void EncodeVarIntUnsafe < T > ( T value ) where T : unmanaged, INumberBase < T >
173173 {
174- if ( ! Sse2 . IsSupported ) throw new PlatformNotSupportedException ( ) ;
175-
176174 ulong v = ulong . CreateTruncating ( value ) ;
177175
178176 if ( sizeof ( T ) <= 4 )
You can’t perform that action at this time.
0 commit comments