darwin-asm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Macro definitions to used to support 32/64-bit code in Darwin's
  2. * assembly files.
  3. *
  4. * Copyright (C) 2004-2022 Free Software Foundation, Inc.
  5. *
  6. * This file is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 3, or (at your option) any
  9. * later version.
  10. *
  11. * This file is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * Under Section 7 of GPL version 3, you are granted additional
  17. * permissions described in the GCC Runtime Library Exception, version
  18. * 3.1, as published by the Free Software Foundation.
  19. *
  20. * You should have received a copy of the GNU General Public License and
  21. * a copy of the GCC Runtime Library Exception along with this program;
  22. * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  23. * <http://www.gnu.org/licenses/>.
  24. */
  25. /* These are donated from /usr/include/architecture/ppc . */
  26. #if defined(__ppc64__)
  27. #define MODE_CHOICE(x, y) y
  28. #else
  29. #define MODE_CHOICE(x, y) x
  30. #endif
  31. #define cmpg MODE_CHOICE(cmpw, cmpd)
  32. #define lg MODE_CHOICE(lwz, ld)
  33. #define stg MODE_CHOICE(stw, std)
  34. #define lgx MODE_CHOICE(lwzx, ldx)
  35. #define stgx MODE_CHOICE(stwx, stdx)
  36. #define lgu MODE_CHOICE(lwzu, ldu)
  37. #define stgu MODE_CHOICE(stwu, stdu)
  38. #define lgux MODE_CHOICE(lwzux, ldux)
  39. #define stgux MODE_CHOICE(stwux, stdux)
  40. #define lgwa MODE_CHOICE(lwz, lwa)
  41. #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
  42. #define GPR_BYTES MODE_CHOICE(4,8) /* size of a GPR in bytes */
  43. #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
  44. #define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* position of saved
  45. LR in frame */