You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.2KB

  1. /*
  2. * Copyright (c) 2009 Loren Merritt
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "config.h"
  21. #define GLUE(a, b) a ## b
  22. #define JOIN(a, b) GLUE(a, b)
  23. #define X(s) JOIN(EXTERN_ASM, s)
  24. #if ARCH_PPC64
  25. #define PTR .quad
  26. #define lp ld
  27. #define lpx ldx
  28. #define stp std
  29. #define stpu stdu
  30. #define PS 8
  31. #define L(s) JOIN(., s)
  32. .macro extfunc name
  33. .global X(\name)
  34. .section .opd, "aw"
  35. X(\name):
  36. .quad L(\name), .TOC.@tocbase, 0
  37. .previous
  38. .type X(\name), STT_FUNC
  39. L(\name):
  40. .endm
  41. .macro movrel rd, sym
  42. ld \rd, \sym@got(r2)
  43. .endm
  44. #else /* ARCH_PPC64 */
  45. #define PTR .int
  46. #define lp lwz
  47. #define lpx lwzx
  48. #define stp stw
  49. #define stpu stwu
  50. #define PS 4
  51. #define L(s) s
  52. .macro extfunc name
  53. .global X(\name)
  54. .type X(\name), STT_FUNC
  55. X(\name):
  56. \name:
  57. .endm
  58. .macro movrel rd, sym
  59. #if CONFIG_PIC
  60. lwz \rd, \sym@got(r2)
  61. #else
  62. lis \rd, \sym@ha
  63. la \rd, \sym@l(\rd)
  64. #endif
  65. .endm
  66. #endif /* ARCH_PPC64 */
  67. #if HAVE_IBM_ASM
  68. .macro DEFINE_REG n
  69. .equiv r\n, \n
  70. .equiv f\n, \n
  71. .equiv v\n, \n
  72. .endm
  73. DEFINE_REG 0
  74. DEFINE_REG 1
  75. DEFINE_REG 2
  76. DEFINE_REG 3
  77. DEFINE_REG 4
  78. DEFINE_REG 5
  79. DEFINE_REG 6
  80. DEFINE_REG 7
  81. DEFINE_REG 8
  82. DEFINE_REG 9
  83. DEFINE_REG 10
  84. DEFINE_REG 11
  85. DEFINE_REG 12
  86. DEFINE_REG 13
  87. DEFINE_REG 14
  88. DEFINE_REG 15
  89. DEFINE_REG 16
  90. DEFINE_REG 17
  91. DEFINE_REG 18
  92. DEFINE_REG 19
  93. DEFINE_REG 20
  94. DEFINE_REG 21
  95. DEFINE_REG 22
  96. DEFINE_REG 23
  97. DEFINE_REG 24
  98. DEFINE_REG 25
  99. DEFINE_REG 26
  100. DEFINE_REG 27
  101. DEFINE_REG 28
  102. DEFINE_REG 29
  103. DEFINE_REG 30
  104. DEFINE_REG 31
  105. #endif /* HAVE_IBM_ASM */