1 /* Macros to test for CPU features on ARM.  Generic ARM version.
2    Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8 
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library.  If not, see
16    <https://www.gnu.org/licenses/>.  */
17 
18 #ifndef _ARM_ARM_FEATURES_H
19 #define _ARM_ARM_FEATURES_H 1
20 
21 /* An OS-specific arm-features.h file should define ARM_HAVE_VFP to
22    an appropriate expression for testing at runtime whether the VFP
23    hardware is present.  We'll then redefine it to a constant if we
24    know at compile time that we can assume VFP.  */
25 
26 #ifndef __SOFTFP__
27 /* The compiler is generating VFP instructions, so we're already
28    assuming the hardware exists.  */
29 # undef ARM_HAVE_VFP
30 # define ARM_HAVE_VFP	1
31 #endif
32 
33 /* An OS-specific arm-features.h file may define ARM_ASSUME_NO_IWMMXT
34    to indicate at compile time that iWMMXt hardware is never present
35    at runtime (or that we never care about its state) and so need not
36    be checked for.  */
37 
38 /* A more-specific arm-features.h file may define ARM_ALWAYS_BX to indicate
39    that instructions using pc as a destination register must never be used,
40    so a "bx" (or "blx") instruction is always required.  */
41 
42 /* The log2 of the minimum alignment required for an address that
43    is the target of a computed branch (i.e. a "bx" instruction).
44    A more-specific arm-features.h file may define this to set a more
45    stringent requirement.
46 
47    Using this only makes sense for code in ARM mode (where instructions
48    always have a fixed size of four bytes), or for Thumb-mode code that is
49    specifically aligning all the related branch targets to match (since
50    Thumb instructions might be either two or four bytes).  */
51 #ifndef ARM_BX_ALIGN_LOG2
52 # define ARM_BX_ALIGN_LOG2	2
53 #endif
54 
55 /* An OS-specific arm-features.h file may define ARM_NO_INDEX_REGISTER to
56    indicate that the two-register addressing modes must never be used.  */
57 
58 #endif  /* arm-features.h */
59