16 #include <freerdp/config.h>
18 #include <freerdp/types.h>
19 #include <freerdp/primitives.h>
20 #include <winpr/sysinfo.h>
22 #include "prim_andor.h"
24 #include "prim_internal.h"
25 #include "prim_templates.h"
27 #if defined(SSE2_ENABLED)
28 #include <emmintrin.h>
29 #include <pmmintrin.h>
34 SSE3_SCD_PRE_ROUTINE(sse3_andC_32u, UINT32, generic->andC_32u, _mm_and_si128,
35 *dptr++ = *sptr++ & val)
36 SSE3_SCD_PRE_ROUTINE(sse3_orC_32u, UINT32, generic->orC_32u, _mm_or_si128, *dptr++ = *sptr++ | val)
41 void primitives_init_andor_sse3(
primitives_t* WINPR_RESTRICT prims)
43 #if defined(SSE2_ENABLED)
44 generic = primitives_get_generic();
45 primitives_init_andor(prims);
47 if (IsProcessorFeaturePresent(PF_SSE2_INSTRUCTIONS_AVAILABLE) &&
48 IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE))
50 WLog_VRB(PRIM_TAG,
"SSE2/SSE3 optimizations");
51 prims->andC_32u = sse3_andC_32u;
52 prims->orC_32u = sse3_orC_32u;
56 WLog_VRB(PRIM_TAG,
"undefined WITH_SSE2");