Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / s390x / cdsg.c
blobff0ae8ca21aeca7f90898a741f0d61372500e71a
1 #include <stdint.h>
2 #include <stdio.h>
4 typedef struct {
5 uint64_t high;
6 uint64_t low;
7 } __attribute__((aligned(16))) quad_word;
10 /* CDSG needs quad-word alignment */
11 quad_word _op1, _op2, _op3;
13 void
14 test(quad_word op1_init, quad_word op2_init, quad_word op3_init)
16 int cc; // unused
17 _op1 = op1_init;
18 _op2 = op2_init;
19 _op3 = op3_init;
21 __asm__ volatile (
22 "lmg %%r0,%%r1,%1\n\t"
23 "lmg %%r2,%%r3,%3\n\t"
24 "cdsg %%r0,%%r2,%2\n\t" // cdsg 1st,3rd,2nd
25 "stmg %%r0,%%r1,%1\n" // store r0,r1 to op1
26 "stmg %%r2,%%r3,%3\n" // store r2,r3 to op3
27 : "=d"(cc), "+QS" (_op1), "+QS" (_op2), "+QS" (_op3)
29 : "r0", "r1", "r2", "r3", "cc");
32 void op1_undefined(void)
34 quad_word op1, op2, op3;
36 // op1 undefined
37 op2.high = op2.low = 42;
38 op3.high = op3.low = 0xdeadbeefdeadbabeull;
39 test(op1, op2, op3); // complaint
42 void op2_undefined(void)
44 quad_word op1, op2, op3;
46 op1.high = op1.low = 42;
47 // op2 undefined
48 op3.high = op3.low = 0xdeadbeefdeadbabeull;
49 test(op1, op2, op3); // complaint
52 void op3_undefined(void)
54 quad_word op1, op2, op3;
56 op1.high = op1.low = 42;
57 op2 = op1;
58 // op3 undefined
59 test(op1, op2, op3); // no complaint; op3 is just copied around
62 int main ()
64 op1_undefined();
65 op2_undefined();
66 op3_undefined();
68 return 0;