xref: /aosp_15_r20/external/libdav1d/src/arm/arm-arch.h (revision c09093415860a1c2373dacd84c4fde00c507cdfd)
1 /*
2  * Copyright © 2024, VideoLAN and dav1d authors
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice, this
9  *    list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  *    this list of conditions and the following disclaimer in the documentation
13  *    and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #ifndef ARM_ARM_ARCH_H
28 #define ARM_ARM_ARCH_H
29 
30 /* Compatibility header to define __ARM_ARCH with older compilers */
31 #ifndef __ARM_ARCH
32 
33 #ifdef _M_ARM
34 #define __ARM_ARCH _M_ARM
35 
36 #elif defined(__ARM_ARCH_8A__) || defined(_M_ARM64)
37 #define __ARM_ARCH 8
38 
39 #elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
40       defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || \
41       defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
42 #define __ARM_ARCH 7
43 
44 #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
45       defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || \
46       defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
47 #define __ARM_ARCH 6
48 
49 #elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
50       defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__)
51 #define __ARM_ARCH 5
52 
53 #elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
54 #define __ARM_ARCH 4
55 
56 #elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__)
57 #define __ARM_ARCH 3
58 
59 #elif defined(__ARM_ARCH_2__)
60 #define __ARM_ARCH 2
61 
62 #else
63 #error Unknown ARM architecture version
64 #endif
65 
66 #endif /* !__ARM_ARCH */
67 
68 #endif /* ARM_ARM_ARCH_H */
69