| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
/* { dg-final { check-function-bodies "**" "" } } */ |
| 4 |
|
| 5 |
#include <arm_sve.h> |
| 6 |
|
| 7 |
/* |
| 8 |
** f1: |
| 9 |
** sub x0, x1, x0 |
| 10 |
** incb x0 |
| 11 |
** ret |
| 12 |
*/ |
| 13 |
uint64_t |
| 14 |
f1 (int *ptr1, int *ptr2) |
| 15 |
{ |
| 16 |
return ((ptr2 - ptr1) + svcntw ()) * 4; |
| 17 |
} |
| 18 |
|
| 19 |
/* |
| 20 |
** f2: |
| 21 |
** sub x0, x1, x0 |
| 22 |
** incb x0, all, mul #4 |
| 23 |
** ret |
| 24 |
*/ |
| 25 |
uint64_t |
| 26 |
f2 (int *ptr1, int *ptr2) |
| 27 |
{ |
| 28 |
return ((ptr2 - ptr1) + svcntb ()) * 4; |
| 29 |
} |
| 30 |
|
| 31 |
/* |
| 32 |
** f3: |
| 33 |
** sub x0, x1, x0 |
| 34 |
** ret |
| 35 |
*/ |
| 36 |
uint64_t |
| 37 |
f3 (int *ptr1, int *ptr2) |
| 38 |
{ |
| 39 |
return (((int *) ((char *) ptr2 + svcntb ()) - ptr1) - svcntw ()) * 4; |
| 40 |
} |