| 1 |
/* { dg-skip-if "" { arm*-*-* } } */ |
| 2 |
|
| 3 |
#include <arm_neon.h> |
| 4 |
#include "arm-neon-ref.h" |
| 5 |
#include "compute-ref-data.h" |
| 6 |
|
| 7 |
/* Expected results. */ |
| 8 |
VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x4000, 0x4000, 0x4000, 0x4000 }; |
| 9 |
VECT_VAR_DECL(expected, int, 64, 2) [] = { 0x2000, 0x2000 }; |
| 10 |
VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x4000, 0x4000, 0x4000, 0x4000 }; |
| 11 |
VECT_VAR_DECL(expected, uint, 64, 2) [] = { 0x2000, 0x2000 }; |
| 12 |
|
| 13 |
#define TEST_MSG "VMULL_HIGH_LANE" |
| 14 |
void exec_vmull_high_lane (void) |
| 15 |
{ |
| 16 |
/* vector_res = vmull_high_lane(vector, vector2, lane), store the result. */ |
| 17 |
#define TEST_VMULL_HIGH_LANE(T1, T2, W1, W2, N1, N2, L) \ |
| 18 |
VECT_VAR(vector_res, T1, W2, N2) = \ |
| 19 |
vmull_high_lane_##T2##W1(VECT_VAR(vector, T1, W1, N1), \ |
| 20 |
VECT_VAR(vector2, T1, W1, N2), \ |
| 21 |
L); \ |
| 22 |
vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), \ |
| 23 |
VECT_VAR(vector_res, T1, W2, N2)) |
| 24 |
|
| 25 |
DECL_VARIABLE(vector, int, 16, 8); |
| 26 |
DECL_VARIABLE(vector, int, 32, 4); |
| 27 |
DECL_VARIABLE(vector, uint, 16, 8); |
| 28 |
DECL_VARIABLE(vector, uint, 32, 4); |
| 29 |
DECL_VARIABLE(vector2, int, 16, 4); |
| 30 |
DECL_VARIABLE(vector2, int, 32, 2); |
| 31 |
DECL_VARIABLE(vector2, uint, 16, 4); |
| 32 |
DECL_VARIABLE(vector2, uint, 32, 2); |
| 33 |
|
| 34 |
DECL_VARIABLE(vector_res, int, 32, 4); |
| 35 |
DECL_VARIABLE(vector_res, int, 64, 2); |
| 36 |
DECL_VARIABLE(vector_res, uint, 32, 4); |
| 37 |
DECL_VARIABLE(vector_res, uint, 64, 2); |
| 38 |
|
| 39 |
clean_results (); |
| 40 |
|
| 41 |
/* Initialize vector. */ |
| 42 |
VDUP(vector, q, int, s, 16, 8, 0x1000); |
| 43 |
VDUP(vector, q, int, s, 32, 4, 0x1000); |
| 44 |
VDUP(vector, q, uint, u, 16, 8, 0x1000); |
| 45 |
VDUP(vector, q, uint, u, 32, 4, 0x1000); |
| 46 |
|
| 47 |
/* Initialize vector2. */ |
| 48 |
VDUP(vector2, , int, s, 16, 4, 0x4); |
| 49 |
VDUP(vector2, , int, s, 32, 2, 0x2); |
| 50 |
VDUP(vector2, , uint, u, 16, 4, 0x4); |
| 51 |
VDUP(vector2, , uint, u, 32, 2, 0x2); |
| 52 |
|
| 53 |
/* Choose lane arbitrarily. */ |
| 54 |
TEST_VMULL_HIGH_LANE(int, s, 16, 32, 8, 4, 2); |
| 55 |
TEST_VMULL_HIGH_LANE(int, s, 32, 64, 4, 2, 1); |
| 56 |
TEST_VMULL_HIGH_LANE(uint, u, 16, 32, 8, 4, 2); |
| 57 |
TEST_VMULL_HIGH_LANE(uint, u, 32, 64, 4, 2, 1); |
| 58 |
|
| 59 |
CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, ""); |
| 60 |
CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, ""); |
| 61 |
CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, ""); |
| 62 |
CHECK(TEST_MSG, uint, 64, 2, PRIx64, expected, ""); |
| 63 |
} |
| 64 |
|
| 65 |
int main (void) |
| 66 |
{ |
| 67 |
exec_vmull_high_lane (); |
| 68 |
return 0; |
| 69 |
} |