| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
unsigned int o1; |
| 5 |
unsigned int o2; |
| 6 |
|
| 7 |
unsigned int foo_xor (unsigned int a, unsigned int b, |
| 8 |
unsigned int c, unsigned int d) |
| 9 |
{ |
| 10 |
unsigned int c1 = __builtin_ia32_addcarryx_u32 (1, a, b, &o1); |
| 11 |
return __builtin_ia32_addcarryx_u32 (c1 ^ 1, c, d, &o2); |
| 12 |
} |
| 13 |
|
| 14 |
unsigned int foo_sub (unsigned int a, unsigned int b, |
| 15 |
unsigned int c, unsigned int d) |
| 16 |
{ |
| 17 |
unsigned int c1 = __builtin_ia32_addcarryx_u32 (1, a, b, &o1); |
| 18 |
return __builtin_ia32_addcarryx_u32 (1 - c1, c, d, &o2); |
| 19 |
} |
| 20 |
|
| 21 |
unsigned int foo_eqz (unsigned int a, unsigned int b, |
| 22 |
unsigned int c, unsigned int d) |
| 23 |
{ |
| 24 |
unsigned int c1 = __builtin_ia32_addcarryx_u32 (1, a, b, &o1); |
| 25 |
return __builtin_ia32_addcarryx_u32 (c1 == 0, c, d, &o2); |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler "cmc" } } */ |