xref: /openbmc/qemu/tests/tcg/s390x/laalg.c (revision 05caa062)
1 /*
2  * Test the LAALG instruction.
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  */
6 #include <assert.h>
7 #include <stdlib.h>
8 
9 int main(void)
10 {
11     unsigned long cc = 0, op1, op2 = 40, op3 = 2;
12 
13     asm("slgfi %[cc],1\n"  /* Set cc_src = -1. */
14         "laalg %[op1],%[op3],%[op2]\n"
15         "ipm %[cc]"
16         : [cc] "+r" (cc)
17         , [op1] "=r" (op1)
18         , [op2] "+T" (op2)
19         : [op3] "r" (op3)
20         : "cc");
21 
22     assert(cc == 0xffffffff10ffffff);
23     assert(op1 == 40);
24     assert(op2 == 42);
25 
26     return EXIT_SUCCESS;
27 }
28