| 1 |
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ |
| 2 |
/* { dg-add-options arm_v8_1m_mve } */ |
| 3 |
/* { dg-additional-options "-O2" } */ |
| 4 |
|
| 5 |
#include "arm_mve.h" |
| 6 |
void |
| 7 |
foo (const int32_t *output_bias, int8_t *out, uint16_t num_ch) |
| 8 |
{ |
| 9 |
int32_t loop_count = num_ch; |
| 10 |
const int32_t *bias = output_bias; |
| 11 |
int i_loop_cnt; |
| 12 |
for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++) |
| 13 |
{ |
| 14 |
int32x4_t out_0 = vldrwq_s32(bias); |
| 15 |
vstrbq_s32(out, out_0); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
void |
| 20 |
foo1 (const int16_t *output_bias, int8_t *out, uint16_t num_ch) |
| 21 |
{ |
| 22 |
int32_t loop_count = num_ch; |
| 23 |
const int16_t *bias = output_bias; |
| 24 |
int i_loop_cnt; |
| 25 |
for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++) |
| 26 |
{ |
| 27 |
int16x8_t out_0 = vldrhq_s16(bias); |
| 28 |
vstrbq_s16(out, out_0); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
void |
| 33 |
foo2 (const int32_t *output_bias, int16_t *out, uint16_t num_ch) |
| 34 |
{ |
| 35 |
int32_t loop_count = num_ch; |
| 36 |
const int32_t *bias = output_bias; |
| 37 |
int i_loop_cnt; |
| 38 |
for (; i_loop_cnt < loop_count; out += 4, i_loop_cnt++) |
| 39 |
{ |
| 40 |
int32x4_t out_0 = vldrwq_s32(bias); |
| 41 |
vstrhq_s32(out, out_0); |
| 42 |
} |
| 43 |
} |