20#include <freerdp/config.h>
22#include <freerdp/types.h>
23#include <freerdp/primitives.h>
24#include <winpr/sysinfo.h>
26#include "prim_internal.h"
29#if defined(NEON_INTRINSICS_ENABLED)
34static pstatus_t neon_add_16s_inplace(INT16* WINPR_RESTRICT pSrcDst1,
35 INT16* WINPR_RESTRICT pSrcDst2, UINT32 ulen)
37 INT16* dptr1 = pSrcDst1;
38 INT16* dptr2 = pSrcDst2;
42 size_t count = len >> 4;
46 const int16x8_t a0 = vld1q_s16(dptr1);
47 const int16x8_t a1 = vld1q_s16(dptr1 + 8);
48 const int16x8_t b0 = vld1q_s16(dptr2);
49 const int16x8_t b1 = vld1q_s16(dptr2 + 8);
50 const int16x8_t sum0 = vqaddq_s16(a0, b0);
51 const int16x8_t sum1 = vqaddq_s16(a1, b1);
53 vst1q_s16(dptr1, sum0);
54 vst1q_s16(dptr1 + 8, sum1);
55 vst1q_s16(dptr2, sum0);
56 vst1q_s16(dptr2 + 8, sum1);
63 return generic->
add_16s_inplace(dptr1, dptr2, WINPR_ASSERTING_INT_CAST(uint32_t, len));
65 return PRIMITIVES_SUCCESS;
70void primitives_init_add_neon_int(
primitives_t* WINPR_RESTRICT prims)
72#if defined(NEON_INTRINSICS_ENABLED)
73 generic = primitives_get_generic();
75 WLog_VRB(PRIM_TAG,
"NEON optimizations");
76 prims->add_16s_inplace = neon_add_16s_inplace;
78 WLog_VRB(PRIM_TAG,
"undefined WITH_SIMD or neon intrinsics not available");
WINPR_ATTR_NODISCARD fn_add_16s_inplace_t add_16s_inplace
Do vecotor addition, store result in both input buffers pSrcDst1 = pSrcDst2 = pSrcDst1 + pSrcDst2.