| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-O0" } } */ |
| 4 |
|
| 5 |
typedef unsigned int __attribute__ ((mode (DI))) int64_t; |
| 6 |
typedef unsigned int __attribute__ ((mode (SI))) int32_t; |
| 7 |
|
| 8 |
typedef union |
| 9 |
{ |
| 10 |
int32_t l[8]; |
| 11 |
} |
| 12 |
val; |
| 13 |
|
| 14 |
typedef struct |
| 15 |
{ |
| 16 |
int32_t l[2]; |
| 17 |
val v; |
| 18 |
} |
| 19 |
tre; |
| 20 |
|
| 21 |
typedef struct |
| 22 |
{ |
| 23 |
int32_t l[3]; |
| 24 |
tre t; |
| 25 |
} |
| 26 |
due; |
| 27 |
|
| 28 |
typedef struct |
| 29 |
{ |
| 30 |
val v; |
| 31 |
int64_t q; |
| 32 |
int32_t l[3]; |
| 33 |
due d; |
| 34 |
} |
| 35 |
uno; |
| 36 |
|
| 37 |
void |
| 38 |
memcpy_nested_offset_quad (uno *u) |
| 39 |
{ |
| 40 |
u->d.t.v = u->v; |
| 41 |
} |
| 42 |
|
| 43 |
/* Expect assembly such as: |
| 44 |
|
| 45 |
ldq $4,0($16) |
| 46 |
ldq $3,8($16) |
| 47 |
ldq $2,16($16) |
| 48 |
ldq $1,24($16) |
| 49 |
stq $4,72($16) |
| 50 |
stq $3,80($16) |
| 51 |
stq $2,88($16) |
| 52 |
stq $1,96($16) |
| 53 |
|
| 54 |
that is with four quadword loads at offsets 0, 8, 16, 24 each |
| 55 |
and four quadword stores at offsets 72, 80, 88, 96 each. */ |
| 56 |
|
| 57 |
/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,0\\\(\\\$16\\\)\\s" 1 } } */ |
| 58 |
/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,8\\\(\\\$16\\\)\\s" 1 } } */ |
| 59 |
/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,16\\\(\\\$16\\\)\\s" 1 } } */ |
| 60 |
/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,24\\\(\\\$16\\\)\\s" 1 } } */ |
| 61 |
/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,72\\\(\\\$16\\\)\\s" 1 } } */ |
| 62 |
/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,80\\\(\\\$16\\\)\\s" 1 } } */ |
| 63 |
/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,88\\\(\\\$16\\\)\\s" 1 } } */ |
| 64 |
/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,96\\\(\\\$16\\\)\\s" 1 } } */ |