forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RyuJIT: Fix logic to test bits in a constant vector (Vector256) (dotn…
…et#47385) Co-authored-by: Sergey Andreenko <[email protected]>
- Loading branch information
Showing
6 changed files
with
226 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175 changes: 175 additions & 0 deletions
175
src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_47236/GitHub_47236.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.Intrinsics; | ||
|
||
public static class Program | ||
{ | ||
private static int s_returnCode = 100; | ||
|
||
public static int Main(string[] args) | ||
{ | ||
TestVector256(); | ||
TestVector128(); | ||
TestVector64(); | ||
return s_returnCode; | ||
} | ||
|
||
public static void TestVector256() | ||
{ | ||
// Test get_Zero() optimization: | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 1>", Vector256.Create(0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 0, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 1, 1, 1, 1, 1>", Vector256.Create(0, 0, 0, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(0, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 0, 0, 0, 0>", Vector256.Create(1, 1, 1, 1, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0>", Vector256.Create(0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 1, 1>", Vector256.Create(0, 0, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1>", Vector256.Create(0, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 0, 0>", Vector256.Create(1, 1, 0, 0).ToString()); | ||
|
||
// Test get_AllBitSet() optimization: | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, 1>", Vector256.Create(-1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, -1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, 1, 1, 1, 1, 1>", Vector256.Create(-1, -1, -1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(-1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, -1, -1, -1, -1>", Vector256.Create(1, 1, 1, 1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1>", Vector256.Create(-1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, 1, 1>", Vector256.Create(-1, -1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1>", Vector256.Create(-1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector256.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, -1, -1>", Vector256.Create(1, 1, -1, -1).ToString()); | ||
} | ||
|
||
public static void TestVector128() | ||
{ | ||
// Test get_Zero() optimization: | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 1>", Vector128.Create(0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 1, 1, 1, 1>", Vector128.Create(0, 0, 0, 0, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 1, 1, 1, 1, 1>", Vector128.Create(0, 0, 0, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(0, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 0, 0, 0, 0>", Vector128.Create(1, 1, 1, 1, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0>", Vector128.Create(0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 1, 1>", Vector128.Create(0, 0, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1>", Vector128.Create(0, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 0, 0>", Vector128.Create(1, 1, 0, 0).ToString()); | ||
Assert("<0, 0>", Vector128.Create(0, 0).ToString()); | ||
Assert("<0, 1>", Vector128.Create(0, 1).ToString()); | ||
Assert("<1, 1>", Vector128.Create(1, 1).ToString()); | ||
Assert("<1, 0>", Vector128.Create(1, 0).ToString()); | ||
|
||
// Test get_AllBitSet() optimization: | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, 1>", Vector128.Create(-1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, 1, 1, 1, 1>", Vector128.Create(-1, -1, -1, -1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, 1, 1, 1, 1, 1>", Vector128.Create(-1, -1, -1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(-1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, -1, -1, -1, -1>", Vector128.Create(1, 1, 1, 1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1>", Vector128.Create(-1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, 1, 1>", Vector128.Create(-1, -1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1>", Vector128.Create(-1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector128.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, -1, -1>", Vector128.Create(1, 1, -1, -1).ToString()); | ||
Assert("<-1, -1>", Vector128.Create(-1, -1).ToString()); | ||
Assert("<-1, 1>", Vector128.Create(-1, 1).ToString()); | ||
Assert("<1, -1>", Vector128.Create(1, -1).ToString()); | ||
} | ||
|
||
public static void TestVector64() | ||
{ | ||
// Test get_Zero() optimization: | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 0>", Vector64.Create(0, 0, 0, 0, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0, 0, 0, 0, 1>", Vector64.Create(0, 0, 0, 0, 0, 0, 0, 1).ToString()); | ||
Assert("<0, 0, 0, 0, 1, 1, 1, 1>", Vector64.Create(0, 0, 0, 0, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 0, 0, 1, 1, 1, 1, 1>", Vector64.Create(0, 0, 0, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1, 1, 1, 1, 1>", Vector64.Create(0, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector64.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 0, 0, 0, 0>", Vector64.Create(1, 1, 1, 1, 0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 0, 0>", Vector64.Create(0, 0, 0, 0).ToString()); | ||
Assert("<0, 0, 1, 1>", Vector64.Create(0, 0, 1, 1).ToString()); | ||
Assert("<0, 1, 1, 1>", Vector64.Create(0, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector64.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 0, 0>", Vector64.Create(1, 1, 0, 0).ToString()); | ||
Assert("<0, 0>", Vector64.Create(0, 0).ToString()); | ||
Assert("<0, 1>", Vector64.Create(0, 1).ToString()); | ||
Assert("<1, 1>", Vector64.Create(1, 1).ToString()); | ||
Assert("<1, 0>", Vector64.Create(1, 0).ToString()); | ||
|
||
// Test get_AllBitSet() optimization: | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, -1>", Vector64.Create(-1, -1, -1, -1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1, -1, -1, -1, 1>", Vector64.Create(-1, -1, -1, -1, -1, -1, -1, 1).ToString()); | ||
Assert("<-1, -1, -1, -1, 1, 1, 1, 1>", Vector64.Create(-1, -1, -1, -1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, -1, -1, 1, 1, 1, 1, 1>", Vector64.Create(-1, -1, -1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1, 1, 1, 1, 1>", Vector64.Create(-1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, 1, 1, 1, 1>", Vector64.Create(1, 1, 1, 1, 1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1, -1, -1, -1, -1>", Vector64.Create(1, 1, 1, 1, -1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, -1, -1>", Vector64.Create(-1, -1, -1, -1).ToString()); | ||
Assert("<-1, -1, 1, 1>", Vector64.Create(-1, -1, 1, 1).ToString()); | ||
Assert("<-1, 1, 1, 1>", Vector64.Create(-1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, 1, 1>", Vector64.Create(1, 1, 1, 1).ToString()); | ||
Assert("<1, 1, -1, -1>", Vector64.Create(1, 1, -1, -1).ToString()); | ||
Assert("<-1, -1>", Vector64.Create(-1, -1).ToString()); | ||
Assert("<-1, 1>", Vector64.Create(-1, 1).ToString()); | ||
Assert("<1, -1>", Vector64.Create(1, -1).ToString()); | ||
} | ||
|
||
private static void Assert(string expected, string actual, [CallerLineNumber] int line = 0) | ||
{ | ||
if (expected != actual) | ||
{ | ||
s_returnCode++; | ||
Console.WriteLine($"{expected} != {actual}, L{line}"); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/tests/JIT/HardwareIntrinsics/General/Regression/GitHub_47236/GitHub_47236.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>Embedded</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="GitHub_47236.cs" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.