Home | History | Annotate | Download | only in s390x
      1 #include <stdint.h>
      2 #include <stdio.h>
      3 #include <string.h>
      4 
      5 void
      6 test(int32_t op1_init, int32_t op2_init, int32_t op3_init)
      7 {
      8    register int32_t op1 asm("8") = op1_init;
      9    register int32_t op3 asm("9") = op3_init;
     10 
     11    int32_t op2 = op2_init;
     12    int cc = 1;
     13 
     14    __asm__ volatile (
     15            "cs      8,9,%1\n\t"
     16            "ipm     %0\n\t"
     17            "srl     %0,28\n\t"
     18            : "=d" (cc), "+Q" (op2), "+d"(op1), "+d"(op3)
     19            :
     20            : "cc");
     21 }
     22 
     23 int main ()
     24 {
     25    int op1, op2, op3;
     26 
     27    test(op1, 0x10000000, 0x12345678);   // complaint
     28    test(0x10000000, op2, 0x12345678);   // complaint
     29    test(0x10000000, 0x01000000, op3);   // no complaint
     30 
     31    return 0;
     32 }
     33