| 1 | /*===---- riscv_packed_simd.h - RISC-V P intrinsics ------------------------=== |
| 2 | * |
| 3 | * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | * See https://llvm.org/LICENSE.txt for license information. |
| 5 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | * |
| 7 | *===-----------------------------------------------------------------------=== |
| 8 | */ |
| 9 | |
| 10 | #ifndef __RISCV_PACKED_SIMD_H |
| 11 | #define __RISCV_PACKED_SIMD_H |
| 12 | |
| 13 | #include <stdint.h> |
| 14 | |
| 15 | #if defined(__cplusplus) |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
| 19 | /* Packed SIMD Types */ |
| 20 | |
| 21 | typedef int8_t int8x4_t __attribute__((__vector_size__(4))); |
| 22 | typedef uint8_t uint8x4_t __attribute__((__vector_size__(4))); |
| 23 | typedef int16_t int16x2_t __attribute__((__vector_size__(4))); |
| 24 | typedef uint16_t uint16x2_t __attribute__((__vector_size__(4))); |
| 25 | |
| 26 | typedef int8_t int8x8_t __attribute__((__vector_size__(8))); |
| 27 | typedef uint8_t uint8x8_t __attribute__((__vector_size__(8))); |
| 28 | typedef int16_t int16x4_t __attribute__((__vector_size__(8))); |
| 29 | typedef uint16_t uint16x4_t __attribute__((__vector_size__(8))); |
| 30 | typedef int32_t int32x2_t __attribute__((__vector_size__(8))); |
| 31 | typedef uint32_t uint32x2_t __attribute__((__vector_size__(8))); |
| 32 | |
| 33 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) |
| 34 | |
| 35 | #define __packed_splat2(ty, x) ((ty){(x), (x)}) |
| 36 | #define __packed_splat4(ty, x) ((ty){(x), (x), (x), (x)}) |
| 37 | #define __packed_splat8(ty, x) ((ty){(x), (x), (x), (x), (x), (x), (x), (x)}) |
| 38 | |
| 39 | #define __packed_splat(name, ty, scalar_ty, splat) \ |
| 40 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(scalar_ty __x) { \ |
| 41 | return splat(ty, __x); \ |
| 42 | } |
| 43 | |
| 44 | #define __packed_shift(name, ty, op, mask) \ |
| 45 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 46 | unsigned __rs2) { \ |
| 47 | return __rs1 op(__rs2 & (mask)); \ |
| 48 | } |
| 49 | #define __packed_shift8(name, ty, op) __packed_shift(name, ty, op, 0x7) |
| 50 | #define __packed_shift16(name, ty, op) __packed_shift(name, ty, op, 0xf) |
| 51 | #define __packed_shift32(name, ty, op) __packed_shift(name, ty, op, 0x1f) |
| 52 | |
| 53 | #define __packed_scalar_binary_op(name, ty, scalar_ty, op, splat) \ |
| 54 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 55 | scalar_ty __rs2) { \ |
| 56 | return __rs1 op splat(ty, __rs2); \ |
| 57 | } |
| 58 | |
| 59 | #define __packed_binary_op(name, ty, op) \ |
| 60 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \ |
| 61 | return __rs1 op __rs2; \ |
| 62 | } |
| 63 | |
| 64 | #define __packed_unary_op(name, ty, op) \ |
| 65 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 66 | return op __rs1; \ |
| 67 | } |
| 68 | |
| 69 | #define __packed_binary_builtin(name, ty, builtin) \ |
| 70 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \ |
| 71 | return builtin(__rs1, __rs2); \ |
| 72 | } |
| 73 | |
| 74 | #define __packed_sh1add(name, ty) \ |
| 75 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \ |
| 76 | return (__rs1 << 1) + __rs2; \ |
| 77 | } |
| 78 | |
| 79 | /* TODO: switch to sadd_sat(__builtin_elementwise_shl_sat(a, 1), b) once a |
| 80 | * generic elementwise shl_sat builtin exists. sadd_sat(a, a) is equivalent |
| 81 | * for signed types and the backend's saturating_shl1 PatFrags matches both |
| 82 | * shapes. */ |
| 83 | #define __packed_sh1sadd(name, ty) \ |
| 84 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2) { \ |
| 85 | return __builtin_elementwise_add_sat( \ |
| 86 | __builtin_elementwise_add_sat(__rs1, __rs1), __rs2); \ |
| 87 | } |
| 88 | |
| 89 | #define __packed_cmp(name, ty, rty, op) \ |
| 90 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 91 | ty __rs2) { \ |
| 92 | return (rty)(__rs1 op __rs2); \ |
| 93 | } |
| 94 | |
| 95 | #define __packed_pabs(name, ty, rty) \ |
| 96 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 97 | return (rty)__builtin_elementwise_abs(__rs1); \ |
| 98 | } |
| 99 | |
| 100 | #define __packed_binary_builtin_cast(name, ty, rty, builtin) \ |
| 101 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 102 | ty __rs2) { \ |
| 103 | return (rty)builtin(__rs1, __rs2); \ |
| 104 | } |
| 105 | |
| 106 | #define __packed_reduction(name, rty, ty, builtin) \ |
| 107 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 108 | rty __rs2) { \ |
| 109 | return builtin(__rs1, __rs2); \ |
| 110 | } |
| 111 | |
| 112 | #define __packed_merge_builtin(name, ty, mask_ty, builtin) \ |
| 113 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, ty __rs2, \ |
| 114 | mask_ty __rd) { \ |
| 115 | return (ty)builtin(__rs1, __rs2, __rd); \ |
| 116 | } |
| 117 | |
| 118 | #define __packed_psabs(name, ty, builtin) \ |
| 119 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 120 | return builtin(__rs1); \ |
| 121 | } |
| 122 | |
| 123 | #define __packed_widen_convert(name, rty, ty) \ |
| 124 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 125 | return __builtin_convertvector(__rs1, rty); \ |
| 126 | } |
| 127 | #define __packed_widen_high2(name, rty, ty) \ |
| 128 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 129 | return (rty)__builtin_shufflevector((ty){0}, __rs1, 0, 2, 1, 3); \ |
| 130 | } |
| 131 | #define __packed_widen_high4(name, rty, ty) \ |
| 132 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 133 | return (rty)__builtin_shufflevector((ty){0}, __rs1, 0, 4, 1, 5, 2, 6, 3, \ |
| 134 | 7); \ |
| 135 | } |
| 136 | |
| 137 | /* Packed Reverse: reverse the order of the elements. Lowered to a single |
| 138 | * rev8/rev16/ppairoe.* by the backend's packed reverse-shuffle handling. */ |
| 139 | #define __packed_reverse2(name, ty) \ |
| 140 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 141 | return __builtin_shufflevector(__rs1, __rs1, 1, 0); \ |
| 142 | } |
| 143 | #define __packed_reverse4(name, ty) \ |
| 144 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 145 | return __builtin_shufflevector(__rs1, __rs1, 3, 2, 1, 0); \ |
| 146 | } |
| 147 | #define __packed_reverse8(name, ty) \ |
| 148 | static __inline__ ty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 149 | return __builtin_shufflevector(__rs1, __rs1, 7, 6, 5, 4, 3, 2, 1, 0); \ |
| 150 | } |
| 151 | |
| 152 | #define __packed_zip2(name, rty, ty) \ |
| 153 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 154 | ty __rs2) { \ |
| 155 | return __builtin_shufflevector(__rs1, __rs2, 0, 2, 1, 3); \ |
| 156 | } |
| 157 | #define __packed_zip4(name, rty, ty) \ |
| 158 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 159 | ty __rs2) { \ |
| 160 | return __builtin_shufflevector(__rs1, __rs2, 0, 4, 1, 5, 2, 6, 3, 7); \ |
| 161 | } |
| 162 | #define __packed_unzipe2(name, rty, ty) \ |
| 163 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 164 | return __builtin_shufflevector(__rs1, __rs1, 0, 2); \ |
| 165 | } |
| 166 | #define __packed_unzipe4(name, rty, ty) \ |
| 167 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 168 | return __builtin_shufflevector(__rs1, __rs1, 0, 2, 4, 6); \ |
| 169 | } |
| 170 | #define __packed_unzipo2(name, rty, ty) \ |
| 171 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 172 | return __builtin_shufflevector(__rs1, __rs1, 1, 3); \ |
| 173 | } |
| 174 | #define __packed_unzipo4(name, rty, ty) \ |
| 175 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) { \ |
| 176 | return __builtin_shufflevector(__rs1, __rs1, 1, 3, 5, 7); \ |
| 177 | } |
| 178 | |
| 179 | #define __packed_abdsum(name, rty, ty, builtin) \ |
| 180 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1, \ |
| 181 | ty __rs2) { \ |
| 182 | return builtin(__rs1, __rs2); \ |
| 183 | } |
| 184 | |
| 185 | #define __packed_abdsum_acc(name, rty, ty, builtin) \ |
| 186 | static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(rty __rd, ty __rs1, \ |
| 187 | ty __rs2) { \ |
| 188 | return builtin(__rd, __rs1, __rs2); \ |
| 189 | } |
| 190 | |
| 191 | // clang-format off: macro call sites have no trailing semicolons, which |
| 192 | // confuses clang-format into a deeply nested expression. |
| 193 | |
| 194 | /* Packed Splat (32-bit) */ |
| 195 | __packed_splat(pmv_s_u8x4, uint8x4_t, uint8_t, __packed_splat4) |
| 196 | __packed_splat(pmv_s_i8x4, int8x4_t, int8_t, __packed_splat4) |
| 197 | __packed_splat(pmv_s_u16x2, uint16x2_t, uint16_t, __packed_splat2) |
| 198 | __packed_splat(pmv_s_i16x2, int16x2_t, int16_t, __packed_splat2) |
| 199 | |
| 200 | /* Packed Splat (64-bit) */ |
| 201 | __packed_splat(pmv_s_u8x8, uint8x8_t, uint8_t, __packed_splat8) |
| 202 | __packed_splat(pmv_s_i8x8, int8x8_t, int8_t, __packed_splat8) |
| 203 | __packed_splat(pmv_s_u16x4, uint16x4_t, uint16_t, __packed_splat4) |
| 204 | __packed_splat(pmv_s_i16x4, int16x4_t, int16_t, __packed_splat4) |
| 205 | __packed_splat(pmv_s_u32x2, uint32x2_t, uint32_t, __packed_splat2) |
| 206 | __packed_splat(pmv_s_i32x2, int32x2_t, int32_t, __packed_splat2) |
| 207 | |
| 208 | /* Packed Addition and Subtraction (32-bit) */ |
| 209 | __packed_binary_op(padd_i8x4, int8x4_t, +) |
| 210 | __packed_binary_op(padd_u8x4, uint8x4_t, +) |
| 211 | __packed_binary_op(padd_i16x2, int16x2_t, +) |
| 212 | __packed_binary_op(padd_u16x2, uint16x2_t, +) |
| 213 | __packed_binary_op(psub_i8x4, int8x4_t, -) |
| 214 | __packed_binary_op(psub_u8x4, uint8x4_t, -) |
| 215 | __packed_binary_op(psub_i16x2, int16x2_t, -) |
| 216 | __packed_binary_op(psub_u16x2, uint16x2_t, -) |
| 217 | __packed_unary_op(pneg_i8x4, int8x4_t, -) |
| 218 | __packed_unary_op(pneg_i16x2, int16x2_t, -) |
| 219 | |
| 220 | /* Packed Addition and Subtraction (64-bit) */ |
| 221 | __packed_binary_op(padd_i8x8, int8x8_t, +) |
| 222 | __packed_binary_op(padd_u8x8, uint8x8_t, +) |
| 223 | __packed_binary_op(padd_i16x4, int16x4_t, +) |
| 224 | __packed_binary_op(padd_u16x4, uint16x4_t, +) |
| 225 | __packed_binary_op(padd_i32x2, int32x2_t, +) |
| 226 | __packed_binary_op(padd_u32x2, uint32x2_t, +) |
| 227 | __packed_binary_op(psub_i8x8, int8x8_t, -) |
| 228 | __packed_binary_op(psub_u8x8, uint8x8_t, -) |
| 229 | __packed_binary_op(psub_i16x4, int16x4_t, -) |
| 230 | __packed_binary_op(psub_u16x4, uint16x4_t, -) |
| 231 | __packed_binary_op(psub_i32x2, int32x2_t, -) |
| 232 | __packed_binary_op(psub_u32x2, uint32x2_t, -) |
| 233 | __packed_unary_op(pneg_i8x8, int8x8_t, -) |
| 234 | __packed_unary_op(pneg_i16x4, int16x4_t, -) |
| 235 | __packed_unary_op(pneg_i32x2, int32x2_t, -) |
| 236 | |
| 237 | /* Packed Addition with Scalar (32-bit) */ |
| 238 | __packed_scalar_binary_op(padd_s_u8x4, uint8x4_t, uint8_t, +, __packed_splat4) |
| 239 | __packed_scalar_binary_op(padd_s_i8x4, int8x4_t, int8_t, +, __packed_splat4) |
| 240 | __packed_scalar_binary_op(padd_s_u16x2, uint16x2_t, uint16_t, +, |
| 241 | __packed_splat2) |
| 242 | __packed_scalar_binary_op(padd_s_i16x2, int16x2_t, int16_t, +, |
| 243 | __packed_splat2) |
| 244 | |
| 245 | /* Packed Addition with Scalar (64-bit) */ |
| 246 | __packed_scalar_binary_op(padd_s_u8x8, uint8x8_t, uint8_t, +, __packed_splat8) |
| 247 | __packed_scalar_binary_op(padd_s_i8x8, int8x8_t, int8_t, +, __packed_splat8) |
| 248 | __packed_scalar_binary_op(padd_s_u16x4, uint16x4_t, uint16_t, +, |
| 249 | __packed_splat4) |
| 250 | __packed_scalar_binary_op(padd_s_i16x4, int16x4_t, int16_t, +, |
| 251 | __packed_splat4) |
| 252 | __packed_scalar_binary_op(padd_s_u32x2, uint32x2_t, uint32_t, +, |
| 253 | __packed_splat2) |
| 254 | __packed_scalar_binary_op(padd_s_i32x2, int32x2_t, int32_t, +, |
| 255 | __packed_splat2) |
| 256 | |
| 257 | /* Packed Saturating Addition and Subtraction (32-bit) */ |
| 258 | __packed_binary_builtin(psadd_i8x4, int8x4_t, __builtin_elementwise_add_sat) |
| 259 | __packed_binary_builtin(psadd_i16x2, int16x2_t, __builtin_elementwise_add_sat) |
| 260 | __packed_binary_builtin(psaddu_u8x4, uint8x4_t, __builtin_elementwise_add_sat) |
| 261 | __packed_binary_builtin(psaddu_u16x2, uint16x2_t, __builtin_elementwise_add_sat) |
| 262 | __packed_binary_builtin(pssub_i8x4, int8x4_t, __builtin_elementwise_sub_sat) |
| 263 | __packed_binary_builtin(pssub_i16x2, int16x2_t, __builtin_elementwise_sub_sat) |
| 264 | __packed_binary_builtin(pssubu_u8x4, uint8x4_t, __builtin_elementwise_sub_sat) |
| 265 | __packed_binary_builtin(pssubu_u16x2, uint16x2_t, __builtin_elementwise_sub_sat) |
| 266 | |
| 267 | /* Packed Saturating Addition and Subtraction (64-bit) */ |
| 268 | __packed_binary_builtin(psadd_i8x8, int8x8_t, __builtin_elementwise_add_sat) |
| 269 | __packed_binary_builtin(psadd_i16x4, int16x4_t, __builtin_elementwise_add_sat) |
| 270 | __packed_binary_builtin(psadd_i32x2, int32x2_t, __builtin_elementwise_add_sat) |
| 271 | __packed_binary_builtin(psaddu_u8x8, uint8x8_t, __builtin_elementwise_add_sat) |
| 272 | __packed_binary_builtin(psaddu_u16x4, uint16x4_t, __builtin_elementwise_add_sat) |
| 273 | __packed_binary_builtin(psaddu_u32x2, uint32x2_t, __builtin_elementwise_add_sat) |
| 274 | __packed_binary_builtin(pssub_i8x8, int8x8_t, __builtin_elementwise_sub_sat) |
| 275 | __packed_binary_builtin(pssub_i16x4, int16x4_t, __builtin_elementwise_sub_sat) |
| 276 | __packed_binary_builtin(pssub_i32x2, int32x2_t, __builtin_elementwise_sub_sat) |
| 277 | __packed_binary_builtin(pssubu_u8x8, uint8x8_t, __builtin_elementwise_sub_sat) |
| 278 | __packed_binary_builtin(pssubu_u16x4, uint16x4_t, __builtin_elementwise_sub_sat) |
| 279 | __packed_binary_builtin(pssubu_u32x2, uint32x2_t, __builtin_elementwise_sub_sat) |
| 280 | |
| 281 | /* Packed Shift-Add (32-bit) */ |
| 282 | __packed_sh1add(psh1add_i16x2, int16x2_t) |
| 283 | __packed_sh1add(psh1add_u16x2, uint16x2_t) |
| 284 | __packed_sh1sadd(pssh1sadd_i16x2, int16x2_t) |
| 285 | |
| 286 | /* Packed Shift-Add (64-bit) */ |
| 287 | __packed_sh1add(psh1add_i16x4, int16x4_t) |
| 288 | __packed_sh1add(psh1add_u16x4, uint16x4_t) |
| 289 | __packed_sh1add(psh1add_i32x2, int32x2_t) |
| 290 | __packed_sh1add(psh1add_u32x2, uint32x2_t) |
| 291 | __packed_sh1sadd(pssh1sadd_i16x4, int16x4_t) |
| 292 | __packed_sh1sadd(pssh1sadd_i32x2, int32x2_t) |
| 293 | |
| 294 | /* Packed Exchanged Addition and Subtraction (32-bit) */ |
| 295 | __packed_binary_builtin(pas_x_i16x2, int16x2_t, __builtin_riscv_pas_x_i16x2) |
| 296 | __packed_binary_builtin(psa_x_i16x2, int16x2_t, __builtin_riscv_psa_x_i16x2) |
| 297 | __packed_binary_builtin(psas_x_i16x2, int16x2_t, __builtin_riscv_psas_x_i16x2) |
| 298 | __packed_binary_builtin(pssa_x_i16x2, int16x2_t, __builtin_riscv_pssa_x_i16x2) |
| 299 | __packed_binary_builtin(paas_x_i16x2, int16x2_t, __builtin_riscv_paas_x_i16x2) |
| 300 | __packed_binary_builtin(pasa_x_i16x2, int16x2_t, __builtin_riscv_pasa_x_i16x2) |
| 301 | |
| 302 | /* Packed Exchanged Addition and Subtraction (64-bit) */ |
| 303 | __packed_binary_builtin(pas_x_i16x4, int16x4_t, __builtin_riscv_pas_x_i16x4) |
| 304 | __packed_binary_builtin(psa_x_i16x4, int16x4_t, __builtin_riscv_psa_x_i16x4) |
| 305 | __packed_binary_builtin(psas_x_i16x4, int16x4_t, __builtin_riscv_psas_x_i16x4) |
| 306 | __packed_binary_builtin(pssa_x_i16x4, int16x4_t, __builtin_riscv_pssa_x_i16x4) |
| 307 | __packed_binary_builtin(paas_x_i16x4, int16x4_t, __builtin_riscv_paas_x_i16x4) |
| 308 | __packed_binary_builtin(pasa_x_i16x4, int16x4_t, __builtin_riscv_pasa_x_i16x4) |
| 309 | __packed_binary_builtin(pas_x_i32x2, int32x2_t, __builtin_riscv_pas_x_i32x2) |
| 310 | __packed_binary_builtin(psa_x_i32x2, int32x2_t, __builtin_riscv_psa_x_i32x2) |
| 311 | __packed_binary_builtin(psas_x_i32x2, int32x2_t, __builtin_riscv_psas_x_i32x2) |
| 312 | __packed_binary_builtin(pssa_x_i32x2, int32x2_t, __builtin_riscv_pssa_x_i32x2) |
| 313 | __packed_binary_builtin(paas_x_i32x2, int32x2_t, __builtin_riscv_paas_x_i32x2) |
| 314 | __packed_binary_builtin(pasa_x_i32x2, int32x2_t, __builtin_riscv_pasa_x_i32x2) |
| 315 | |
| 316 | /* Packed Minimum and Maximum (32-bit) */ |
| 317 | __packed_binary_builtin(pmin_i8x4, int8x4_t, __builtin_elementwise_min) |
| 318 | __packed_binary_builtin(pmin_i16x2, int16x2_t, __builtin_elementwise_min) |
| 319 | __packed_binary_builtin(pminu_u8x4, uint8x4_t, __builtin_elementwise_min) |
| 320 | __packed_binary_builtin(pminu_u16x2, uint16x2_t, __builtin_elementwise_min) |
| 321 | __packed_binary_builtin(pmax_i8x4, int8x4_t, __builtin_elementwise_max) |
| 322 | __packed_binary_builtin(pmax_i16x2, int16x2_t, __builtin_elementwise_max) |
| 323 | __packed_binary_builtin(pmaxu_u8x4, uint8x4_t, __builtin_elementwise_max) |
| 324 | __packed_binary_builtin(pmaxu_u16x2, uint16x2_t, __builtin_elementwise_max) |
| 325 | |
| 326 | /* Packed Minimum and Maximum (64-bit) */ |
| 327 | __packed_binary_builtin(pmin_i8x8, int8x8_t, __builtin_elementwise_min) |
| 328 | __packed_binary_builtin(pmin_i16x4, int16x4_t, __builtin_elementwise_min) |
| 329 | __packed_binary_builtin(pmin_i32x2, int32x2_t, __builtin_elementwise_min) |
| 330 | __packed_binary_builtin(pminu_u8x8, uint8x8_t, __builtin_elementwise_min) |
| 331 | __packed_binary_builtin(pminu_u16x4, uint16x4_t, __builtin_elementwise_min) |
| 332 | __packed_binary_builtin(pminu_u32x2, uint32x2_t, __builtin_elementwise_min) |
| 333 | __packed_binary_builtin(pmax_i8x8, int8x8_t, __builtin_elementwise_max) |
| 334 | __packed_binary_builtin(pmax_i16x4, int16x4_t, __builtin_elementwise_max) |
| 335 | __packed_binary_builtin(pmax_i32x2, int32x2_t, __builtin_elementwise_max) |
| 336 | __packed_binary_builtin(pmaxu_u8x8, uint8x8_t, __builtin_elementwise_max) |
| 337 | __packed_binary_builtin(pmaxu_u16x4, uint16x4_t, __builtin_elementwise_max) |
| 338 | __packed_binary_builtin(pmaxu_u32x2, uint32x2_t, __builtin_elementwise_max) |
| 339 | |
| 340 | /* Packed Comparison (32-bit) */ |
| 341 | __packed_cmp(pmseq_i8x4_u8x4, int8x4_t, uint8x4_t, ==) |
| 342 | __packed_cmp(pmseq_u8x4_u8x4, uint8x4_t, uint8x4_t, ==) |
| 343 | __packed_cmp(pmsne_i8x4_u8x4, int8x4_t, uint8x4_t, !=) |
| 344 | __packed_cmp(pmsne_u8x4_u8x4, uint8x4_t, uint8x4_t, !=) |
| 345 | __packed_cmp(pmslt_u8x4, int8x4_t, uint8x4_t, <) |
| 346 | __packed_cmp(pmsltu_u8x4, uint8x4_t, uint8x4_t, <) |
| 347 | __packed_cmp(pmsgt_u8x4, int8x4_t, uint8x4_t, >) |
| 348 | __packed_cmp(pmsgtu_u8x4, uint8x4_t, uint8x4_t, >) |
| 349 | __packed_cmp(pmsge_u8x4, int8x4_t, uint8x4_t, >=) |
| 350 | __packed_cmp(pmsgeu_u8x4, uint8x4_t, uint8x4_t, >=) |
| 351 | __packed_cmp(pmsle_u8x4, int8x4_t, uint8x4_t, <=) |
| 352 | __packed_cmp(pmsleu_u8x4, uint8x4_t, uint8x4_t, <=) |
| 353 | __packed_cmp(pmseq_i16x2_u16x2, int16x2_t, uint16x2_t, ==) |
| 354 | __packed_cmp(pmseq_u16x2_u16x2, uint16x2_t, uint16x2_t, ==) |
| 355 | __packed_cmp(pmsne_i16x2_u16x2, int16x2_t, uint16x2_t, !=) |
| 356 | __packed_cmp(pmsne_u16x2_u16x2, uint16x2_t, uint16x2_t, !=) |
| 357 | __packed_cmp(pmslt_u16x2, int16x2_t, uint16x2_t, <) |
| 358 | __packed_cmp(pmsltu_u16x2, uint16x2_t, uint16x2_t, <) |
| 359 | __packed_cmp(pmsgt_u16x2, int16x2_t, uint16x2_t, >) |
| 360 | __packed_cmp(pmsgtu_u16x2, uint16x2_t, uint16x2_t, >) |
| 361 | __packed_cmp(pmsge_u16x2, int16x2_t, uint16x2_t, >=) |
| 362 | __packed_cmp(pmsgeu_u16x2, uint16x2_t, uint16x2_t, >=) |
| 363 | __packed_cmp(pmsle_u16x2, int16x2_t, uint16x2_t, <=) |
| 364 | __packed_cmp(pmsleu_u16x2, uint16x2_t, uint16x2_t, <=) |
| 365 | |
| 366 | /* Packed Comparison (64-bit) */ |
| 367 | __packed_cmp(pmseq_i8x8_u8x8, int8x8_t, uint8x8_t, ==) |
| 368 | __packed_cmp(pmseq_u8x8_u8x8, uint8x8_t, uint8x8_t, ==) |
| 369 | __packed_cmp(pmsne_i8x8_u8x8, int8x8_t, uint8x8_t, !=) |
| 370 | __packed_cmp(pmsne_u8x8_u8x8, uint8x8_t, uint8x8_t, !=) |
| 371 | __packed_cmp(pmslt_u8x8, int8x8_t, uint8x8_t, <) |
| 372 | __packed_cmp(pmsltu_u8x8, uint8x8_t, uint8x8_t, <) |
| 373 | __packed_cmp(pmsgt_u8x8, int8x8_t, uint8x8_t, >) |
| 374 | __packed_cmp(pmsgtu_u8x8, uint8x8_t, uint8x8_t, >) |
| 375 | __packed_cmp(pmsge_u8x8, int8x8_t, uint8x8_t, >=) |
| 376 | __packed_cmp(pmsgeu_u8x8, uint8x8_t, uint8x8_t, >=) |
| 377 | __packed_cmp(pmsle_u8x8, int8x8_t, uint8x8_t, <=) |
| 378 | __packed_cmp(pmsleu_u8x8, uint8x8_t, uint8x8_t, <=) |
| 379 | __packed_cmp(pmseq_i16x4_u16x4, int16x4_t, uint16x4_t, ==) |
| 380 | __packed_cmp(pmseq_u16x4_u16x4, uint16x4_t, uint16x4_t, ==) |
| 381 | __packed_cmp(pmsne_i16x4_u16x4, int16x4_t, uint16x4_t, !=) |
| 382 | __packed_cmp(pmsne_u16x4_u16x4, uint16x4_t, uint16x4_t, !=) |
| 383 | __packed_cmp(pmslt_u16x4, int16x4_t, uint16x4_t, <) |
| 384 | __packed_cmp(pmsltu_u16x4, uint16x4_t, uint16x4_t, <) |
| 385 | __packed_cmp(pmsgt_u16x4, int16x4_t, uint16x4_t, >) |
| 386 | __packed_cmp(pmsgtu_u16x4, uint16x4_t, uint16x4_t, >) |
| 387 | __packed_cmp(pmsge_u16x4, int16x4_t, uint16x4_t, >=) |
| 388 | __packed_cmp(pmsgeu_u16x4, uint16x4_t, uint16x4_t, >=) |
| 389 | __packed_cmp(pmsle_u16x4, int16x4_t, uint16x4_t, <=) |
| 390 | __packed_cmp(pmsleu_u16x4, uint16x4_t, uint16x4_t, <=) |
| 391 | __packed_cmp(pmseq_i32x2_u32x2, int32x2_t, uint32x2_t, ==) |
| 392 | __packed_cmp(pmseq_u32x2_u32x2, uint32x2_t, uint32x2_t, ==) |
| 393 | __packed_cmp(pmsne_i32x2_u32x2, int32x2_t, uint32x2_t, !=) |
| 394 | __packed_cmp(pmsne_u32x2_u32x2, uint32x2_t, uint32x2_t, !=) |
| 395 | __packed_cmp(pmslt_u32x2, int32x2_t, uint32x2_t, <) |
| 396 | __packed_cmp(pmsltu_u32x2, uint32x2_t, uint32x2_t, <) |
| 397 | __packed_cmp(pmsgt_u32x2, int32x2_t, uint32x2_t, >) |
| 398 | __packed_cmp(pmsgtu_u32x2, uint32x2_t, uint32x2_t, >) |
| 399 | __packed_cmp(pmsge_u32x2, int32x2_t, uint32x2_t, >=) |
| 400 | __packed_cmp(pmsgeu_u32x2, uint32x2_t, uint32x2_t, >=) |
| 401 | __packed_cmp(pmsle_u32x2, int32x2_t, uint32x2_t, <=) |
| 402 | __packed_cmp(pmsleu_u32x2, uint32x2_t, uint32x2_t, <=) |
| 403 | |
| 404 | /* Packed Shifts (32-bit) */ |
| 405 | __packed_shift8(psll_s_u8x4, uint8x4_t, <<) |
| 406 | __packed_shift8(psll_s_i8x4, int8x4_t, <<) |
| 407 | __packed_shift16(psll_s_u16x2, uint16x2_t, <<) |
| 408 | __packed_shift16(psll_s_i16x2, int16x2_t, <<) |
| 409 | __packed_shift8(psrl_s_u8x4, uint8x4_t, >>) |
| 410 | __packed_shift16(psrl_s_u16x2, uint16x2_t, >>) |
| 411 | __packed_shift8(psra_s_i8x4, int8x4_t, >>) |
| 412 | __packed_shift16(psra_s_i16x2, int16x2_t, >>) |
| 413 | |
| 414 | /* Packed Shifts (64-bit) */ |
| 415 | __packed_shift8(psll_s_u8x8, uint8x8_t, <<) |
| 416 | __packed_shift8(psll_s_i8x8, int8x8_t, <<) |
| 417 | __packed_shift16(psll_s_u16x4, uint16x4_t, <<) |
| 418 | __packed_shift16(psll_s_i16x4, int16x4_t, <<) |
| 419 | __packed_shift32(psll_s_u32x2, uint32x2_t, <<) |
| 420 | __packed_shift32(psll_s_i32x2, int32x2_t, <<) |
| 421 | __packed_shift8(psrl_s_u8x8, uint8x8_t, >>) |
| 422 | __packed_shift16(psrl_s_u16x4, uint16x4_t, >>) |
| 423 | __packed_shift32(psrl_s_u32x2, uint32x2_t, >>) |
| 424 | __packed_shift8(psra_s_i8x8, int8x8_t, >>) |
| 425 | __packed_shift16(psra_s_i16x4, int16x4_t, >>) |
| 426 | __packed_shift32(psra_s_i32x2, int32x2_t, >>) |
| 427 | |
| 428 | /* Packed Logical Operations (32-bit) */ |
| 429 | __packed_binary_op(pand_i8x4, int8x4_t, &) |
| 430 | __packed_binary_op(pand_u8x4, uint8x4_t, &) |
| 431 | __packed_binary_op(pand_i16x2, int16x2_t, &) |
| 432 | __packed_binary_op(pand_u16x2, uint16x2_t, &) |
| 433 | __packed_binary_op(por_i8x4, int8x4_t, |) |
| 434 | __packed_binary_op(por_u8x4, uint8x4_t, |) |
| 435 | __packed_binary_op(por_i16x2, int16x2_t, |) |
| 436 | __packed_binary_op(por_u16x2, uint16x2_t, |) |
| 437 | __packed_binary_op(pxor_i8x4, int8x4_t, ^) |
| 438 | __packed_binary_op(pxor_u8x4, uint8x4_t, ^) |
| 439 | __packed_binary_op(pxor_i16x2, int16x2_t, ^) |
| 440 | __packed_binary_op(pxor_u16x2, uint16x2_t, ^) |
| 441 | __packed_unary_op(pnot_i8x4, int8x4_t, ~) |
| 442 | __packed_unary_op(pnot_u8x4, uint8x4_t, ~) |
| 443 | __packed_unary_op(pnot_i16x2, int16x2_t, ~) |
| 444 | __packed_unary_op(pnot_u16x2, uint16x2_t, ~) |
| 445 | |
| 446 | /* Packed Logical Operations (64-bit) */ |
| 447 | __packed_binary_op(pand_i8x8, int8x8_t, &) |
| 448 | __packed_binary_op(pand_u8x8, uint8x8_t, &) |
| 449 | __packed_binary_op(pand_i16x4, int16x4_t, &) |
| 450 | __packed_binary_op(pand_u16x4, uint16x4_t, &) |
| 451 | __packed_binary_op(pand_i32x2, int32x2_t, &) |
| 452 | __packed_binary_op(pand_u32x2, uint32x2_t, &) |
| 453 | __packed_binary_op(por_i8x8, int8x8_t, |) |
| 454 | __packed_binary_op(por_u8x8, uint8x8_t, |) |
| 455 | __packed_binary_op(por_i16x4, int16x4_t, |) |
| 456 | __packed_binary_op(por_u16x4, uint16x4_t, |) |
| 457 | __packed_binary_op(por_i32x2, int32x2_t, |) |
| 458 | __packed_binary_op(por_u32x2, uint32x2_t, |) |
| 459 | __packed_binary_op(pxor_i8x8, int8x8_t, ^) |
| 460 | __packed_binary_op(pxor_u8x8, uint8x8_t, ^) |
| 461 | __packed_binary_op(pxor_i16x4, int16x4_t, ^) |
| 462 | __packed_binary_op(pxor_u16x4, uint16x4_t, ^) |
| 463 | __packed_binary_op(pxor_i32x2, int32x2_t, ^) |
| 464 | __packed_binary_op(pxor_u32x2, uint32x2_t, ^) |
| 465 | __packed_unary_op(pnot_i8x8, int8x8_t, ~) |
| 466 | __packed_unary_op(pnot_u8x8, uint8x8_t, ~) |
| 467 | __packed_unary_op(pnot_i16x4, int16x4_t, ~) |
| 468 | __packed_unary_op(pnot_u16x4, uint16x4_t, ~) |
| 469 | __packed_unary_op(pnot_i32x2, int32x2_t, ~) |
| 470 | __packed_unary_op(pnot_u32x2, uint32x2_t, ~) |
| 471 | |
| 472 | /* Packed Widening Convert */ |
| 473 | __packed_widen_convert(pwcvt_i16x4, int16x4_t, int8x4_t) |
| 474 | __packed_widen_convert(pwcvt_i32x2, int32x2_t, int16x2_t) |
| 475 | __packed_widen_convert(pwcvtu_u16x4, uint16x4_t, uint8x4_t) |
| 476 | __packed_widen_convert(pwcvtu_u32x2, uint32x2_t, uint16x2_t) |
| 477 | __packed_widen_high4(pwcvth_i16x4, int16x4_t, int8x4_t) |
| 478 | __packed_widen_high4(pwcvth_u16x4, uint16x4_t, uint8x4_t) |
| 479 | __packed_widen_high2(pwcvth_i32x2, int32x2_t, int16x2_t) |
| 480 | __packed_widen_high2(pwcvth_u32x2, uint32x2_t, uint16x2_t) |
| 481 | |
| 482 | /* Packed Reverse (32-bit) */ |
| 483 | __packed_reverse4(prev_i8x4, int8x4_t) |
| 484 | __packed_reverse4(prev_u8x4, uint8x4_t) |
| 485 | __packed_reverse2(prev_i16x2, int16x2_t) |
| 486 | __packed_reverse2(prev_u16x2, uint16x2_t) |
| 487 | |
| 488 | /* Packed Reverse (64-bit) */ |
| 489 | __packed_reverse8(prev_i8x8, int8x8_t) |
| 490 | __packed_reverse8(prev_u8x8, uint8x8_t) |
| 491 | __packed_reverse4(prev_i16x4, int16x4_t) |
| 492 | __packed_reverse4(prev_u16x4, uint16x4_t) |
| 493 | __packed_reverse2(prev_i32x2, int32x2_t) |
| 494 | __packed_reverse2(prev_u32x2, uint32x2_t) |
| 495 | |
| 496 | /* Packed Zip */ |
| 497 | __packed_zip4(pzip_i8x8, int8x8_t, int8x4_t) |
| 498 | __packed_zip4(pzip_u8x8, uint8x8_t, uint8x4_t) |
| 499 | __packed_zip2(pzip_i16x4, int16x4_t, int16x2_t) |
| 500 | __packed_zip2(pzip_u16x4, uint16x4_t, uint16x2_t) |
| 501 | |
| 502 | /* Packed Unzip */ |
| 503 | __packed_unzipe4(punzipe_i8x4, int8x4_t, int8x8_t) |
| 504 | __packed_unzipo4(punzipo_i8x4, int8x4_t, int8x8_t) |
| 505 | __packed_unzipe4(punzipe_u8x4, uint8x4_t, uint8x8_t) |
| 506 | __packed_unzipo4(punzipo_u8x4, uint8x4_t, uint8x8_t) |
| 507 | __packed_unzipe2(punzipe_i16x2, int16x2_t, int16x4_t) |
| 508 | __packed_unzipo2(punzipo_i16x2, int16x2_t, int16x4_t) |
| 509 | __packed_unzipe2(punzipe_u16x2, uint16x2_t, uint16x4_t) |
| 510 | __packed_unzipo2(punzipo_u16x2, uint16x2_t, uint16x4_t) |
| 511 | |
| 512 | /* Packed Averaging Addition and Subtraction (32-bit) */ |
| 513 | __packed_binary_builtin(paadd_i8x4, int8x4_t, __builtin_riscv_paadd_i8x4) |
| 514 | __packed_binary_builtin(paadd_i16x2, int16x2_t, __builtin_riscv_paadd_i16x2) |
| 515 | __packed_binary_builtin(paaddu_u8x4, uint8x4_t, __builtin_riscv_paaddu_u8x4) |
| 516 | __packed_binary_builtin(paaddu_u16x2, uint16x2_t, __builtin_riscv_paaddu_u16x2) |
| 517 | __packed_binary_builtin(pasub_i8x4, int8x4_t, __builtin_riscv_pasub_i8x4) |
| 518 | __packed_binary_builtin(pasub_i16x2, int16x2_t, __builtin_riscv_pasub_i16x2) |
| 519 | __packed_binary_builtin(pasubu_u8x4, uint8x4_t, __builtin_riscv_pasubu_u8x4) |
| 520 | __packed_binary_builtin(pasubu_u16x2, uint16x2_t, __builtin_riscv_pasubu_u16x2) |
| 521 | |
| 522 | /* Packed Averaging Addition and Subtraction (64-bit) */ |
| 523 | __packed_binary_builtin(paadd_i8x8, int8x8_t, __builtin_riscv_paadd_i8x8) |
| 524 | __packed_binary_builtin(paadd_i16x4, int16x4_t, __builtin_riscv_paadd_i16x4) |
| 525 | __packed_binary_builtin(paadd_i32x2, int32x2_t, __builtin_riscv_paadd_i32x2) |
| 526 | __packed_binary_builtin(paaddu_u8x8, uint8x8_t, __builtin_riscv_paaddu_u8x8) |
| 527 | __packed_binary_builtin(paaddu_u16x4, uint16x4_t, __builtin_riscv_paaddu_u16x4) |
| 528 | __packed_binary_builtin(paaddu_u32x2, uint32x2_t, __builtin_riscv_paaddu_u32x2) |
| 529 | __packed_binary_builtin(pasub_i8x8, int8x8_t, __builtin_riscv_pasub_i8x8) |
| 530 | __packed_binary_builtin(pasub_i16x4, int16x4_t, __builtin_riscv_pasub_i16x4) |
| 531 | __packed_binary_builtin(pasub_i32x2, int32x2_t, __builtin_riscv_pasub_i32x2) |
| 532 | __packed_binary_builtin(pasubu_u8x8, uint8x8_t, __builtin_riscv_pasubu_u8x8) |
| 533 | __packed_binary_builtin(pasubu_u16x4, uint16x4_t, __builtin_riscv_pasubu_u16x4) |
| 534 | __packed_binary_builtin(pasubu_u32x2, uint32x2_t, __builtin_riscv_pasubu_u32x2) |
| 535 | |
| 536 | /* Packed Absolute Value and Absolute Difference (32-bit) */ |
| 537 | __packed_pabs(pabs_i8x4, int8x4_t, uint8x4_t) |
| 538 | __packed_pabs(pabs_i16x2, int16x2_t, uint16x2_t) |
| 539 | __packed_binary_builtin_cast(pabd_i8x4, int8x4_t, uint8x4_t, __builtin_riscv_pabd_i8x4) |
| 540 | __packed_binary_builtin_cast(pabd_i16x2, int16x2_t, uint16x2_t, __builtin_riscv_pabd_i16x2) |
| 541 | __packed_binary_builtin_cast(pabdu_u8x4, uint8x4_t, uint8x4_t, __builtin_riscv_pabdu_u8x4) |
| 542 | __packed_binary_builtin_cast(pabdu_u16x2, uint16x2_t, uint16x2_t, __builtin_riscv_pabdu_u16x2) |
| 543 | |
| 544 | /* Packed Absolute Value and Absolute Difference (64-bit) */ |
| 545 | __packed_pabs(pabs_i8x8, int8x8_t, uint8x8_t) |
| 546 | __packed_pabs(pabs_i16x4, int16x4_t, uint16x4_t) |
| 547 | __packed_binary_builtin_cast(pabd_i8x8, int8x8_t, uint8x8_t, __builtin_riscv_pabd_i8x8) |
| 548 | __packed_binary_builtin_cast(pabd_i16x4, int16x4_t, uint16x4_t, __builtin_riscv_pabd_i16x4) |
| 549 | __packed_binary_builtin_cast(pabdu_u8x8, uint8x8_t, uint8x8_t, __builtin_riscv_pabdu_u8x8) |
| 550 | __packed_binary_builtin_cast(pabdu_u16x4, uint16x4_t, uint16x4_t, __builtin_riscv_pabdu_u16x4) |
| 551 | |
| 552 | /* Packed Reduction Sum (32-bit) */ |
| 553 | __packed_reduction(predsum_i8x4_i32, int32_t, int8x4_t, __builtin_riscv_predsum_i8x4_i32) |
| 554 | __packed_reduction(predsumu_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_predsumu_u8x4_u32) |
| 555 | __packed_reduction(predsum_i16x2_i32, int32_t, int16x2_t, __builtin_riscv_predsum_i16x2_i32) |
| 556 | __packed_reduction(predsumu_u16x2_u32, uint32_t, uint16x2_t, __builtin_riscv_predsumu_u16x2_u32) |
| 557 | |
| 558 | /* Packed Reduction Sum (64-bit) */ |
| 559 | __packed_reduction(predsum_i8x8_i32, int32_t, int8x8_t, __builtin_riscv_predsum_i8x8_i32) |
| 560 | __packed_reduction(predsumu_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_predsumu_u8x8_u32) |
| 561 | __packed_reduction(predsum_i16x4_i32, int32_t, int16x4_t, __builtin_riscv_predsum_i16x4_i32) |
| 562 | __packed_reduction(predsumu_u16x4_u32, uint32_t, uint16x4_t, __builtin_riscv_predsumu_u16x4_u32) |
| 563 | __packed_reduction(predsum_i8x8_i64, int64_t, int8x8_t, __builtin_riscv_predsum_i8x8_i64) |
| 564 | __packed_reduction(predsumu_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_predsumu_u8x8_u64) |
| 565 | __packed_reduction(predsum_i16x4_i64, int64_t, int16x4_t, __builtin_riscv_predsum_i16x4_i64) |
| 566 | __packed_reduction(predsumu_u16x4_u64, uint64_t, uint16x4_t, __builtin_riscv_predsumu_u16x4_u64) |
| 567 | __packed_reduction(predsum_i32x2_i64, int64_t, int32x2_t, __builtin_riscv_predsum_i32x2_i64) |
| 568 | __packed_reduction(predsumu_u32x2_u64, uint64_t, uint32x2_t, __builtin_riscv_predsumu_u32x2_u64) |
| 569 | |
| 570 | /* Packed Merge (32-bit) */ |
| 571 | __packed_merge_builtin(pmerge_u8x4, uint8x4_t, uint8x4_t, __builtin_riscv_pmerge_u8x4) |
| 572 | __packed_merge_builtin(pmerge_i8x4, int8x4_t, uint8x4_t, __builtin_riscv_pmerge_i8x4) |
| 573 | __packed_merge_builtin(pmerge_u16x2, uint16x2_t, uint16x2_t, __builtin_riscv_pmerge_u16x2) |
| 574 | __packed_merge_builtin(pmerge_i16x2, int16x2_t, uint16x2_t, __builtin_riscv_pmerge_i16x2) |
| 575 | |
| 576 | /* Packed Merge (64-bit) */ |
| 577 | __packed_merge_builtin(pmerge_u8x8, uint8x8_t, uint8x8_t, __builtin_riscv_pmerge_u8x8) |
| 578 | __packed_merge_builtin(pmerge_i8x8, int8x8_t, uint8x8_t, __builtin_riscv_pmerge_i8x8) |
| 579 | __packed_merge_builtin(pmerge_u16x4, uint16x4_t, uint16x4_t, __builtin_riscv_pmerge_u16x4) |
| 580 | __packed_merge_builtin(pmerge_i16x4, int16x4_t, uint16x4_t, __builtin_riscv_pmerge_i16x4) |
| 581 | __packed_merge_builtin(pmerge_u32x2, uint32x2_t, uint32x2_t, __builtin_riscv_pmerge_u32x2) |
| 582 | __packed_merge_builtin(pmerge_i32x2, int32x2_t, uint32x2_t, __builtin_riscv_pmerge_i32x2) |
| 583 | |
| 584 | /* Packed Absolute Difference Sum (32-bit) */ |
| 585 | __packed_abdsum(pabdsumu_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_pabdsumu_u8x4_u32) |
| 586 | __packed_abdsum_acc(pabdsumau_u8x4_u32, uint32_t, uint8x4_t, __builtin_riscv_pabdsumau_u8x4_u32) |
| 587 | |
| 588 | /* Packed Absolute Difference Sum (64-bit) */ |
| 589 | __packed_abdsum(pabdsumu_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_pabdsumu_u8x8_u32) |
| 590 | __packed_abdsum(pabdsumu_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_pabdsumu_u8x8_u64) |
| 591 | __packed_abdsum_acc(pabdsumau_u8x8_u32, uint32_t, uint8x8_t, __builtin_riscv_pabdsumau_u8x8_u32) |
| 592 | __packed_abdsum_acc(pabdsumau_u8x8_u64, uint64_t, uint8x8_t, __builtin_riscv_pabdsumau_u8x8_u64) |
| 593 | |
| 594 | /* Packed Saturating Absolute Value (32-bit) */ |
| 595 | __packed_psabs(psabs_i8x4, int8x4_t, __builtin_riscv_psabs_i8x4) |
| 596 | __packed_psabs(psabs_i16x2, int16x2_t, __builtin_riscv_psabs_i16x2) |
| 597 | |
| 598 | /* Packed Saturating Absolute Value (64-bit) */ |
| 599 | __packed_psabs(psabs_i8x8, int8x8_t, __builtin_riscv_psabs_i8x8) |
| 600 | __packed_psabs(psabs_i16x4, int16x4_t, __builtin_riscv_psabs_i16x4) |
| 601 | |
| 602 | // clang-format on |
| 603 | |
| 604 | #undef __packed_splat2 |
| 605 | #undef __packed_splat4 |
| 606 | #undef __packed_splat8 |
| 607 | #undef __packed_splat |
| 608 | #undef __packed_shift |
| 609 | #undef __packed_shift8 |
| 610 | #undef __packed_shift16 |
| 611 | #undef __packed_shift32 |
| 612 | #undef __packed_scalar_binary_op |
| 613 | #undef __packed_binary_op |
| 614 | #undef __packed_unary_op |
| 615 | #undef __packed_binary_builtin |
| 616 | #undef __packed_sh1add |
| 617 | #undef __packed_sh1sadd |
| 618 | #undef __packed_cmp |
| 619 | #undef __packed_pabs |
| 620 | #undef __packed_binary_builtin_cast |
| 621 | #undef __packed_reduction |
| 622 | #undef __packed_merge_builtin |
| 623 | #undef __packed_psabs |
| 624 | #undef __packed_widen_convert |
| 625 | #undef __packed_widen_high2 |
| 626 | #undef __packed_widen_high4 |
| 627 | #undef __packed_reverse2 |
| 628 | #undef __packed_reverse4 |
| 629 | #undef __packed_reverse8 |
| 630 | #undef __packed_zip2 |
| 631 | #undef __packed_zip4 |
| 632 | #undef __packed_unzipe2 |
| 633 | #undef __packed_unzipe4 |
| 634 | #undef __packed_unzipo2 |
| 635 | #undef __packed_unzipo4 |
| 636 | #undef __packed_abdsum |
| 637 | #undef __packed_abdsum_acc |
| 638 | #undef __DEFAULT_FN_ATTRS |
| 639 | |
| 640 | #if defined(__cplusplus) |
| 641 | } |
| 642 | #endif |
| 643 | |
| 644 | #endif /* __RISCV_PACKED_SIMD_H */ |