@@ -2228,6 +2228,7 @@ internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16B
2228
2228
goto Finish ;
2229
2229
}
2230
2230
2231
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
2231
2232
private static unsafe void WidenAsciiToUtf1_Vector< TVectorByte, TVectorUShort > ( byte * pAsciiBuffer , char * pUtf16Buffer , ref nuint currentOffset , nuint elementCount )
2232
2233
where TVectorByte : unmanaged , ISimdVector < TVectorByte , byte >
2233
2234
where TVectorUShort : unmanaged , ISimdVector < TVectorUShort , ushort >
@@ -2238,7 +2239,7 @@ private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(b
2238
2239
// write instructions. See: https://github.com/dotnet/runtime/issues/33002
2239
2240
nuint finalOffsetWhereCanRunLoop = elementCount - ( nuint ) TVectorByte . Count ;
2240
2241
TVectorByte asciiVector = TVectorByte . Load ( pAsciiBuffer + currentOffset ) ;
2241
- if ( HasNoMatch < TVectorByte > ( asciiVector ) )
2242
+ if ( ! HasMatch < TVectorByte > ( asciiVector ) )
2242
2243
{
2243
2244
( TVectorUShort utf16LowVector , TVectorUShort utf16HighVector ) = Widen < TVectorByte , TVectorUShort > ( asciiVector ) ;
2244
2245
utf16LowVector . Store ( pCurrentWriteAddress ) ;
@@ -2261,7 +2262,7 @@ private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(b
2261
2262
while ( currentOffset <= finalOffsetWhereCanRunLoop)
2262
2263
{
2263
2264
asciiVector = TVectorByte. Load( pAsciiBuffer + currentOffset) ;
2264
- if ( HasNoMatch < TVectorByte> ( asciiVector) )
2265
+ if ( HasMatch < TVectorByte> ( asciiVector) )
2265
2266
{
2266
2267
break ;
2267
2268
}
@@ -2278,14 +2279,14 @@ private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(b
2278
2279
}
2279
2280
2280
2281
[ MethodImpl( MethodImplOptions. AggressiveInlining) ]
2281
- private static unsafe bool HasNoMatch < TVectorByte> ( TVectorByte vector)
2282
+ private static unsafe bool HasMatch < TVectorByte> ( TVectorByte vector)
2282
2283
where TVectorByte : unmanaged, ISimdVector < TVectorByte , byte >
2283
2284
{
2284
2285
if ( AdvSimd . IsSupported && typeof ( TVectorByte ) == typeof ( Vector128 < byte > ) )
2285
2286
{
2286
- return ! VectorContainsNonAsciiChar( ( Vector128 < byte > ) ( object ) vector) ;
2287
+ return VectorContainsNonAsciiChar( ( Vector128 < byte > ) ( object ) vector) ;
2287
2288
}
2288
- return ! TVectorByte . AnyMatches ( vector ) ;
2289
+ return TVectorByte . AnyMatches ( vector ) ;
2289
2290
}
2290
2291
2291
2292
0 commit comments