Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmax.c

raw
1 #include <arm_neon.h>
2 #include "arm-neon-ref.h"
3 #include "compute-ref-data.h"
4
5 #define INSN_NAME vmax
6 #define TEST_MSG "VMAX/VMAXQ"
7
8 #define HAS_FLOAT_VARIANT
9
10 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
11 #define HAS_FLOAT16_VARIANT
12 #endif
13
14 /* Expected results. */
15 VECT_VAR_DECL(expected,int,8,8) [] = { 0xf3, 0xf3, 0xf3, 0xf3,
16 0xf4, 0xf5, 0xf6, 0xf7 };
17 VECT_VAR_DECL(expected,int,16,4) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff3 };
18 VECT_VAR_DECL(expected,int,32,2) [] = { 0xfffffff0, 0xfffffff1 };
19 VECT_VAR_DECL(expected,uint,8,8) [] = { 0xf3, 0xf3, 0xf3, 0xf3,
20 0xf4, 0xf5, 0xf6, 0xf7 };
21 VECT_VAR_DECL(expected,uint,16,4) [] = { 0xfff1, 0xfff1, 0xfff2, 0xfff3 };
22 VECT_VAR_DECL(expected,uint,32,2) [] = { 0xfffffff0, 0xfffffff1 };
23 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
24 VECT_VAR_DECL(expected, hfloat, 16, 4) [] = { 0xcbc0, 0xcb80, 0xcb00, 0xca80 };
25 #endif
26 VECT_VAR_DECL(expected,hfloat,32,2) [] = { 0xc1780000, 0xc1700000 };
27 VECT_VAR_DECL(expected,int,8,16) [] = { 0xf4, 0xf4, 0xf4, 0xf4,
28 0xf4, 0xf5, 0xf6, 0xf7,
29 0xf8, 0xf9, 0xfa, 0xfb,
30 0xfc, 0xfd, 0xfe, 0xff };
31 VECT_VAR_DECL(expected,int,16,8) [] = { 0xfff3, 0xfff3, 0xfff3, 0xfff3,
32 0xfff4, 0xfff5, 0xfff6, 0xfff7 };
33 VECT_VAR_DECL(expected,int,32,4) [] = { 0xfffffff1, 0xfffffff1,
34 0xfffffff2, 0xfffffff3 };
35 VECT_VAR_DECL(expected,uint,8,16) [] = { 0xf9, 0xf9, 0xf9, 0xf9,
36 0xf9, 0xf9, 0xf9, 0xf9,
37 0xf9, 0xf9, 0xfa, 0xfb,
38 0xfc, 0xfd, 0xfe, 0xff };
39 VECT_VAR_DECL(expected,uint,16,8) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff3,
40 0xfff4, 0xfff5, 0xfff6, 0xfff7 };
41 VECT_VAR_DECL(expected,uint,32,4) [] = { 0xfffffff1, 0xfffffff1,
42 0xfffffff2, 0xfffffff3 };
43 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
44 VECT_VAR_DECL(expected, hfloat, 16, 8) [] = { 0xcb40, 0xcb40, 0xcb00, 0xca80,
45 0xca00, 0xc980, 0xc900, 0xc880 };
46 #endif
47 VECT_VAR_DECL(expected,hfloat,32,4) [] = { 0xc1680000, 0xc1680000,
48 0xc1600000, 0xc1500000 };
49
50 /* Expected results with special FP values. */
51 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
52 VECT_VAR_DECL(expected_nan, hfloat, 16, 8) [] = { 0x7e00, 0x7e00,
53 0x7e00, 0x7e00,
54 0x7e00, 0x7e00,
55 0x7e00, 0x7e00 };
56 VECT_VAR_DECL(expected_mnan, hfloat, 16, 8) [] = { 0x7e00, 0x7e00,
57 0x7e00, 0x7e00,
58 0x7e00, 0x7e00,
59 0x7e00, 0x7e00 };
60 VECT_VAR_DECL(expected_inf, hfloat, 16, 8) [] = { 0x7c00, 0x7c00,
61 0x7c00, 0x7c00,
62 0x7c00, 0x7c00,
63 0x7c00, 0x7c00 };
64 VECT_VAR_DECL(expected_minf, hfloat, 16, 8) [] = { 0x3c00, 0x3c00,
65 0x3c00, 0x3c00,
66 0x3c00, 0x3c00,
67 0x3c00, 0x3c00 };
68 VECT_VAR_DECL(expected_zero1, hfloat, 16, 8) [] = { 0x0, 0x0, 0x0, 0x0,
69 0x0, 0x0, 0x0, 0x0 };
70 VECT_VAR_DECL(expected_zero2, hfloat, 16, 8) [] = { 0x0, 0x0, 0x0, 0x0,
71 0x0, 0x0, 0x0, 0x0 };
72 #endif
73 VECT_VAR_DECL(expected_nan,hfloat,32,4) [] = { 0x7fc00000, 0x7fc00000,
74 0x7fc00000, 0x7fc00000 };
75 VECT_VAR_DECL(expected_mnan,hfloat,32,4) [] = { 0x7fc00000, 0x7fc00000,
76 0x7fc00000, 0x7fc00000 };
77 VECT_VAR_DECL(expected_inf,hfloat,32,4) [] = { 0x7f800000, 0x7f800000,
78 0x7f800000, 0x7f800000 };
79 VECT_VAR_DECL(expected_minf,hfloat,32,4) [] = { 0x3f800000, 0x3f800000,
80 0x3f800000, 0x3f800000 };
81 VECT_VAR_DECL(expected_zero1,hfloat,32,4) [] = { 0x0, 0x0, 0x0, 0x0 };
82 VECT_VAR_DECL(expected_zero2,hfloat,32,4) [] = { 0x0, 0x0, 0x0, 0x0 };
83
84 #include "binary_op_no64.inc"