aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/s390x/ipm.c
blob: 742f3a18c5ac0afa652ff313708014c328d94f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdint.h>
#include <unistd.h>

int main(void)
{
    uint32_t op1 = 0x55555555;
    uint32_t op2 = 0x44444444;
    uint64_t cc = 0xffffffffffffffffull;

    asm volatile(
        "    clc 0(4,%[op1]),0(%[op2])\n"
        "    ipm %[cc]\n"
        : [cc] "+r" (cc)
        : [op1] "r" (&op1),
          [op2] "r" (&op2)
        : "cc");
    if (cc != 0xffffffff20ffffffull) {
        write(1, "bad cc\n", 7);
        return 1;
    }
    return 0;
}