fpu-low.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /* MN10300 Low level FPU management operations
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <asm/cpu-regs.h>
  12. ###############################################################################
  13. #
  14. # void fpu_init_state(void)
  15. # - initialise the FPU
  16. #
  17. ###############################################################################
  18. .globl fpu_init_state
  19. .type fpu_init_state,@function
  20. fpu_init_state:
  21. mov epsw,d0
  22. or EPSW_FE,epsw
  23. #ifdef CONFIG_MN10300_PROC_MN103E010
  24. nop
  25. nop
  26. nop
  27. #endif
  28. fmov 0,fs0
  29. fmov fs0,fs1
  30. fmov fs0,fs2
  31. fmov fs0,fs3
  32. fmov fs0,fs4
  33. fmov fs0,fs5
  34. fmov fs0,fs6
  35. fmov fs0,fs7
  36. fmov fs0,fs8
  37. fmov fs0,fs9
  38. fmov fs0,fs10
  39. fmov fs0,fs11
  40. fmov fs0,fs12
  41. fmov fs0,fs13
  42. fmov fs0,fs14
  43. fmov fs0,fs15
  44. fmov fs0,fs16
  45. fmov fs0,fs17
  46. fmov fs0,fs18
  47. fmov fs0,fs19
  48. fmov fs0,fs20
  49. fmov fs0,fs21
  50. fmov fs0,fs22
  51. fmov fs0,fs23
  52. fmov fs0,fs24
  53. fmov fs0,fs25
  54. fmov fs0,fs26
  55. fmov fs0,fs27
  56. fmov fs0,fs28
  57. fmov fs0,fs29
  58. fmov fs0,fs30
  59. fmov fs0,fs31
  60. fmov FPCR_INIT,fpcr
  61. #ifdef CONFIG_MN10300_PROC_MN103E010
  62. nop
  63. nop
  64. nop
  65. #endif
  66. mov d0,epsw
  67. ret [],0
  68. .size fpu_init_state,.-fpu_init_state
  69. ###############################################################################
  70. #
  71. # void fpu_save(struct fpu_state_struct *)
  72. # - save the fpu state
  73. # - note that an FPU Operational exception might occur during this process
  74. #
  75. ###############################################################################
  76. .globl fpu_save
  77. .type fpu_save,@function
  78. fpu_save:
  79. mov epsw,d1
  80. or EPSW_FE,epsw /* enable the FPU so we can access it */
  81. #ifdef CONFIG_MN10300_PROC_MN103E010
  82. nop
  83. nop
  84. #endif
  85. mov d0,a0
  86. fmov fs0,(a0+)
  87. fmov fs1,(a0+)
  88. fmov fs2,(a0+)
  89. fmov fs3,(a0+)
  90. fmov fs4,(a0+)
  91. fmov fs5,(a0+)
  92. fmov fs6,(a0+)
  93. fmov fs7,(a0+)
  94. fmov fs8,(a0+)
  95. fmov fs9,(a0+)
  96. fmov fs10,(a0+)
  97. fmov fs11,(a0+)
  98. fmov fs12,(a0+)
  99. fmov fs13,(a0+)
  100. fmov fs14,(a0+)
  101. fmov fs15,(a0+)
  102. fmov fs16,(a0+)
  103. fmov fs17,(a0+)
  104. fmov fs18,(a0+)
  105. fmov fs19,(a0+)
  106. fmov fs20,(a0+)
  107. fmov fs21,(a0+)
  108. fmov fs22,(a0+)
  109. fmov fs23,(a0+)
  110. fmov fs24,(a0+)
  111. fmov fs25,(a0+)
  112. fmov fs26,(a0+)
  113. fmov fs27,(a0+)
  114. fmov fs28,(a0+)
  115. fmov fs29,(a0+)
  116. fmov fs30,(a0+)
  117. fmov fs31,(a0+)
  118. fmov fpcr,d0
  119. mov d0,(a0)
  120. #ifdef CONFIG_MN10300_PROC_MN103E010
  121. nop
  122. nop
  123. #endif
  124. mov d1,epsw
  125. ret [],0
  126. .size fpu_save,.-fpu_save
  127. ###############################################################################
  128. #
  129. # void fpu_restore(struct fpu_state_struct *)
  130. # - restore the fpu state
  131. # - note that an FPU Operational exception might occur during this process
  132. #
  133. ###############################################################################
  134. .globl fpu_restore
  135. .type fpu_restore,@function
  136. fpu_restore:
  137. mov epsw,d1
  138. or EPSW_FE,epsw /* enable the FPU so we can access it */
  139. #ifdef CONFIG_MN10300_PROC_MN103E010
  140. nop
  141. nop
  142. #endif
  143. mov d0,a0
  144. fmov (a0+),fs0
  145. fmov (a0+),fs1
  146. fmov (a0+),fs2
  147. fmov (a0+),fs3
  148. fmov (a0+),fs4
  149. fmov (a0+),fs5
  150. fmov (a0+),fs6
  151. fmov (a0+),fs7
  152. fmov (a0+),fs8
  153. fmov (a0+),fs9
  154. fmov (a0+),fs10
  155. fmov (a0+),fs11
  156. fmov (a0+),fs12
  157. fmov (a0+),fs13
  158. fmov (a0+),fs14
  159. fmov (a0+),fs15
  160. fmov (a0+),fs16
  161. fmov (a0+),fs17
  162. fmov (a0+),fs18
  163. fmov (a0+),fs19
  164. fmov (a0+),fs20
  165. fmov (a0+),fs21
  166. fmov (a0+),fs22
  167. fmov (a0+),fs23
  168. fmov (a0+),fs24
  169. fmov (a0+),fs25
  170. fmov (a0+),fs26
  171. fmov (a0+),fs27
  172. fmov (a0+),fs28
  173. fmov (a0+),fs29
  174. fmov (a0+),fs30
  175. fmov (a0+),fs31
  176. mov (a0),d0
  177. fmov d0,fpcr
  178. #ifdef CONFIG_MN10300_PROC_MN103E010
  179. nop
  180. nop
  181. nop
  182. #endif
  183. mov d1,epsw
  184. ret [],0
  185. .size fpu_restore,.-fpu_restore