Skip to content

Commit 272b8f6

Browse files
committed
Fixing some tests for x86 and skipping some tests on Mono
1 parent bf890e4 commit 272b8f6

File tree

6 files changed

+75
-74
lines changed

6 files changed

+75
-74
lines changed

src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4875,6 +4875,7 @@ public void Log2SingleTest(float value, float expectedResult, float variance)
48754875
}
48764876

48774877
[Fact]
4878+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
48784879
public void ConvertToInt32Test()
48794880
{
48804881
Assert.Equal(Vector128.Create(int.MinValue), Vector128.ConvertToInt32(Vector128.Create(float.MinValue)));
@@ -4883,6 +4884,7 @@ public void ConvertToInt32Test()
48834884
}
48844885

48854886
[Fact]
4887+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
48864888
public void ConvertToInt32NativeTest()
48874889
{
48884890
if (Vector128.IsHardwareAccelerated && Sse2.IsSupported)
@@ -4898,6 +4900,7 @@ public void ConvertToInt32NativeTest()
48984900
}
48994901

49004902
[Fact]
4903+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49014904
public void ConvertToInt64Test()
49024905
{
49034906
Assert.Equal(Vector128.Create(long.MinValue), Vector128.ConvertToInt64(Vector128.Create(double.MinValue)));
@@ -4906,6 +4909,7 @@ public void ConvertToInt64Test()
49064909
}
49074910

49084911
[Fact]
4912+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49094913
public void ConvertToInt64NativeTest()
49104914
{
49114915
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)
@@ -4922,6 +4926,7 @@ public void ConvertToInt64NativeTest()
49224926
}
49234927

49244928
[Fact]
4929+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49254930
public void ConvertToUInt32Test()
49264931
{
49274932
Assert.Equal(Vector128.Create(uint.MinValue), Vector128.ConvertToUInt32(Vector128.Create(float.MinValue)));
@@ -4930,6 +4935,7 @@ public void ConvertToUInt32Test()
49304935
}
49314936

49324937
[Fact]
4938+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49334939
public void ConvertToUInt32NativeTest()
49344940
{
49354941
if (Vector128.IsHardwareAccelerated && Avx512F.VL.IsSupported)
@@ -4946,6 +4952,7 @@ public void ConvertToUInt32NativeTest()
49464952
}
49474953

49484954
[Fact]
4955+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49494956
public void ConvertToUInt64Test()
49504957
{
49514958
Assert.Equal(Vector128.Create(ulong.MinValue), Vector128.ConvertToUInt64(Vector128.Create(double.MinValue)));
@@ -4954,6 +4961,7 @@ public void ConvertToUInt64Test()
49544961
}
49554962

49564963
[Fact]
4964+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
49574965
public void ConvertToUInt64NativeTest()
49584966
{
49594967
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)

src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector256Tests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5890,6 +5890,7 @@ public void Log2SingleTest(float value, float expectedResult, float variance)
58905890
}
58915891

58925892
[Fact]
5893+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
58935894
public void ConvertToInt32Test()
58945895
{
58955896
Assert.Equal(Vector256.Create(int.MinValue), Vector256.ConvertToInt32(Vector256.Create(float.MinValue)));
@@ -5898,6 +5899,7 @@ public void ConvertToInt32Test()
58985899
}
58995900

59005901
[Fact]
5902+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59015903
public void ConvertToInt32NativeTest()
59025904
{
59035905
if (Vector128.IsHardwareAccelerated && Sse2.IsSupported)
@@ -5913,6 +5915,7 @@ public void ConvertToInt32NativeTest()
59135915
}
59145916

59155917
[Fact]
5918+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59165919
public void ConvertToInt64Test()
59175920
{
59185921
Assert.Equal(Vector256.Create(long.MinValue), Vector256.ConvertToInt64(Vector256.Create(double.MinValue)));
@@ -5921,6 +5924,7 @@ public void ConvertToInt64Test()
59215924
}
59225925

59235926
[Fact]
5927+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59245928
public void ConvertToInt64NativeTest()
59255929
{
59265930
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)
@@ -5937,6 +5941,7 @@ public void ConvertToInt64NativeTest()
59375941
}
59385942

59395943
[Fact]
5944+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59405945
public void ConvertToUInt32Test()
59415946
{
59425947
Assert.Equal(Vector256.Create(uint.MinValue), Vector256.ConvertToUInt32(Vector256.Create(float.MinValue)));
@@ -5945,6 +5950,7 @@ public void ConvertToUInt32Test()
59455950
}
59465951

59475952
[Fact]
5953+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59485954
public void ConvertToUInt32NativeTest()
59495955
{
59505956
if (Vector128.IsHardwareAccelerated && Avx512F.VL.IsSupported)
@@ -5961,6 +5967,7 @@ public void ConvertToUInt32NativeTest()
59615967
}
59625968

59635969
[Fact]
5970+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59645971
public void ConvertToUInt64Test()
59655972
{
59665973
Assert.Equal(Vector256.Create(ulong.MinValue), Vector256.ConvertToUInt64(Vector256.Create(double.MinValue)));
@@ -5969,6 +5976,7 @@ public void ConvertToUInt64Test()
59695976
}
59705977

59715978
[Fact]
5979+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
59725980
public void ConvertToUInt64NativeTest()
59735981
{
59745982
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)

src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5323,6 +5323,7 @@ public void Log2SingleTest(float value, float expectedResult, float variance)
53235323
}
53245324

53255325
[Fact]
5326+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53265327
public void ConvertToInt32Test()
53275328
{
53285329
Assert.Equal(Vector512.Create(int.MinValue), Vector512.ConvertToInt32(Vector512.Create(float.MinValue)));
@@ -5331,6 +5332,7 @@ public void ConvertToInt32Test()
53315332
}
53325333

53335334
[Fact]
5335+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53345336
public void ConvertToInt32NativeTest()
53355337
{
53365338
if (Vector128.IsHardwareAccelerated && Sse2.IsSupported)
@@ -5346,6 +5348,7 @@ public void ConvertToInt32NativeTest()
53465348
}
53475349

53485350
[Fact]
5351+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53495352
public void ConvertToInt64Test()
53505353
{
53515354
Assert.Equal(Vector512.Create(long.MinValue), Vector512.ConvertToInt64(Vector512.Create(double.MinValue)));
@@ -5354,6 +5357,7 @@ public void ConvertToInt64Test()
53545357
}
53555358

53565359
[Fact]
5360+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53575361
public void ConvertToInt64NativeTest()
53585362
{
53595363
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)
@@ -5370,6 +5374,7 @@ public void ConvertToInt64NativeTest()
53705374
}
53715375

53725376
[Fact]
5377+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53735378
public void ConvertToUInt32Test()
53745379
{
53755380
Assert.Equal(Vector512.Create(uint.MinValue), Vector512.ConvertToUInt32(Vector512.Create(float.MinValue)));
@@ -5378,6 +5383,7 @@ public void ConvertToUInt32Test()
53785383
}
53795384

53805385
[Fact]
5386+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53815387
public void ConvertToUInt32NativeTest()
53825388
{
53835389
if (Vector128.IsHardwareAccelerated && Avx512F.VL.IsSupported)
@@ -5394,6 +5400,7 @@ public void ConvertToUInt32NativeTest()
53945400
}
53955401

53965402
[Fact]
5403+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
53975404
public void ConvertToUInt64Test()
53985405
{
53995406
Assert.Equal(Vector512.Create(ulong.MinValue), Vector512.ConvertToUInt64(Vector512.Create(double.MinValue)));
@@ -5402,6 +5409,7 @@ public void ConvertToUInt64Test()
54025409
}
54035410

54045411
[Fact]
5412+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
54055413
public void ConvertToUInt64NativeTest()
54065414
{
54075415
if (Vector128.IsHardwareAccelerated && Avx512DQ.VL.IsSupported)

src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector64Tests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4290,6 +4290,7 @@ public void Log2SingleTest(float value, float expectedResult, float variance)
42904290
}
42914291

42924292
[Fact]
4293+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
42934294
public void ConvertToInt32Test()
42944295
{
42954296
Assert.Equal(Vector64.Create(int.MinValue), Vector64.ConvertToInt32(Vector64.Create(float.MinValue)));
@@ -4298,6 +4299,7 @@ public void ConvertToInt32Test()
42984299
}
42994300

43004301
[Fact]
4302+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43014303
public void ConvertToInt32NativeTest()
43024304
{
43034305
Assert.Equal(Vector64.Create(int.MinValue), Vector64.ConvertToInt32Native(Vector64.Create(float.MinValue)));
@@ -4306,6 +4308,7 @@ public void ConvertToInt32NativeTest()
43064308
}
43074309

43084310
[Fact]
4311+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43094312
public void ConvertToInt64Test()
43104313
{
43114314
Assert.Equal(Vector64.Create(long.MinValue), Vector64.ConvertToInt64(Vector64.Create(double.MinValue)));
@@ -4314,6 +4317,7 @@ public void ConvertToInt64Test()
43144317
}
43154318

43164319
[Fact]
4320+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43174321
public void ConvertToInt64NativeTest()
43184322
{
43194323
Assert.Equal(Vector64.Create(long.MinValue), Vector64.ConvertToInt64Native(Vector64.Create(double.MinValue)));
@@ -4322,6 +4326,7 @@ public void ConvertToInt64NativeTest()
43224326
}
43234327

43244328
[Fact]
4329+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43254330
public void ConvertToUInt32Test()
43264331
{
43274332
Assert.Equal(Vector64.Create(uint.MinValue), Vector64.ConvertToUInt32(Vector64.Create(float.MinValue)));
@@ -4330,6 +4335,7 @@ public void ConvertToUInt32Test()
43304335
}
43314336

43324337
[Fact]
4338+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43334339
public void ConvertToUInt32NativeTest()
43344340
{
43354341
Assert.Equal(Vector64.Create(uint.MinValue), Vector64.ConvertToUInt32Native(Vector64.Create(float.MinValue)));
@@ -4338,6 +4344,7 @@ public void ConvertToUInt32NativeTest()
43384344
}
43394345

43404346
[Fact]
4347+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43414348
public void ConvertToUInt64Test()
43424349
{
43434350
Assert.Equal(Vector64.Create(ulong.MinValue), Vector64.ConvertToUInt64(Vector64.Create(double.MinValue)));
@@ -4346,6 +4353,7 @@ public void ConvertToUInt64Test()
43464353
}
43474354

43484355
[Fact]
4356+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
43494357
public void ConvertToUInt64NativeTest()
43504358
{
43514359
Assert.Equal(Vector64.Create(ulong.MinValue), Vector64.ConvertToUInt64Native(Vector64.Create(double.MinValue)));

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.GenericMath.cs

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ public static void op_InequalityTest()
358358
//
359359

360360
[Fact]
361+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
361362
public static void ConvertToIntegerTest()
362363
{
363364
// Signed Values
@@ -408,39 +409,17 @@ public static void ConvertToIntegerTest()
408409
}
409410

410411
[Fact]
412+
[SkipOnMono("https://github.com/dotnet/runtime/issues/100368")]
411413
public static void ConvertToIntegerNativeTest()
412414
{
413415
// Signed Values
414416

415-
if (Sse2.IsSupported)
416-
{
417-
// On Xarch:
418-
// * Conversion to int is natively supported and returns 0x8000_0000
419-
// * Conversion to long is natively supported on 64-bit and returns 0x8000_0000_0000_0000
420-
421-
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MinValue));
422-
Assert.Equal(int.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<int>(double.MinValue));
423-
Assert.Equal(nint.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<nint>(double.MinValue));
424-
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MinValue));
425-
426-
if (Environment.Is64BitProcess)
427-
{
428-
Assert.Equal(long.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MinValue));
429-
}
430-
else
431-
{
432-
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MinValue));
433-
}
434-
}
435-
else
436-
{
437-
Assert.Equal(short.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MinValue));
438-
Assert.Equal(int.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<int>(double.MinValue));
439-
Assert.Equal(long.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MinValue));
440-
Assert.Equal(nint.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<nint>(double.MinValue));
441-
Assert.Equal(sbyte.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MinValue));
442-
}
417+
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MinValue));
418+
Assert.Equal(int.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<int>(double.MinValue));
419+
Assert.Equal(long.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MinValue));
443420
Assert.Equal(Int128.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<Int128>(double.MinValue));
421+
Assert.Equal(nint.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<nint>(double.MinValue));
422+
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MinValue));
444423

445424
Assert.Equal(2, FloatingPointHelper<double>.ConvertToIntegerNative<short>(2.6));
446425
Assert.Equal(2, FloatingPointHelper<double>.ConvertToIntegerNative<int>(2.6));
@@ -456,19 +435,26 @@ public static void ConvertToIntegerNativeTest()
456435
// * Conversion to long is natively supported on 64-bit and returns 0x8000_0000_0000_0000
457436

458437
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MaxValue));
459-
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MaxValue));
460-
461438
Assert.Equal(int.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<int>(double.MaxValue));
462-
Assert.Equal(long.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MaxValue));
463439
Assert.Equal(nint.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<nint>(double.MaxValue));
440+
Assert.Equal(0, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MaxValue));
441+
442+
if (Environment.Is64BitProcess)
443+
{
444+
Assert.Equal(long.MinValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MaxValue));
445+
}
446+
else
447+
{
448+
Assert.Equal(long.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MaxValue));
449+
}
464450
}
465451
else
466452
{
467-
Assert.Equal(short.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MaxValue));
453+
Assert.Equal(-1, FloatingPointHelper<double>.ConvertToIntegerNative<short>(double.MaxValue));
468454
Assert.Equal(int.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<int>(double.MaxValue));
469455
Assert.Equal(long.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<long>(double.MaxValue));
470456
Assert.Equal(nint.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<nint>(double.MaxValue));
471-
Assert.Equal(sbyte.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MaxValue));
457+
Assert.Equal(-1, FloatingPointHelper<double>.ConvertToIntegerNative<sbyte>(double.MaxValue));
472458
}
473459
Assert.Equal(Int128.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<Int128>(double.MaxValue));
474460

@@ -529,12 +515,12 @@ public static void ConvertToIntegerNativeTest()
529515
else
530516
{
531517
Assert.Equal(byte.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<byte>(double.MaxValue));
532-
Assert.Equal(nuint.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<nuint>(double.MaxValue));
518+
Assert.Equal(ushort.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<ushort>(double.MaxValue));
533519
}
534520
Assert.Equal(uint.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<uint>(double.MaxValue));
535521
Assert.Equal(ulong.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<ulong>(double.MaxValue));
522+
Assert.Equal(nuint.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<nuint>(double.MaxValue));
536523
Assert.Equal(UInt128.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<UInt128>(double.MaxValue));
537-
Assert.Equal(nuint.MaxValue, FloatingPointHelper<double>.ConvertToIntegerNative<ulong>(double.MaxValue));
538524
}
539525

540526
[Fact]
@@ -1236,7 +1222,7 @@ public static void CreateCheckedFromDecimalTest()
12361222
AssertBitwiseEqual(-0.0, NumberBaseHelper<double>.CreateChecked<decimal>(-0.0m));
12371223
AssertBitwiseEqual(+0.0, NumberBaseHelper<double>.CreateChecked<decimal>(+0.0m));
12381224
AssertBitwiseEqual(+1.0, NumberBaseHelper<double>.CreateChecked<decimal>(+1.0m));
1239-
AssertBitwiseEqual(+79228162514264337593543950335.0, NumberBaseHelper<double>.CreateChecked<decimal>(decimal.MaxValue));
1225+
AssertBitwiseEqual(+79228162514264337593543950335.0, NumberBaseHelper<double>.CreateChecked<decimal>(decimal.MaxValue));
12401226
}
12411227

12421228
[Fact]

0 commit comments

Comments
 (0)