windowspill.S 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Function to force register windows to the stack.
  2. Copyright (C) 2005, 2007 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <bits/xtensa-config.h>
  16. .text
  17. .align 4
  18. .literal_position
  19. .global __window_spill
  20. .type __window_spill, @function
  21. __window_spill:
  22. entry a1, 48
  23. bbci.l a0, 31, .L4 /* branch if called with call4 */
  24. bbsi.l a0, 30, .L12 /* branch if called with call12 */
  25. /* Called with call8: touch register NUM_REGS-12 (4/20/52) */
  26. .L8:
  27. #if XCHAL_NUM_AREGS > 16
  28. call12 1f
  29. retw
  30. .align 4
  31. 1: _entry a1, 48 /* touch NUM_REGS-24 (x/8/40) */
  32. #if XCHAL_NUM_AREGS == 32
  33. mov a8, a0
  34. retw
  35. #else
  36. mov a12, a0
  37. _entry a1, 48 /* touch NUM_REGS-36 (x/x/28) */
  38. mov a12, a0
  39. _entry a1, 48 /* touch NUM_REGS-48 (x/x/16) */
  40. mov a12, a0
  41. _entry a1, 16 /* touch NUM_REGS-60 (x/x/4) */
  42. #endif
  43. #endif
  44. mov a4, a0
  45. retw
  46. /* Called with call4: touch register NUM_REGS-8 (8/24/56) */
  47. .L4:
  48. #if XCHAL_NUM_AREGS == 16
  49. mov a8, a0
  50. #else
  51. call12 1f
  52. retw
  53. .align 4
  54. 1: _entry a1, 48 /* touch NUM_REGS-20 (x/12/44) */
  55. mov a12, a0
  56. #if XCHAL_NUM_AREGS > 32
  57. _entry a1, 48 /* touch NUM_REGS-32 (x/x/32) */
  58. mov a12, a0
  59. _entry a1, 48 /* touch NUM_REGS-44 (x/x/20) */
  60. mov a12, a0
  61. _entry a1, 48 /* touch NUM_REGS-56 (x/x/8) */
  62. mov a8, a0
  63. #endif
  64. #endif
  65. retw
  66. /* Called with call12: touch register NUM_REGS-16 (x/16/48) */
  67. .L12:
  68. #if XCHAL_NUM_AREGS > 16
  69. call12 1f
  70. retw
  71. .align 4
  72. 1: _entry a1, 48 /* touch NUM_REGS-28 (x/4/36) */
  73. #if XCHAL_NUM_AREGS == 32
  74. mov a4, a0
  75. #else
  76. mov a12, a0
  77. _entry a1, 48 /* touch NUM_REGS-40 (x/x/24) */
  78. mov a12, a0
  79. _entry a1, 48 /* touch NUM_REGS-52 (x/x/12) */
  80. mov a12, a0
  81. #endif
  82. #endif
  83. retw