xref: /aosp_15_r20/external/libaom/aom_ports/arm.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1 /*
2  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 
12 #ifndef AOM_AOM_PORTS_ARM_H_
13 #define AOM_AOM_PORTS_ARM_H_
14 #include <stdlib.h>
15 
16 #include "config/aom_config.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 // Armv7-A optional Neon instructions, mandatory from Armv8.0-A.
23 #define HAS_NEON (1 << 0)
24 // Armv8.0-A optional CRC32 instructions, mandatory from Armv8.1-A.
25 #define HAS_ARM_CRC32 (1 << 1)
26 // Armv8.2-A optional Neon dot-product instructions, mandatory from Armv8.4-A.
27 #define HAS_NEON_DOTPROD (1 << 2)
28 // Armv8.2-A optional Neon i8mm instructions, mandatory from Armv8.6-A.
29 #define HAS_NEON_I8MM (1 << 3)
30 // Armv8.2-A optional SVE instructions, mandatory from Armv9.0-A.
31 #define HAS_SVE (1 << 4)
32 // Armv9.0-A SVE2 instructions.
33 #define HAS_SVE2 (1 << 5)
34 
35 int aom_arm_cpu_caps(void);
36 
37 // Earlier gcc compilers have issues with some neon intrinsics
38 #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 4 && \
39     __GNUC_MINOR__ <= 6
40 #define AOM_INCOMPATIBLE_GCC
41 #endif
42 
43 #ifdef __cplusplus
44 }  // extern "C"
45 #endif
46 
47 #endif  // AOM_AOM_PORTS_ARM_H_
48