| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gc -mabi=lp64 -O2" } */ |
| 3 |
|
| 4 |
#include "stdint-gcc.h" |
| 5 |
|
| 6 |
uint8_t test_simplify_ior_scalar_case_0 (uint8_t a) |
| 7 |
{ |
| 8 |
return a | ~a; |
| 9 |
} |
| 10 |
|
| 11 |
uint16_t test_simplify_ior_scalar_case_1 (uint16_t a) |
| 12 |
{ |
| 13 |
return a | ~a; |
| 14 |
} |
| 15 |
|
| 16 |
uint32_t test_simplify_ior_scalar_case_2 (uint32_t a) |
| 17 |
{ |
| 18 |
return a | ~a; |
| 19 |
} |
| 20 |
|
| 21 |
uint64_t test_simplify_ior_scalar_case_3 (uint64_t a) |
| 22 |
{ |
| 23 |
return a | ~a; |
| 24 |
} |
| 25 |
|
| 26 |
int8_t test_simplify_ior_scalar_case_4 (int8_t a) |
| 27 |
{ |
| 28 |
return a | ~a; |
| 29 |
} |
| 30 |
|
| 31 |
int16_t test_simplify_ior_scalar_case_5 (int16_t a) |
| 32 |
{ |
| 33 |
return a | ~a; |
| 34 |
} |
| 35 |
|
| 36 |
int32_t test_simplify_ior_scalar_case_6 (int32_t a) |
| 37 |
{ |
| 38 |
return a | ~a; |
| 39 |
} |
| 40 |
|
| 41 |
int64_t test_simplify_ior_scalar_case_7 (int64_t a) |
| 42 |
{ |
| 43 |
return a | ~a; |
| 44 |
} |
| 45 |
|
| 46 |
/* { dg-final { scan-assembler-times {li\s+a[0-9]+,\s*-1} 6 } } */ |
| 47 |
/* { dg-final { scan-assembler-times {li\s+a[0-9]+,\s*255} 1 } } */ |
| 48 |
/* { dg-final { scan-assembler-times {li\s+a[0-9]+,\s*65536} 1 } } */ |
| 49 |
/* { dg-final { scan-assembler-not {or\s+a[0-9]+} } } */ |
| 50 |
/* { dg-final { scan-assembler-not {not\s+a[0-9]+} } } */ |