ops_gcc_aarch32_common.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2020 Andrey Semashev
  7. */
  8. /*!
  9. * \file atomic/detail/ops_gcc_aarch32_common.hpp
  10. *
  11. * This header contains basic utilities for gcc AArch32 backend.
  12. */
  13. #ifndef BOOST_ATOMIC_DETAIL_OPS_GCC_AARCH32_COMMON_HPP_INCLUDED_
  14. #define BOOST_ATOMIC_DETAIL_OPS_GCC_AARCH32_COMMON_HPP_INCLUDED_
  15. #include <boost/atomic/detail/config.hpp>
  16. #include <boost/atomic/detail/capabilities.hpp>
  17. #ifdef BOOST_HAS_PRAGMA_ONCE
  18. #pragma once
  19. #endif
  20. #define BOOST_ATOMIC_DETAIL_AARCH32_MO_SWITCH(mo)\
  21. switch (mo)\
  22. {\
  23. case memory_order_relaxed:\
  24. BOOST_ATOMIC_DETAIL_AARCH32_MO_INSN("r", "r")\
  25. break;\
  26. \
  27. case memory_order_consume:\
  28. case memory_order_acquire:\
  29. BOOST_ATOMIC_DETAIL_AARCH32_MO_INSN("a", "r")\
  30. break;\
  31. \
  32. case memory_order_release:\
  33. BOOST_ATOMIC_DETAIL_AARCH32_MO_INSN("r", "l")\
  34. break;\
  35. \
  36. default:\
  37. BOOST_ATOMIC_DETAIL_AARCH32_MO_INSN("a", "l")\
  38. break;\
  39. }
  40. #if defined(BOOST_ATOMIC_DETAIL_AARCH32_LITTLE_ENDIAN)
  41. #define BOOST_ATOMIC_DETAIL_AARCH32_ASM_ARG_LO(arg) "%" BOOST_STRINGIZE(arg)
  42. #define BOOST_ATOMIC_DETAIL_AARCH32_ASM_ARG_HI(arg) "%H" BOOST_STRINGIZE(arg)
  43. #else
  44. #define BOOST_ATOMIC_DETAIL_AARCH32_ASM_ARG_LO(arg) "%H" BOOST_STRINGIZE(arg)
  45. #define BOOST_ATOMIC_DETAIL_AARCH32_ASM_ARG_HI(arg) "%" BOOST_STRINGIZE(arg)
  46. #endif
  47. #endif // BOOST_ATOMIC_DETAIL_OPS_GCC_AARCH32_COMMON_HPP_INCLUDED_