GDAL

rasterio_ssse3.h
1/******************************************************************************
2 *
3 * Project: GDAL Core
4 * Purpose: SSSE3 specializations
5 * Author: Even Rouault <even dot rouault at spatialys dot com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 ****************************************************************************/
28
29#ifndef RASTERIO_SSSE3_H_INCLUDED
30#define RASTERIO_SSSE3_H_INCLUDED
31
32#include "cpl_port.h"
33
34#if defined(HAVE_SSSE3_AT_COMPILE_TIME) && \
35 (defined(__x86_64) || defined(_M_X64))
36
37 void GDALUnrolledCopy_GByte_3_1_SSSE3(GByte *CPL_RESTRICT pDest,
38 const GByte *CPL_RESTRICT pSrc,
39 GPtrDiff_t nIters);
40
41 void GDALDeinterleave3Byte_SSSE3(const GByte *CPL_RESTRICT pabySrc,
42 GByte *CPL_RESTRICT pabyDest0,
43 GByte *CPL_RESTRICT pabyDest1,
44 GByte *CPL_RESTRICT pabyDest2, size_t nIters);
45
46#if !defined(__GNUC__) || defined(__clang__)
47// GCC excluded because the auto-vectorized SSE2 code is good enough
48 void GDALDeinterleave4Byte_SSSE3(const GByte *CPL_RESTRICT pabySrc,
49 GByte *CPL_RESTRICT pabyDest0,
50 GByte *CPL_RESTRICT pabyDest1,
51 GByte *CPL_RESTRICT pabyDest2,
52 GByte *CPL_RESTRICT pabyDest3, size_t nIters);
53#endif
54
55#if (defined(__GNUC__) && !defined(__clang__)) || \
56 defined(__INTEL_CLANG_COMPILER)
57// Restricted to GCC/ICC only as only verified with it that it can properly
58// auto-vectorize
59 void GDALDeinterleave3UInt16_SSSE3(const GUInt16 *CPL_RESTRICT panSrc,
60 GUInt16 *CPL_RESTRICT panDest0,
61 GUInt16 *CPL_RESTRICT panDest1,
62 GUInt16 *CPL_RESTRICT panDest2,
63 size_t nIters);
64
65 void GDALDeinterleave4UInt16_SSSE3(const GUInt16 *CPL_RESTRICT panSrc,
66 GUInt16 *CPL_RESTRICT panDest0,
67 GUInt16 *CPL_RESTRICT panDest1,
68 GUInt16 *CPL_RESTRICT panDest2,
69 GUInt16 *CPL_RESTRICT panDest3,
70 size_t nIters);
71#endif
72
73#endif
74
75#endif /* RASTERIO_SSSE3_H_INCLUDED */
cpl_port.h
Core portability definitions for CPL.
GPtrDiff_t
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition cpl_port.h:256
CPL_RESTRICT
#define CPL_RESTRICT
restrict keyword to declare that pointers do not alias
Definition cpl_port.h:1022
GUInt16
unsigned short GUInt16
Unsigned int16 type.
Definition cpl_port.h:183
GByte
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:185