setjmp.S 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
  3. * This program and the accompanying materials are licensed and made
  4. available
  5. * under the terms and conditions of the BSD License which accompanies
  6. this
  7. * distribution. The full text of the license may be found at
  8. * http://opensource.org/licenses/bsd-license.php.
  9. *
  10. * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
  11. BASIS,
  12. * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
  13. * IMPLIED.
  14. */
  15. .text
  16. .globl setjmp
  17. .type setjmp, @function
  18. setjmp:
  19. alloc loc0 = ar.pfs, 1, 2, 1, 0
  20. ;;
  21. mov r14 = ar.unat
  22. mov r15 = ar.bsp
  23. add r10 = 0x10*20, in0
  24. ;;
  25. stf.spill.nta [in0] = f2, 0x10
  26. st8.spill.nta [r10] = r4, 8
  27. mov r21 = b1
  28. ;;
  29. stf.spill.nta [in0] = f3, 0x10
  30. st8.spill.nta [r10] = r5, 8
  31. mov r22 = b2
  32. ;;
  33. stf.spill.nta [in0] = f4, 0x10
  34. st8.spill.nta [r10] = r6, 8
  35. mov r23 = b3
  36. ;;
  37. stf.spill.nta [in0] = f5, 0x10
  38. st8.spill.nta [r10] = r7, 8
  39. mov r24 = b4
  40. ;;
  41. stf.spill.nta [in0] = f16, 0x10
  42. st8.spill.nta [r10] = sp, 8
  43. mov r25 = b5
  44. ;;
  45. stf.spill.nta [in0] = f17, 0x10
  46. st8.nta [r10] = loc1, 8
  47. mov r16 = pr
  48. ;;
  49. stf.spill.nta [in0] = f18, 0x10
  50. st8.nta [r10] = r21, 8
  51. mov r17 = ar.lc
  52. ;;
  53. stf.spill.nta [in0] = f19, 0x10
  54. st8.nta [r10] = r22, 8
  55. ;;
  56. stf.spill.nta [in0] = f20, 0x10
  57. st8.nta [r10] = r23, 8
  58. ;;
  59. stf.spill.nta [in0] = f21, 0x10
  60. st8.nta [r10] = r24, 8
  61. ;;
  62. stf.spill.nta [in0] = f22, 0x10
  63. st8.nta [r10] = r25, 8
  64. ;;
  65. stf.spill.nta [in0] = f23, 0x10
  66. mov r18 = ar.unat
  67. ;;
  68. stf.spill.nta [in0] = f24, 0x10
  69. st8.nta [r10] = r14, 8
  70. ;;
  71. stf.spill.nta [in0] = f25, 0x10
  72. st8.nta [r10] = r18, 8
  73. ;;
  74. stf.spill.nta [in0] = f26, 0x10
  75. st8.nta [r10] = loc0, 8
  76. ;;
  77. stf.spill.nta [in0] = f27, 0x10
  78. st8.nta [r10] = r15, 8
  79. mov r8 = 0
  80. ;;
  81. stf.spill.nta [in0] = f28, 0x10
  82. mov r19 = ar.fpsr
  83. ;;
  84. stf.spill.nta [in0] = f29, 0x10
  85. st8.nta [r10] = r16, 8
  86. mov ar.pfs = loc0
  87. ;;
  88. stf.spill.nta [in0] = f30, 0x10
  89. st8.nta [r10] = r17, 8
  90. mov b0 = loc1
  91. ;;
  92. stf.spill.nta [in0] = f31, 0x10
  93. st8.nta [r10] = r19
  94. ;;
  95. mov ar.unat = r14
  96. br.ret.sptk b0
  97. ;;
  98. .globl longjmp
  99. .type longjmp, @function
  100. .regstk 2, 0, 0, 0
  101. longjmp:
  102. add r10 = 0x10*20 + 8*14, in0
  103. movl r2 = ~((((1<<14) - 1) << 16) | 3)
  104. ;;
  105. ld8.nt1 r14 = [r10], -8*2
  106. mov r15 = ar.bspstore
  107. ;;
  108. ld8.nt1 r17 = [r10], -8
  109. mov r16 = ar.rsc
  110. cmp.leu p6 = r14, r15
  111. ;;
  112. ld8.nt1 r18 = [r10], -8
  113. ld8.nt1 r25 = [r10], -8
  114. and r2 = r16, r2
  115. ;;
  116. ldf.fill.nt1 f2 = [in0], 0x10
  117. ld8.nt1 r24 = [r10], -8
  118. mov b5 = r25
  119. ;;
  120. mov ar.rsc = r2
  121. ld8.nt1 r23 = [r10], -8
  122. mov b4 = r24
  123. ;;
  124. ldf.fill.nt1 f3 = [in0], 0x10
  125. mov ar.unat = r17
  126. (p6) br.spnt.many _skip_flushrs
  127. ;;
  128. flushrs
  129. mov r15 = ar.bsp
  130. ;;
  131. _skip_flushrs:
  132. mov r31 = ar.rnat
  133. loadrs
  134. ;;
  135. ldf.fill.nt1 f4 = [in0], 0x10
  136. ld8.nt1 r22 = [r10], -8
  137. dep r2 = -1, r14, 3, 6
  138. ;;
  139. ldf.fill.nt1 f5 = [in0], 0x10
  140. ld8.nt1 r21 = [r10], -8
  141. cmp.ltu p6 = r2, r15
  142. ;;
  143. ld8.nt1 r20 = [r10], -0x10
  144. (p6) ld8.nta r31 = [r2]
  145. mov b3 = r23
  146. ;;
  147. ldf.fill.nt1 f16 = [in0], 0x10
  148. ld8.fill.nt1 r7 = [r10], -8
  149. mov b2 = r22
  150. ;;
  151. ldf.fill.nt1 f17 = [in0], 0x10
  152. ld8.fill.nt1 r6 = [r10], -8
  153. mov b1 = r21
  154. ;;
  155. ldf.fill.nt1 f18 = [in0], 0x10
  156. ld8.fill.nt1 r5 = [r10], -8
  157. mov b0 = r20
  158. ;;
  159. ldf.fill.nt1 f19 = [in0], 0x10
  160. ld8.fill.nt1 r4 = [r10], 8*13
  161. ;;
  162. ldf.fill.nt1 f20 = [in0], 0x10
  163. ld8.nt1 r19 = [r10], 0x10
  164. ;;
  165. ldf.fill.nt1 f21 = [in0], 0x10
  166. ld8.nt1 r26 = [r10], 8
  167. mov ar.pfs = r19
  168. ;;
  169. ldf.fill.nt1 f22 = [in0], 0x10
  170. ld8.nt1 r27 = [r10], 8
  171. mov pr = r26, -1
  172. ;;
  173. ldf.fill.nt1 f23 = [in0], 0x10
  174. ld8.nt1 r28 = [r10], -17*8 - 0x10
  175. mov ar.lc = r27
  176. ;;
  177. ldf.fill.nt1 f24 = [in0], 0x10
  178. ldf.fill.nt1 f25 = [in0], 0x10
  179. mov r8 = in1
  180. ;;
  181. ldf.fill.nt1 f26 = [in0], 0x10
  182. ldf.fill.nt1 f31 = [r10], -0x10
  183. ;;
  184. ldf.fill.nt1 f27 = [in0], 0x10
  185. ldf.fill.nt1 f30 = [r10], -0x10
  186. ;;
  187. ldf.fill.nt1 f28 = [in0]
  188. ldf.fill.nt1 f29 = [r10], 0x10*3 + 8*4
  189. ;;
  190. ld8.fill.nt1 sp = [r10]
  191. mov ar.unat = r18
  192. ;;
  193. mov ar.bspstore = r14
  194. mov ar.rnat = r31
  195. ;;
  196. invala
  197. mov ar.rsc = r16
  198. br.ret.sptk b0
  199. #if defined(__ELF__) && defined(__linux__)
  200. .section .note.GNU-stack,"",%progbits
  201. #endif