mips.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Copyright Rene Rivera 2008-2015
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_PREDEF_ARCHITECTURE_MIPS_H
  8. #define BOOST_PREDEF_ARCHITECTURE_MIPS_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /* tag::reference[]
  12. = `BOOST_ARCH_MIPS`
  13. http://en.wikipedia.org/wiki/MIPS_architecture[MIPS] architecture.
  14. [options="header"]
  15. |===
  16. | {predef_symbol} | {predef_version}
  17. | `+__mips__+` | {predef_detection}
  18. | `+__mips+` | {predef_detection}
  19. | `+__MIPS__+` | {predef_detection}
  20. | `+__mips+` | V.0.0
  21. | `+_MIPS_ISA_MIPS1+` | 1.0.0
  22. | `+_R3000+` | 1.0.0
  23. | `+_MIPS_ISA_MIPS2+` | 2.0.0
  24. | `+__MIPS_ISA2__+` | 2.0.0
  25. | `+_R4000+` | 2.0.0
  26. | `+_MIPS_ISA_MIPS3+` | 3.0.0
  27. | `+__MIPS_ISA3__+` | 3.0.0
  28. | `+_MIPS_ISA_MIPS4+` | 4.0.0
  29. | `+__MIPS_ISA4__+` | 4.0.0
  30. |===
  31. */ // end::reference[]
  32. #define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER_NOT_AVAILABLE
  33. #if defined(__mips__) || defined(__mips) || \
  34. defined(__MIPS__)
  35. # undef BOOST_ARCH_MIPS
  36. # if !defined(BOOST_ARCH_MIPS) && (defined(__mips))
  37. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER(__mips,0,0)
  38. # endif
  39. # if !defined(BOOST_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS1) || defined(_R3000))
  40. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER(1,0,0)
  41. # endif
  42. # if !defined(BOOST_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS2) || defined(__MIPS_ISA2__) || defined(_R4000))
  43. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER(2,0,0)
  44. # endif
  45. # if !defined(BOOST_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS3) || defined(__MIPS_ISA3__))
  46. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER(3,0,0)
  47. # endif
  48. # if !defined(BOOST_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS4) || defined(__MIPS_ISA4__))
  49. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER(4,0,0)
  50. # endif
  51. # if !defined(BOOST_ARCH_MIPS)
  52. # define BOOST_ARCH_MIPS BOOST_VERSION_NUMBER_AVAILABLE
  53. # endif
  54. #endif
  55. #if BOOST_ARCH_MIPS
  56. # define BOOST_ARCH_MIPS_AVAILABLE
  57. #endif
  58. #if BOOST_ARCH_MIPS
  59. # if BOOST_ARCH_MIPS >= BOOST_VERSION_NUMBER(3,0,0)
  60. # undef BOOST_ARCH_WORD_BITS_64
  61. # define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
  62. # else
  63. # undef BOOST_ARCH_WORD_BITS_32
  64. # define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
  65. # endif
  66. #endif
  67. #define BOOST_ARCH_MIPS_NAME "MIPS"
  68. #endif
  69. #include <boost/predef/detail/test.h>
  70. BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_MIPS,BOOST_ARCH_MIPS_NAME)