1 /*****************************************************************************
2 * Copyright (C) 2013 x265 project
4 * Authors: Steve Borho <steve@borho.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
20 * This program is also available under a commercial proprietary license.
21 * For more information, contact us at license @ x265.com.
22 *****************************************************************************/
24 #include "primitives.h"
27 /* The #if logic here must match the file lists in CMakeLists.txt */
29 #if defined(__INTEL_COMPILER)
34 #elif defined(__GNUC__)
35 #if __clang__ || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
40 #if __clang__ || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7)
43 #elif defined(_MSC_VER)
47 #if _MSC_VER >= 1700 // VC11
50 #endif // compiler checks
51 #endif // if X265_ARCH_X86
54 // private x265 namespace
56 void Setup_Vec_DCTPrimitives_sse3(EncoderPrimitives
&);
57 void Setup_Vec_DCTPrimitives_ssse3(EncoderPrimitives
&);
58 void Setup_Vec_DCTPrimitives_sse41(EncoderPrimitives
&);
60 /* Use primitives for the best available vector architecture */
61 void Setup_Instrinsic_Primitives(EncoderPrimitives
&p
, int cpuMask
)
64 if (cpuMask
& X265_CPU_SSE3
)
66 Setup_Vec_DCTPrimitives_sse3(p
);
70 if (cpuMask
& X265_CPU_SSSE3
)
72 Setup_Vec_DCTPrimitives_ssse3(p
);
76 if (cpuMask
& X265_CPU_SSE4
)
78 Setup_Vec_DCTPrimitives_sse41(p
);