Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
tests/tcg/s390x: Test VCKSM
Add a small test to prevent regressions. Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230724082032.66864-15-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Test the VCKSM instruction. | ||
| * | ||
| * SPDX-License-Identifier: GPL-2.0-or-later | ||
| */ | ||
| #include <assert.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include "vx.h" | ||
|
|
||
| int main(void) | ||
| { | ||
| S390Vector v1; | ||
| S390Vector v2 = { | ||
| .d[0] = 0xb2261c8140edce49ULL, | ||
| .d[1] = 0x387bf5a433af39d1ULL, | ||
| }; | ||
| S390Vector v3 = { | ||
| .d[0] = 0x73b03d2c7f9e654eULL, | ||
| .d[1] = 0x23d74e51fb479877ULL, | ||
| }; | ||
| S390Vector exp = {.d[0] = 0xdedd7f8eULL, .d[1] = 0ULL}; | ||
|
|
||
| asm volatile("vcksm %[v1],%[v2],%[v3]" | ||
| : [v1] "=v" (v1.v) | ||
| : [v2] "v" (v2.v) | ||
| , [v3] "v" (v3.v)); | ||
| assert(memcmp(&v1, &exp, sizeof(v1)) == 0); | ||
|
|
||
| return EXIT_SUCCESS; | ||
| } |
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