openlibm_acle_compat_arm.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * Copyright (c) 2014 ARM Ltd
  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
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. The name of the company may not be used to endorse or promote
  14. * products derived from this software without specific prior written
  15. * permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
  18. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20. * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  22. * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  24. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  25. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. *
  28. * $FreeBSD: head/sys/arm/include/acle-compat.h 269956 2014-08-14 04:20:13Z imp $
  29. */
  30. #ifndef __ARM_ARCH
  31. /* ACLE standardises a set of pre-defines that describe the ARM architecture.
  32. These were mostly implemented in GCC around GCC-4.8; older versions
  33. have no, or only partial support. To provide a level of backwards
  34. compatibility we try to work out what the definitions should be, given
  35. the older pre-defines that GCC did produce. This isn't complete, but
  36. it should be enough for use by routines that depend on this header. */
  37. /* No need to handle ARMv8, GCC had ACLE support before that. */
  38. #define __ARM_ACLE 101
  39. # ifdef __ARM_ARCH_7__
  40. /* The common subset of ARMv7 in all profiles. */
  41. # define __ARM_ARCH 7
  42. # define __ARM_ARCH_ISA_THUMB 2
  43. # define __ARM_FEATURE_CLZ
  44. # define __ARM_FEATURE_LDREX 7
  45. # define __ARM_FEATURE_UNALIGNED
  46. # endif
  47. # if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__)
  48. # define __ARM_ARCH 7
  49. # define __ARM_ARCH_ISA_THUMB 2
  50. # define __ARM_ARCH_ISA_ARM
  51. # define __ARM_FEATURE_CLZ
  52. # define __ARM_FEATURE_SIMD32
  53. # define __ARM_FEATURE_DSP
  54. # define __ARM_FEATURE_QBIT
  55. # define __ARM_FEATURE_SAT
  56. # define __ARM_FEATURE_LDREX 15
  57. # define __ARM_FEATURE_UNALIGNED
  58. # ifdef __ARM_ARCH_7A__
  59. # define __ARM_ARCH_PROFILE 'A'
  60. # else
  61. # define __ARM_ARCH_PROFILE 'R'
  62. # endif
  63. # endif
  64. # ifdef __ARM_ARCH_7EM__
  65. # define __ARM_ARCH 7
  66. # define __ARM_ARCH_ISA_THUMB 2
  67. # define __ARM_FEATURE_CLZ
  68. # define __ARM_FEATURE_SIMD32
  69. # define __ARM_FEATURE_DSP
  70. # define __ARM_FEATURE_QBIT
  71. # define __ARM_FEATURE_SAT
  72. # define __ARM_FEATURE_LDREX 7
  73. # define __ARM_FEATURE_UNALIGNED
  74. # define __ARM_ARCH_PROFILE 'M'
  75. # endif
  76. # ifdef __ARM_ARCH_7M__
  77. # define __ARM_ARCH 7
  78. # define __ARM_ARCH_ISA_THUMB 2
  79. # define __ARM_FEATURE_CLZ
  80. # define __ARM_FEATURE_QBIT
  81. # define __ARM_FEATURE_SAT
  82. # define __ARM_FEATURE_LDREX 7
  83. # define __ARM_FEATURE_UNALIGNED
  84. # define __ARM_ARCH_PROFILE 'M'
  85. # endif
  86. # ifdef __ARM_ARCH_6T2__
  87. # define __ARM_ARCH 6
  88. # define __ARM_ARCH_ISA_THUMB 2
  89. # define __ARM_ARCH_ISA_ARM
  90. # define __ARM_FEATURE_CLZ
  91. # define __ARM_FEATURE_SIMD32
  92. # define __ARM_FEATURE_DSP
  93. # define __ARM_FEATURE_QBIT
  94. # define __ARM_FEATURE_SAT
  95. # define __ARM_FEATURE_LDREX 4
  96. # define __ARM_FEATURE_UNALIGNED
  97. # endif
  98. # ifdef __ARM_ARCH_6M__
  99. # define __ARM_ARCH 6
  100. # define __ARM_ARCH_ISA_THUMB 1
  101. # define __ARM_ARCH_PROFILE 'M'
  102. # endif
  103. # if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \
  104. || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \
  105. || defined (__ARM_ARCH_6ZK__)
  106. # define __ARM_ARCH 6
  107. # define __ARM_ARCH_ISA_THUMB 1
  108. # define __ARM_ARCH_ISA_ARM
  109. # define __ARM_FEATURE_CLZ
  110. # define __ARM_FEATURE_SIMD32
  111. # define __ARM_FEATURE_DSP
  112. # define __ARM_FEATURE_QBIT
  113. # define __ARM_FEATURE_SAT
  114. # define __ARM_FEATURE_UNALIGNED
  115. # ifndef __thumb__
  116. # if defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
  117. # define __ARM_FEATURE_LDREX 15
  118. # else
  119. # define __ARM_FEATURE_LDREX 4
  120. # endif
  121. # endif
  122. # endif
  123. # if defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5E__)
  124. # define __ARM_ARCH 5
  125. # define __ARM_ARCH_ISA_ARM
  126. # ifdef __ARM_ARCH_5TE__
  127. # define __ARM_ARCH_ISA_THUMB 1
  128. # endif
  129. # define __ARM_FEATURE_CLZ
  130. # define __ARM_FEATURE_DSP
  131. # endif
  132. # if defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5__)
  133. # define __ARM_ARCH 5
  134. # define __ARM_ARCH_ISA_ARM
  135. # ifdef __ARM_ARCH_5TE__
  136. # define __ARM_ARCH_ISA_THUMB 1
  137. # endif
  138. # define __ARM_FEATURE_CLZ
  139. # endif
  140. # ifdef __ARM_ARCH_4T__
  141. # define __ARM_ARCH 4
  142. # define __ARM_ARCH_ISA_ARM
  143. # define __ARM_ARCH_ISA_THUMB 1
  144. # endif
  145. # ifdef __ARM_ARCH_4__
  146. # define __ARM_ARCH 4
  147. # define __ARM_ARCH_ISA_ARM
  148. # endif
  149. # if defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
  150. # define __ARM_ARCH 3
  151. # define __ARM_ARCH_ISA_ARM
  152. # endif
  153. # ifdef __ARM_ARCH_2__
  154. # define __ARM_ARCH 2
  155. # define __ARM_ARCH_ISA_ARM
  156. # endif
  157. # ifdef __ARMEB__
  158. # define __ARM_BIG_ENDIAN
  159. # endif
  160. /* If we still don't know what the target architecture is, then we're
  161. probably not using GCC. */
  162. # ifndef __ARM_ARCH
  163. # error Unable to determine architecture version.
  164. # endif
  165. #endif /* __ARM_ARCH */