| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -march=rv32gcv -mabi=ilp32d" } */ |
| 3 |
|
| 4 |
#include "riscv_vector.h" |
| 5 |
|
| 6 |
void mov0 (int8_t *in, int8_t *out) |
| 7 |
{ |
| 8 |
register vint8mf4x3_t v1 asm("v1") = *(vint8mf4x3_t*)in; |
| 9 |
asm volatile ("# %0"::"vr"(v1)); |
| 10 |
register vint8mf4x3_t v2 asm("v2") = v1; |
| 11 |
*(vint8mf4x3_t*)out = v2; |
| 12 |
asm volatile ("# %0"::"vr"(v2)); |
| 13 |
} |
| 14 |
|
| 15 |
void mov1 (int8_t *in, int8_t *out) |
| 16 |
{ |
| 17 |
register vint8mf4x3_t v1 asm("v2") = *(vint8mf4x3_t*)in; |
| 18 |
asm volatile ("# %0"::"vr"(v1)); |
| 19 |
register vint8mf4x3_t v2 asm("v1") = v1; |
| 20 |
*(vint8mf4x3_t*)out = v2; |
| 21 |
asm volatile ("# %0"::"vr"(v2)); |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv4,v3} 1 } } */ |
| 25 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv3,v2} 1 } } */ |
| 26 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv2,v1} 1 } } */ |
| 27 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv1,v2} 1 } } */ |
| 28 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv2,v3} 1 } } */ |
| 29 |
/* { dg-final { scan-assembler-times {vmv1r\.v\tv3,v4} 1 } } */ |