Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 1 | /* |
| 2 | |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 3 | Copyright (c) 2009, 2010, 2011, 2013 STMicroelectronics |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 4 | Written by Christophe Lyon |
| 5 | |
| 6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | of this software and associated documentation files (the "Software"), to deal |
| 8 | in the Software without restriction, including without limitation the rights |
| 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | copies of the Software, and to permit persons to whom the Software is |
| 11 | furnished to do so, subject to the following conditions: |
| 12 | |
| 13 | The above copyright notice and this permission notice shall be included in |
| 14 | all copies or substantial portions of the Software. |
| 15 | |
| 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | THE SOFTWARE. |
| 23 | |
| 24 | */ |
| 25 | |
Christophe Lyon | 1775be0 | 2014-07-10 13:46:54 +0200 | [diff] [blame] | 26 | #if defined(__arm__) || defined(__aarch64__) |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 27 | #include <arm_neon.h> |
| 28 | #else |
Christophe Lyon | 0dab5f7 | 2011-07-19 17:14:09 +0200 | [diff] [blame] | 29 | #include "stm-arm-neon.h" |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 30 | #endif |
| 31 | |
| 32 | #include "stm-arm-neon-ref.h" |
| 33 | |
| 34 | #define TEST_MSG "VREINTERPRET/VREINTERPRETQ" |
| 35 | |
| 36 | void exec_vreinterpret (void) |
| 37 | { |
| 38 | int i; |
| 39 | |
| 40 | /* Basic test: y=vreinterpret(x), then store the result. */ |
| 41 | #define TEST_VREINTERPRET(Q, T1, T2, W, N, TS1, TS2, WS, NS) \ |
| 42 | VECT_VAR(vector_res, T1, W, N) = \ |
| 43 | vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \ |
| 44 | vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ |
| 45 | VECT_VAR(vector_res, T1, W, N)); \ |
| 46 | DUMP(TEST_MSG, T1, W, N, PRIx##W); |
| 47 | |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 48 | #define TEST_VREINTERPRET_POLY(Q, T1, T2, W, N, TS1, TS2, WS, NS) \ |
| 49 | VECT_VAR(vector_res, T1, W, N) = \ |
| 50 | vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \ |
| 51 | vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ |
| 52 | VECT_VAR(vector_res, T1, W, N)); \ |
| 53 | DUMP_POLY(TEST_MSG, T1, W, N, PRIx##W); |
| 54 | |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 55 | #define TEST_VREINTERPRET_FP(Q, T1, T2, W, N, TS1, TS2, WS, NS) \ |
| 56 | VECT_VAR(vector_res, T1, W, N) = \ |
| 57 | vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \ |
| 58 | vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ |
| 59 | VECT_VAR(vector_res, T1, W, N)); \ |
| 60 | DUMP_FP(TEST_MSG, T1, W, N, PRIx##W); |
| 61 | |
Christophe Lyon | d98beba | 2016-08-24 18:02:41 +0200 | [diff] [blame] | 62 | #if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) ) |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 63 | #define TEST_VREINTERPRET_FP16(Q, T1, T2, W, N, TS1, TS2, WS, NS) \ |
| 64 | VECT_VAR(vector_res, T1, W, N) = \ |
| 65 | vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \ |
| 66 | vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ |
| 67 | VECT_VAR(vector_res, T1, W, N)); \ |
| 68 | DUMP_FP16(TEST_MSG, T1, W, N, PRIx##W); |
| 69 | #endif |
| 70 | |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 71 | /* With ARM RVCT, we need to declare variables before any executable |
| 72 | statement */ |
| 73 | DECL_VARIABLE_ALL_VARIANTS(vector); |
| 74 | DECL_VARIABLE_ALL_VARIANTS(vector_res); |
Christophe Lyon | d98beba | 2016-08-24 18:02:41 +0200 | [diff] [blame] | 75 | #if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) ) |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 76 | DECL_VARIABLE(vector, float, 16, 4); |
| 77 | DECL_VARIABLE(vector_res, float, 16, 4); |
| 78 | DECL_VARIABLE(vector, float, 16, 8); |
| 79 | DECL_VARIABLE(vector_res, float, 16, 8); |
| 80 | #endif |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 81 | |
| 82 | clean_results (); |
| 83 | |
| 84 | |
| 85 | /* Initialize input "vector" from "buffer" */ |
Christophe Lyon | f205367 | 2014-12-16 10:26:00 +0100 | [diff] [blame] | 86 | TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer); |
| 87 | VLOAD(vector, buffer, , float, f, 32, 2); |
| 88 | VLOAD(vector, buffer, q, float, f, 32, 4); |
Christophe Lyon | d98beba | 2016-08-24 18:02:41 +0200 | [diff] [blame] | 89 | #if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) ) |
Christophe Lyon | f205367 | 2014-12-16 10:26:00 +0100 | [diff] [blame] | 90 | VLOAD(vector, buffer, , float, f, 16, 4); |
| 91 | VLOAD(vector, buffer, q, float, f, 16, 8); |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 92 | #endif |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 93 | |
| 94 | /* The same result buffers are used multiple times, so output them |
| 95 | before overwriting them */ |
| 96 | fprintf(ref_file, "\n%s output:\n", TEST_MSG); |
Christophe Lyon | bf21826 | 2014-07-10 15:53:15 +0200 | [diff] [blame] | 97 | fprintf(gcc_tests_file, "\n%s output:\n", TEST_MSG); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 98 | |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 99 | /* vreinterpret_s8_xx */ |
| 100 | TEST_VREINTERPRET(, int, s, 8, 8, int, s, 16, 4); |
| 101 | TEST_VREINTERPRET(, int, s, 8, 8, int, s, 32, 2); |
| 102 | TEST_VREINTERPRET(, int, s, 8, 8, int, s, 64, 1); |
| 103 | TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 8, 8); |
| 104 | TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 16, 4); |
| 105 | TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 32, 2); |
| 106 | TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 107 | TEST_VREINTERPRET(, int, s, 8, 8, poly, p, 8, 8); |
| 108 | TEST_VREINTERPRET(, int, s, 8, 8, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 109 | |
| 110 | /* vreinterpret_s16_xx */ |
| 111 | TEST_VREINTERPRET(, int, s, 16, 4, int, s, 8, 8); |
| 112 | TEST_VREINTERPRET(, int, s, 16, 4, int, s, 32, 2); |
| 113 | TEST_VREINTERPRET(, int, s, 16, 4, int, s, 64, 1); |
| 114 | TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 8, 8); |
| 115 | TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 16, 4); |
| 116 | TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 32, 2); |
| 117 | TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 118 | TEST_VREINTERPRET(, int, s, 16, 4, poly, p, 8, 8); |
| 119 | TEST_VREINTERPRET(, int, s, 16, 4, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 120 | |
| 121 | /* vreinterpret_s32_xx */ |
| 122 | TEST_VREINTERPRET(, int, s, 32, 2, int, s, 8, 8); |
| 123 | TEST_VREINTERPRET(, int, s, 32, 2, int, s, 16, 4); |
| 124 | TEST_VREINTERPRET(, int, s, 32, 2, int, s, 64, 1); |
| 125 | TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 8, 8); |
| 126 | TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 16, 4); |
| 127 | TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 32, 2); |
| 128 | TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 129 | TEST_VREINTERPRET(, int, s, 32, 2, poly, p, 8, 8); |
| 130 | TEST_VREINTERPRET(, int, s, 32, 2, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 131 | |
| 132 | /* vreinterpret_s64_xx */ |
| 133 | TEST_VREINTERPRET(, int, s, 64, 1, int, s, 8, 8); |
| 134 | TEST_VREINTERPRET(, int, s, 64, 1, int, s, 16, 4); |
| 135 | TEST_VREINTERPRET(, int, s, 64, 1, int, s, 32, 2); |
| 136 | TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 8, 8); |
| 137 | TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 16, 4); |
| 138 | TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 32, 2); |
| 139 | TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 140 | TEST_VREINTERPRET(, int, s, 64, 1, poly, p, 8, 8); |
| 141 | TEST_VREINTERPRET(, int, s, 64, 1, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 142 | |
| 143 | /* vreinterpret_u8_xx */ |
| 144 | TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 8, 8); |
| 145 | TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 16, 4); |
| 146 | TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 32, 2); |
| 147 | TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 64, 1); |
| 148 | TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 16, 4); |
| 149 | TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 32, 2); |
| 150 | TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 151 | TEST_VREINTERPRET(, uint, u, 8, 8, poly, p, 8, 8); |
| 152 | TEST_VREINTERPRET(, uint, u, 8, 8, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 153 | |
| 154 | /* vreinterpret_u16_xx */ |
| 155 | TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 8, 8); |
| 156 | TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 16, 4); |
| 157 | TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 32, 2); |
| 158 | TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 64, 1); |
| 159 | TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 8, 8); |
| 160 | TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 32, 2); |
| 161 | TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 162 | TEST_VREINTERPRET(, uint, u, 16, 4, poly, p, 8, 8); |
| 163 | TEST_VREINTERPRET(, uint, u, 16, 4, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 164 | |
| 165 | /* vreinterpret_u32_xx */ |
| 166 | TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 8, 8); |
| 167 | TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 16, 4); |
| 168 | TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 32, 2); |
| 169 | TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 64, 1); |
| 170 | TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 8, 8); |
| 171 | TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 16, 4); |
| 172 | TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 173 | TEST_VREINTERPRET(, uint, u, 32, 2, poly, p, 8, 8); |
| 174 | TEST_VREINTERPRET(, uint, u, 32, 2, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 175 | |
| 176 | /* vreinterpret_u64_xx */ |
| 177 | TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 8, 8); |
| 178 | TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 16, 4); |
| 179 | TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 32, 2); |
| 180 | TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 64, 1); |
| 181 | TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 8, 8); |
| 182 | TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 16, 4); |
| 183 | TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 32, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 184 | TEST_VREINTERPRET(, uint, u, 64, 1, poly, p, 8, 8); |
| 185 | TEST_VREINTERPRET(, uint, u, 64, 1, poly, p, 16, 4); |
| 186 | |
| 187 | /* vreinterpret_p8_xx */ |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 188 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 8, 8); |
| 189 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 16, 4); |
| 190 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 32, 2); |
| 191 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 64, 1); |
| 192 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 8, 8); |
| 193 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 16, 4); |
| 194 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 32, 2); |
| 195 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 64, 1); |
| 196 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, poly, p, 16, 4); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 197 | |
| 198 | /* vreinterpret_p16_xx */ |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 199 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 8, 8); |
| 200 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 16, 4); |
| 201 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 32, 2); |
| 202 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 64, 1); |
| 203 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 8, 8); |
| 204 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 16, 4); |
| 205 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 32, 2); |
| 206 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 64, 1); |
| 207 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, poly, p, 8, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 208 | |
| 209 | /* vreinterpretq_s8_xx */ |
| 210 | TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 16, 8); |
| 211 | TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 32, 4); |
| 212 | TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 64, 2); |
| 213 | TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 8, 16); |
| 214 | TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 16, 8); |
| 215 | TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 32, 4); |
| 216 | TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 217 | TEST_VREINTERPRET(q, int, s, 8, 16, poly, p, 8, 16); |
| 218 | TEST_VREINTERPRET(q, int, s, 8, 16, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 219 | |
| 220 | /* vreinterpretq_s16_xx */ |
| 221 | TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 8, 16); |
| 222 | TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 32, 4); |
| 223 | TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 64, 2); |
| 224 | TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 8, 16); |
| 225 | TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 16, 8); |
| 226 | TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 32, 4); |
| 227 | TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 228 | TEST_VREINTERPRET(q, int, s, 16, 8, poly, p, 8, 16); |
| 229 | TEST_VREINTERPRET(q, int, s, 16, 8, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 230 | |
| 231 | /* vreinterpretq_s32_xx */ |
| 232 | TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 8, 16); |
| 233 | TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 16, 8); |
| 234 | TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 64, 2); |
| 235 | TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 8, 16); |
| 236 | TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 16, 8); |
| 237 | TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 32, 4); |
| 238 | TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 239 | TEST_VREINTERPRET(q, int, s, 32, 4, poly, p, 8, 16); |
| 240 | TEST_VREINTERPRET(q, int, s, 32, 4, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 241 | |
| 242 | /* vreinterpretq_s64_xx */ |
| 243 | TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 8, 16); |
| 244 | TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 16, 8); |
| 245 | TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 32, 4); |
| 246 | TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 8, 16); |
| 247 | TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 16, 8); |
| 248 | TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 32, 4); |
| 249 | TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 250 | TEST_VREINTERPRET(q, int, s, 64, 2, poly, p, 8, 16); |
| 251 | TEST_VREINTERPRET(q, int, s, 64, 2, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 252 | |
| 253 | /* vreinterpretq_u16_xx */ |
| 254 | TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 8, 16); |
| 255 | TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 16, 8); |
| 256 | TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 32, 4); |
| 257 | TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 64, 2); |
| 258 | TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 8, 16); |
| 259 | TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 32, 4); |
| 260 | TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 261 | TEST_VREINTERPRET(q, uint, u, 16, 8, poly, p, 8, 16); |
| 262 | TEST_VREINTERPRET(q, uint, u, 16, 8, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 263 | |
| 264 | /* vreinterpretq_u32_xx */ |
| 265 | TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 8, 16); |
| 266 | TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 16, 8); |
| 267 | TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 32, 4); |
| 268 | TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 64, 2); |
| 269 | TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 8, 16); |
| 270 | TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 16, 8); |
| 271 | TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 272 | TEST_VREINTERPRET(q, uint, u, 32, 4, poly, p, 8, 16); |
| 273 | TEST_VREINTERPRET(q, uint, u, 32, 4, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 274 | |
| 275 | /* vreinterpretq_u64_xx */ |
| 276 | TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 8, 16); |
| 277 | TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 16, 8); |
| 278 | TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 32, 4); |
| 279 | TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 64, 2); |
| 280 | TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 8, 16); |
| 281 | TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 16, 8); |
| 282 | TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 32, 4); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 283 | TEST_VREINTERPRET(q, uint, u, 64, 2, poly, p, 8, 16); |
| 284 | TEST_VREINTERPRET(q, uint, u, 64, 2, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 285 | |
| 286 | /* vreinterpretq_u8_xx */ |
| 287 | TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 8, 16); |
| 288 | TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 16, 8); |
| 289 | TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 32, 4); |
| 290 | TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 64, 2); |
| 291 | TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 16, 8); |
| 292 | TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 32, 4); |
| 293 | TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 294 | TEST_VREINTERPRET(q, uint, u, 8, 16, poly, p, 8, 16); |
| 295 | TEST_VREINTERPRET(q, uint, u, 8, 16, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 296 | |
| 297 | /* vreinterpret_f32_xx */ |
| 298 | TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 8, 8); |
| 299 | TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 16, 4); |
| 300 | TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 32, 2); |
| 301 | TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 64, 1); |
| 302 | TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 8, 8); |
| 303 | TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 16, 4); |
| 304 | TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 32, 2); |
| 305 | TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 64, 1); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 306 | TEST_VREINTERPRET_FP(, float, f, 32, 2, poly, p, 8, 8); |
| 307 | TEST_VREINTERPRET_FP(, float, f, 32, 2, poly, p, 16, 4); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 308 | |
| 309 | /* vreinterpretq_f32_xx */ |
| 310 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 8, 16); |
| 311 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 16, 8); |
| 312 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 32, 4); |
| 313 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 64, 2); |
| 314 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 8, 16); |
| 315 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 16, 8); |
| 316 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 32, 4); |
| 317 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 64, 2); |
Christophe Lyon | 80902f6 | 2013-03-29 16:26:42 +0100 | [diff] [blame] | 318 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, poly, p, 8, 16); |
| 319 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, poly, p, 16, 8); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 320 | |
| 321 | /* vreinterpret_xx_f32 */ |
| 322 | TEST_VREINTERPRET(, int, s, 8, 8, float, f, 32, 2); |
| 323 | TEST_VREINTERPRET(, int, s, 16, 4, float, f, 32, 2); |
| 324 | TEST_VREINTERPRET(, int, s, 32, 2, float, f, 32, 2); |
| 325 | TEST_VREINTERPRET(, int, s, 64, 1, float, f, 32, 2); |
| 326 | TEST_VREINTERPRET(, uint, u, 8, 8, float, f, 32, 2); |
| 327 | TEST_VREINTERPRET(, uint, u, 16, 4, float, f, 32, 2); |
| 328 | TEST_VREINTERPRET(, uint, u, 32, 2, float, f, 32, 2); |
| 329 | TEST_VREINTERPRET(, uint, u, 64, 1, float, f, 32, 2); |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 330 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, float, f, 32, 2); |
| 331 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, float, f, 32, 2); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 332 | |
| 333 | /* vreinterpretq_xx_f32 */ |
| 334 | TEST_VREINTERPRET(q, int, s, 8, 16, float, f, 32, 4); |
| 335 | TEST_VREINTERPRET(q, int, s, 16, 8, float, f, 32, 4); |
| 336 | TEST_VREINTERPRET(q, int, s, 32, 4, float, f, 32, 4); |
| 337 | TEST_VREINTERPRET(q, int, s, 64, 2, float, f, 32, 4); |
| 338 | TEST_VREINTERPRET(q, uint, u, 8, 16, float, f, 32, 4); |
| 339 | TEST_VREINTERPRET(q, uint, u, 16, 8, float, f, 32, 4); |
| 340 | TEST_VREINTERPRET(q, uint, u, 32, 4, float, f, 32, 4); |
| 341 | TEST_VREINTERPRET(q, uint, u, 64, 2, float, f, 32, 4); |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 342 | TEST_VREINTERPRET_POLY(q, poly, p, 8, 16, float, f, 32, 4); |
| 343 | TEST_VREINTERPRET_POLY(q, poly, p, 16, 8, float, f, 32, 4); |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 344 | |
Christophe Lyon | d98beba | 2016-08-24 18:02:41 +0200 | [diff] [blame] | 345 | #if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) ) |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 346 | /* vreinterpret_f16_xx */ |
| 347 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 8, 8); |
| 348 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 16, 4); |
| 349 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 32, 2); |
| 350 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 64, 1); |
| 351 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 8, 8); |
| 352 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 16, 4); |
| 353 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 32, 2); |
| 354 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 64, 1); |
| 355 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, poly, p, 8, 8); |
| 356 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, poly, p, 16, 4); |
| 357 | TEST_VREINTERPRET_FP16(, float, f, 16, 4, float, f, 32, 2); |
| 358 | |
| 359 | /* vreinterpretq_f16_xx */ |
| 360 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 8, 16); |
| 361 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 16, 8); |
| 362 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 32, 4); |
| 363 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 64, 2); |
| 364 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 8, 16); |
| 365 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 16, 8); |
| 366 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 32, 4); |
| 367 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 64, 2); |
| 368 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, poly, p, 8, 16); |
| 369 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, poly, p, 16, 8); |
| 370 | TEST_VREINTERPRET_FP16(q, float, f, 16, 8, float, f, 32, 4); |
| 371 | |
| 372 | /* vreinterpret_xx_f16 */ |
| 373 | TEST_VREINTERPRET(, int, s, 8, 8, float, f, 16, 4); |
| 374 | TEST_VREINTERPRET(, int, s, 16, 4, float, f, 16, 4); |
| 375 | TEST_VREINTERPRET(, int, s, 32, 2, float, f, 16, 4); |
| 376 | TEST_VREINTERPRET(, int, s, 64, 1, float, f, 16, 4); |
| 377 | TEST_VREINTERPRET(, uint, u, 8, 8, float, f, 16, 4); |
| 378 | TEST_VREINTERPRET(, uint, u, 16, 4, float, f, 16, 4); |
| 379 | TEST_VREINTERPRET(, uint, u, 32, 2, float, f, 16, 4); |
| 380 | TEST_VREINTERPRET(, uint, u, 64, 1, float, f, 16, 4); |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 381 | TEST_VREINTERPRET_POLY(, poly, p, 8, 8, float, f, 16, 4); |
| 382 | TEST_VREINTERPRET_POLY(, poly, p, 16, 4, float, f, 16, 4); |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 383 | TEST_VREINTERPRET_FP(, float, f, 32, 2, float, f, 16, 4); |
| 384 | |
| 385 | /* vreinterpretq_xx_f16 */ |
| 386 | TEST_VREINTERPRET(q, int, s, 8, 16, float, f, 16, 8); |
| 387 | TEST_VREINTERPRET(q, int, s, 16, 8, float, f, 16, 8); |
| 388 | TEST_VREINTERPRET(q, int, s, 32, 4, float, f, 16, 8); |
| 389 | TEST_VREINTERPRET(q, int, s, 64, 2, float, f, 16, 8); |
| 390 | TEST_VREINTERPRET(q, uint, u, 8, 16, float, f, 16, 8); |
| 391 | TEST_VREINTERPRET(q, uint, u, 16, 8, float, f, 16, 8); |
| 392 | TEST_VREINTERPRET(q, uint, u, 32, 4, float, f, 16, 8); |
| 393 | TEST_VREINTERPRET(q, uint, u, 64, 2, float, f, 16, 8); |
Christophe Lyon | d9ab3e3 | 2014-07-11 16:44:32 +0200 | [diff] [blame] | 394 | TEST_VREINTERPRET_POLY(q, poly, p, 8, 16, float, f, 16, 8); |
| 395 | TEST_VREINTERPRET_POLY(q, poly, p, 16, 8, float, f, 16, 8); |
Christophe Lyon | 34adaf6 | 2013-04-11 15:05:18 +0200 | [diff] [blame] | 396 | TEST_VREINTERPRET_FP(q, float, f, 32, 4, float, f, 16, 8); |
| 397 | #endif |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 398 | } |