arm-features.h 2.4 KB

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