2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
20 #define feature_name armv5
21 #define static_test_armv5 (ARM_VERSION >= 5)
22 #define dynamic_test (arm_arch >= 5)
27 #define feature_name armv6
28 #define static_test_armv6 (ARM_VERSION >= 6)
29 #define dynamic_test (arm_arch >= 6)
34 #define feature_name armv6t2
35 #define static_test_armv6t2 (ARM_VERSION >= 7 || (ARM_VERSION >= 6 && (__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB >= 2) || (__ARM_ARCH_6T2__))
36 #if static_test_armv6t2
37 #define dynamic_test (arm_arch >= 6)
39 #define dynamic_test (arm_arch >= 7)
45 #define feature_name vfp
46 #define static_test_vfp (__ARM_PCS_VFP)
47 #define dynamic_test (elf_hwcap & (1 << 6))
52 #define feature_name half
53 #define static_test_half (__ARM_FP & 2)
55 #define dynamic_test (elf_hwcap & ((1 << 13) | (1 << 14) | (1 << 16)))
57 #define dynamic_test (elf_hwcap & (1 << 16))
62 #define feature_name neon
63 #define static_test_neon (__ARM_NEON)
65 #define dynamic_test (elf_hwcap & (1 << 1))
67 #define dynamic_test (elf_hwcap & (1 << 12))
72 #define feature_name idiv
73 #define static_test_idiv 0
74 #define dynamic_test (elf_hwcap & (1 << 18) && elf_hwcap & (1 << 17))