aboutsummaryrefslogtreecommitdiff
path: root/files/include/libyuv/cpu_id.h
blob: c1000e867f85888859a21a323051e941cacbd849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 *  Copyright (c) 2011 The LibYuv project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef INCLUDE_LIBYUV_CPU_ID_H_
#define INCLUDE_LIBYUV_CPU_ID_H_

namespace libyuv {

// These flags are only valid on x86 processors
static const int kCpuHasSSE2 = 1;
static const int kCpuHasSSSE3 = 2;

// These flags are only valid on ARM processors
static const int kCpuHasNEON = 4;

// Internal flag to indicate cpuid is initialized.
static const int kCpuInitialized = 8;

// Detect CPU has SSE2 etc.
bool TestCpuFlag(int flag);

// For testing, allow CPU flags to be disabled.
// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3.  -1 to enable all.
void MaskCpuFlags(int enable_flags);

}  // namespace libyuv

#endif  // INCLUDE_LIBYUV_CPU_ID_H_