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"
27#include "prim_shift.h"
29#if defined(NEON_INTRINSICS_ENABLED)
34static pstatus_t neon_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val, UINT32 ulen)
36 INT16* dptr = pSrcDst;
39 return PRIMITIVES_SUCCESS;
43 const int16x8_t shift = vdupq_n_s16((INT16)val);
46 size_t count = len >> 4;
50 const int16x8_t v0 = vld1q_s16(dptr);
51 const int16x8_t v1 = vld1q_s16(dptr + 8);
53 vst1q_s16(dptr, vshlq_s16(v0, shift));
54 vst1q_s16(dptr + 8, vshlq_s16(v1, shift));
60 return generic->lShiftC_16s_inplace(dptr, val, WINPR_ASSERTING_INT_CAST(uint32_t, len));
62 return PRIMITIVES_SUCCESS;
67void primitives_init_shift_neon_int(
primitives_t* WINPR_RESTRICT prims)
69#if defined(NEON_INTRINSICS_ENABLED)
70 generic = primitives_get_generic();
72 WLog_VRB(PRIM_TAG,
"NEON optimizations");
73 prims->lShiftC_16s_inplace = neon_lShiftC_16s_inplace;
75 WLog_VRB(PRIM_TAG,
"undefined WITH_SIMD or neon intrinsics not available");