FreeRDP
Loading...
Searching...
No Matches
prim_andor_sse3.c
1/* FreeRDP: A Remote Desktop Protocol Client
2 * Optimized Logical operations.
3 * vi:ts=4 sw=4:
4 *
5 * (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may
7 * not use this file except in compliance with the License. You may obtain
8 * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16#include <freerdp/config.h>
17
18#include <freerdp/types.h>
19#include <freerdp/primitives.h>
20#include <winpr/sysinfo.h>
21
22#include "prim_andor.h"
23
24#include "prim_internal.h"
25#include "prim_templates.h"
26
27#if defined(SSE_AVX_INTRINSICS_ENABLED)
28#include <emmintrin.h>
29#include <pmmintrin.h>
30
31static primitives_t* generic = NULL;
32
33/* ------------------------------------------------------------------------- */
34SSE3_SCD_PRE_ROUTINE(sse3_andC_32u, UINT32, generic->andC_32u, _mm_and_si128,
35 *dptr++ = *sptr++ & val)
36SSE3_SCD_PRE_ROUTINE(sse3_orC_32u, UINT32, generic->orC_32u, _mm_or_si128, *dptr++ = *sptr++ | val)
37
38#endif
39
40/* ------------------------------------------------------------------------- */
41void primitives_init_andor_sse3_int(primitives_t* WINPR_RESTRICT prims)
42{
43#if defined(SSE_AVX_INTRINSICS_ENABLED)
44 generic = primitives_get_generic();
45
46 WLog_VRB(PRIM_TAG, "SSE2/SSE3 optimizations");
47 prims->andC_32u = sse3_andC_32u;
48 prims->orC_32u = sse3_orC_32u;
49
50#else
51 WLog_VRB(PRIM_TAG, "undefined WITH_SIMD or SSE3 intrinsics not available");
52 WINPR_UNUSED(prims);
53#endif
54}