| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=armv8.6-a+mops --param=aarch64-mops-memmove-size-threshold=0" } */ |
| 3 |
/* { dg-final { check-function-bodies "**" "" "" } } */ |
| 4 |
|
| 5 |
#include <stdlib.h> |
| 6 |
|
| 7 |
/* We want to inline variable-sized memmove. |
| 8 |
** do_it_mov: |
| 9 |
** cpyp \[x1\]\!, \[x0\]\!, x2\! |
| 10 |
** cpym \[x1\]\!, \[x0\]\!, x2\! |
| 11 |
** cpye \[x1\]\!, \[x0\]\!, x2\! |
| 12 |
** ret |
| 13 |
*/ |
| 14 |
void do_it_mov (char * in, char * out, size_t size) |
| 15 |
{ |
| 16 |
__builtin_memmove (out, in, size); |
| 17 |
} |
| 18 |
|
| 19 |
/* |
| 20 |
** do_it_mov_large: |
| 21 |
** mov x2, 1024 |
| 22 |
** cpyp \[x1\]\!, \[x0\]!, x2\! |
| 23 |
** cpym \[x1\]\!, \[x0\]!, x2\! |
| 24 |
** cpye \[x1\]\!, \[x0\]\!, x2\! |
| 25 |
** ret |
| 26 |
*/ |
| 27 |
void do_it_mov_large (char * in, char * out) |
| 28 |
{ |
| 29 |
__builtin_memmove (out, in, 1024); |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
** do_it_mov_127: |
| 34 |
** mov x2, 127 |
| 35 |
** cpyp \[x1\]\!, \[x0\]!, x2\! |
| 36 |
** cpym \[x1\]\!, \[x0\]!, x2\! |
| 37 |
** cpye \[x1\]\!, \[x0\]\!, x2\! |
| 38 |
** ret |
| 39 |
*/ |
| 40 |
void do_it_mov_127 (char * in, char * out) |
| 41 |
{ |
| 42 |
__builtin_memmove (out, in, 127); |
| 43 |
} |
| 44 |
|
| 45 |
/* |
| 46 |
** do_it_mov_128: |
| 47 |
** mov x2, 128 |
| 48 |
** cpyp \[x1\]\!, \[x0\]!, x2\! |
| 49 |
** cpym \[x1\]\!, \[x0\]!, x2\! |
| 50 |
** cpye \[x1\]\!, \[x0\]\!, x2\! |
| 51 |
** ret |
| 52 |
*/ |
| 53 |
void do_it_mov_128 (char * in, char * out) |
| 54 |
{ |
| 55 |
__builtin_memmove (out, in, 128); |
| 56 |
} |
| 57 |
|