Debian Codegraph @

Modules/ThirdParty/ZLIB/src/itkzlib-ng/arch/arm/neon_intrins.h

raw
1 #ifndef ARM_NEON_INTRINS_H
2 #define ARM_NEON_INTRINS_H
3
4 #if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
5 /* arm64_neon.h is MSVC specific */
6 # include <arm64_neon.h>
7 #else
8 # include <arm_neon.h>
9 #endif
10
11 #if defined(ARM_NEON) && !defined(__aarch64__) && !defined(_M_ARM64) && !defined(_M_ARM64EC)
12 /* Compatibility shim for the _high family of functions */
13 #define vmull_high_u8(a, b) vmull_u8(vget_high_u8(a), vget_high_u8(b))
14 #define vmlal_high_u8(a, b, c) vmlal_u8(a, vget_high_u8(b), vget_high_u8(c))
15 #define vmlal_high_u16(a, b, c) vmlal_u16(a, vget_high_u16(b), vget_high_u16(c))
16 #define vaddw_high_u8(a, b) vaddw_u8(a, vget_high_u8(b))
17 #endif
18
19 #ifdef ARM_NEON
20
21 #define vqsubq_u16_x4_x1(out, a, b) do { \
22 out.val[0] = vqsubq_u16(a.val[0], b); \
23 out.val[1] = vqsubq_u16(a.val[1], b); \
24 out.val[2] = vqsubq_u16(a.val[2], b); \
25 out.val[3] = vqsubq_u16(a.val[3], b); \
26 } while (0)
27
28
29 # ifndef ARM_NEON_HASLD4
30
31 static inline uint16x8x4_t vld1q_u16_x4(uint16_t const *a) {
32 uint16x8x4_t ret = (uint16x8x4_t) {{
33 vld1q_u16(a),
34 vld1q_u16(a+8),
35 vld1q_u16(a+16),
36 vld1q_u16(a+24)}};
37 return ret;
38 }
39
40 static inline uint8x16x4_t vld1q_u8_x4(uint8_t const *a) {
41 uint8x16x4_t ret = (uint8x16x4_t) {{
42 vld1q_u8(a),
43 vld1q_u8(a+16),
44 vld1q_u8(a+32),
45 vld1q_u8(a+48)}};
46 return ret;
47 }
48
49 static inline void vst1q_u16_x4(uint16_t *p, uint16x8x4_t a) {
50 vst1q_u16(p, a.val[0]);
51 vst1q_u16(p + 8, a.val[1]);
52 vst1q_u16(p + 16, a.val[2]);
53 vst1q_u16(p + 24, a.val[3]);
54 }
55 # endif // HASLD4 check
56 #endif
57
58 #endif // include guard ARM_NEON_INTRINS_H