| 1 |
/* PR target/99195. */ |
| 2 |
/* Check that we take advantage of 64-bit Advanced SIMD operations clearing |
| 3 |
the top half of the vector register and no explicit zeroing instructions |
| 4 |
are emitted. */ |
| 5 |
/* { dg-do compile } */ |
| 6 |
/* { dg-options "-O -march=armv8.3-a+fp16" } */ |
| 7 |
|
| 8 |
#include <arm_neon.h> |
| 9 |
|
| 10 |
#define BINARY(OT,IT,OP,S) \ |
| 11 |
OT \ |
| 12 |
foo_##OP##_##S (IT a, IT b, IT c) \ |
| 13 |
{ \ |
| 14 |
IT zeros = vcreate_##S (0); \ |
| 15 |
return vcombine_##S (v##OP##_##S (a, b), zeros); \ |
| 16 |
} |
| 17 |
|
| 18 |
#define FUNC(T,IS,OS,OP,S) BINARY (T##x##OS##_t, T##x##IS##_t, OP, S) |
| 19 |
|
| 20 |
#define OPTWO(T,IS,OS,S,OP1,OP2) \ |
| 21 |
FUNC (T, IS, OS, OP1, S) \ |
| 22 |
FUNC (T, IS, OS, OP2, S) |
| 23 |
|
| 24 |
#define OPTHREE(T, IS, OS, S, OP1, OP2, OP3) \ |
| 25 |
FUNC (T, IS, OS, OP1, S) \ |
| 26 |
OPTWO (T, IS, OS, S, OP2, OP3) |
| 27 |
|
| 28 |
#define OPFOUR(T,IS,OS,S,OP1,OP2,OP3,OP4) \ |
| 29 |
FUNC (T, IS, OS, OP1, S) \ |
| 30 |
OPTHREE (T, IS, OS, S, OP2, OP3, OP4) |
| 31 |
|
| 32 |
OPTWO (float16, 4, 8, f16, cadd_rot90, cadd_rot270) |
| 33 |
OPTWO (float32, 2, 4, f32, cadd_rot90, cadd_rot270) |
| 34 |
|
| 35 |
#define TERNARY(OT,IT,OP,S) \ |
| 36 |
OT \ |
| 37 |
foo_##OP##_##S (IT a, IT b, IT c) \ |
| 38 |
{ \ |
| 39 |
IT zeros = vcreate_##S (0); \ |
| 40 |
return vcombine_##S (v##OP##_##S (a, b, c), zeros); \ |
| 41 |
} |
| 42 |
|
| 43 |
#undef FUNC |
| 44 |
#define FUNC(T,IS,OS,OP,S) TERNARY (T##x##OS##_t, T##x##IS##_t, OP, S) |
| 45 |
|
| 46 |
OPFOUR (float16, 4, 8, f16, cmla, cmla_rot90, cmla_rot180, cmla_rot270) |
| 47 |
OPFOUR (float32, 2, 4, f32, cmla, cmla_rot90, cmla_rot180, cmla_rot270) |
| 48 |
|
| 49 |
#define TERNARY_IDX(OT,IT,OP,S) \ |
| 50 |
OT \ |
| 51 |
foo_##OP##_##S (IT a, IT b, IT c) \ |
| 52 |
{ \ |
| 53 |
IT zeros = vcreate_##S (0); \ |
| 54 |
return vcombine_##S (v##OP##_##S (a, b, c, 0), zeros); \ |
| 55 |
} |
| 56 |
|
| 57 |
#undef FUNC |
| 58 |
#define FUNC(T,IS,OS,OP,S) TERNARY_IDX (T##x##OS##_t, T##x##IS##_t, OP, S) |
| 59 |
OPFOUR (float16, 4, 8, f16, cmla_lane, cmla_rot90_lane, cmla_rot180_lane, cmla_rot270_lane) |
| 60 |
OPFOUR (float32, 2, 4, f32, cmla_lane, cmla_rot90_lane, cmla_rot180_lane, cmla_rot270_lane) |
| 61 |
|
| 62 |
/* { dg-final { scan-assembler-not {\tfmov\t} } } */ |
| 63 |
/* { dg-final { scan-assembler-not {\tmov\t} } } */ |
| 64 |
|