mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
tests/tcg/s390x: Tests for Miscellaneous-Instruction-Extensions Facility 3
tests/tcg/s390x/mie3-compl.c: [N]*K instructions tests/tcg/s390x/mie3-mvcrl.c: MVCRL instruction tests/tcg/s390x/mie3-sel.c: SELECT instruction Signed-off-by: David Miller <dmiller423@gmail.com> Message-Id: <20220223223117.66660-4-dmiller423@gmail.com> [thuth: Squash mnemonic -> .insn patch, white space cleanup, improve asm usage] Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
8a4eafb69c
commit
e2c3fb0699
4 changed files with 116 additions and 0 deletions
27
tests/tcg/s390x/mie3-mvcrl.c
Normal file
27
tests/tcg/s390x/mie3-mvcrl.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
static inline void mvcrl_8(const char *dst, const char *src)
|
||||
{
|
||||
asm volatile (
|
||||
"llill %%r0, 8\n"
|
||||
".insn sse, 0xE50A00000000, 0(%[dst]), 0(%[src])"
|
||||
: : [dst] "d" (dst), [src] "d" (src)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *alpha = "abcdefghijklmnop";
|
||||
|
||||
/* array missing 'i' */
|
||||
char tstr[17] = "abcdefghjklmnop\0" ;
|
||||
|
||||
/* mvcrl reference use: 'open a hole in an array' */
|
||||
mvcrl_8(tstr + 9, tstr + 8);
|
||||
|
||||
/* place missing 'i' */
|
||||
tstr[8] = 'i';
|
||||
|
||||
return strncmp(alpha, tstr, 16ul);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue