| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ |
| 3 |
/* { dg-add-options arm_v8_1m_mve_fp } */ |
| 4 |
/* { dg-additional-options "-O3" } */ |
| 5 |
|
| 6 |
#include <stdint.h> |
| 7 |
|
| 8 |
void test_vmul_i32 (int32_t * dest, int32_t * a, int32_t * b) { |
| 9 |
int i; |
| 10 |
for (i=0; i<4; i++) { |
| 11 |
dest[i] = a[i] * b[i]; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
void test_vmul_i32_u (uint32_t * dest, uint32_t * a, uint32_t * b) { |
| 16 |
int i; |
| 17 |
for (i=0; i<4; i++) { |
| 18 |
dest[i] = a[i] * b[i]; |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
/* { dg-final { scan-assembler-times {vmul\.i32\tq[0-9]+, q[0-9]+, q[0-9]+} 2 } } */ |
| 23 |
|
| 24 |
void test_vmul_i16 (int16_t * dest, int16_t * a, int16_t * b) { |
| 25 |
int i; |
| 26 |
for (i=0; i<8; i++) { |
| 27 |
dest[i] = a[i] * b[i]; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
void test_vmul_i16_u (uint16_t * dest, uint16_t * a, uint16_t * b) { |
| 32 |
int i; |
| 33 |
for (i=0; i<8; i++) { |
| 34 |
dest[i] = a[i] * b[i]; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
/* { dg-final { scan-assembler-times {vmul\.i16\tq[0-9]+, q[0-9]+, q[0-9]+} 2 } } */ |
| 39 |
|
| 40 |
void test_vmul_i8 (int8_t * dest, int8_t * a, int8_t * b) { |
| 41 |
int i; |
| 42 |
for (i=0; i<16; i++) { |
| 43 |
dest[i] = a[i] * b[i]; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
void test_vmul_i8_u (uint8_t * dest, uint8_t * a, uint8_t * b) { |
| 48 |
int i; |
| 49 |
for (i=0; i<16; i++) { |
| 50 |
dest[i] = a[i] * b[i]; |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
/* { dg-final { scan-assembler-times {vmul\.i8\tq[0-9]+, q[0-9]+, q[0-9]+} 2 } } */ |
| 55 |
|
| 56 |
void test_vmul_f32 (float * dest, float * a, float * b) { |
| 57 |
int i; |
| 58 |
for (i=0; i<4; i++) { |
| 59 |
dest[i] = a[i] * b[i]; |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
/* { dg-final { scan-assembler-times {vmul\.f32\tq[0-9]+, q[0-9]+, q[0-9]+} 1 } } */ |
| 64 |
|