| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=rv64gc_zba -mabi=lp64" } */ |
| 3 |
|
| 4 |
typedef struct simple_bitmap_def |
| 5 |
{ |
| 6 |
unsigned char *popcount; |
| 7 |
unsigned int n_bits; |
| 8 |
unsigned int size; |
| 9 |
unsigned long elms[1]; |
| 10 |
} *sbitmap; |
| 11 |
typedef const struct simple_bitmap_def *const_sbitmap; |
| 12 |
|
| 13 |
typedef unsigned long *sbitmap_ptr; |
| 14 |
typedef const unsigned long *const_sbitmap_ptr; |
| 15 |
static unsigned long sbitmap_elt_popcount (unsigned long); |
| 16 |
|
| 17 |
void |
| 18 |
sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b) |
| 19 |
{ |
| 20 |
unsigned int i, n = dst->size; |
| 21 |
sbitmap_ptr dstp = dst->elms; |
| 22 |
const_sbitmap_ptr ap = a->elms; |
| 23 |
const_sbitmap_ptr bp = b->elms; |
| 24 |
unsigned char has_popcount = dst->popcount != ((void *) 0); |
| 25 |
|
| 26 |
for (i = 0; i < n; i++) |
| 27 |
{ |
| 28 |
const unsigned long tmp = *ap++ | *bp++; |
| 29 |
*dstp++ = tmp; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
/* { dg-final { scan-assembler "sh3add.uw" } } */ |
| 35 |
/* { dg-final { scan-assembler-not {\mslli.uw} } } */ |