xref: /openbmc/qemu/tests/tcg/s390x/mie3-mvcrl.c (revision 5242ef88)
1 #include <stdint.h>
2 #include <string.h>
3 
4 
5 static inline void mvcrl_8(const char *dst, const char *src)
6 {
7     asm volatile (
8         "llill %%r0, 8\n"
9         ".insn sse, 0xE50A00000000, 0(%[dst]), 0(%[src])"
10         : : [dst] "d" (dst), [src] "d" (src)
11         : "r0", "memory");
12 }
13 
14 
15 int main(int argc, char *argv[])
16 {
17     const char *alpha = "abcdefghijklmnop";
18 
19     /* array missing 'i' */
20     char tstr[17] = "abcdefghjklmnop\0" ;
21 
22     /* mvcrl reference use: 'open a hole in an array' */
23     mvcrl_8(tstr + 9, tstr + 8);
24 
25     /* place missing 'i' */
26     tstr[8] = 'i';
27 
28     return strncmp(alpha, tstr, 16ul);
29 }
30