superh.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_SUPERH_H
  8. #define BOOST_PREDEF_ARCHITECTURE_SUPERH_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /* tag::reference[]
  12. = `BOOST_ARCH_SH`
  13. http://en.wikipedia.org/wiki/SuperH[SuperH] architecture:
  14. If available versions [1-5] are specifically detected.
  15. [options="header"]
  16. |===
  17. | {predef_symbol} | {predef_version}
  18. | `+__sh__+` | {predef_detection}
  19. | `+__SH5__+` | 5.0.0
  20. | `+__SH4__+` | 4.0.0
  21. | `+__sh3__+` | 3.0.0
  22. | `+__SH3__+` | 3.0.0
  23. | `+__sh2__+` | 2.0.0
  24. | `+__sh1__+` | 1.0.0
  25. |===
  26. */ // end::reference[]
  27. #define BOOST_ARCH_SH BOOST_VERSION_NUMBER_NOT_AVAILABLE
  28. #if defined(__sh__)
  29. # undef BOOST_ARCH_SH
  30. # if !defined(BOOST_ARCH_SH) && (defined(__SH5__))
  31. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER(5,0,0)
  32. # endif
  33. # if !defined(BOOST_ARCH_SH) && (defined(__SH4__))
  34. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER(4,0,0)
  35. # endif
  36. # if !defined(BOOST_ARCH_SH) && (defined(__sh3__) || defined(__SH3__))
  37. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER(3,0,0)
  38. # endif
  39. # if !defined(BOOST_ARCH_SH) && (defined(__sh2__))
  40. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER(2,0,0)
  41. # endif
  42. # if !defined(BOOST_ARCH_SH) && (defined(__sh1__))
  43. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER(1,0,0)
  44. # endif
  45. # if !defined(BOOST_ARCH_SH)
  46. # define BOOST_ARCH_SH BOOST_VERSION_NUMBER_AVAILABLE
  47. # endif
  48. #endif
  49. #if BOOST_ARCH_SH
  50. # define BOOST_ARCH_SH_AVAILABLE
  51. #endif
  52. #if BOOST_ARCH_SH
  53. # if BOOST_ARCH_SH >= BOOST_VERSION_NUMBER(5,0,0)
  54. # undef BOOST_ARCH_WORD_BITS_64
  55. # define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
  56. # elif BOOST_ARCH_SH >= BOOST_VERSION_NUMBER(3,0,0)
  57. # undef BOOST_ARCH_WORD_BITS_32
  58. # define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
  59. # else
  60. # undef BOOST_ARCH_WORD_BITS_16
  61. # define BOOST_ARCH_WORD_BITS_16 BOOST_VERSION_NUMBER_AVAILABLE
  62. # endif
  63. #endif
  64. #define BOOST_ARCH_SH_NAME "SuperH"
  65. #endif
  66. #include <boost/predef/detail/test.h>
  67. BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SH,BOOST_ARCH_SH_NAME)