float.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. #include <u.h>
  2. #include <libc.h>
  3. #include <bio.h>
  4. #include <mach.h>
  5. #include "arm.h"
  6. void unimp(ulong);
  7. void Ifcmp(ulong);
  8. void Ifdiv(ulong);
  9. void Ifmul(ulong);
  10. void Ifadd(ulong);
  11. void Ifsub(ulong);
  12. void Ifmov(ulong);
  13. void Icvtd(ulong);
  14. void Icvtw(ulong);
  15. void Icvts(ulong);
  16. void Ifabs(ulong);
  17. void Ifneg(ulong);
  18. Inst cop1[] = {
  19. { Ifadd, "add.f", Ifloat },
  20. { Ifsub, "sub.f", Ifloat },
  21. { Ifmul, "mul.f", Ifloat },
  22. { Ifdiv, "div.f", Ifloat },
  23. { unimp, "", },
  24. { Ifabs, "abs.f", Ifloat },
  25. { Ifmov, "mov.f", Ifloat },
  26. { Ifneg, "neg.f", Ifloat },
  27. { unimp, "", },
  28. { unimp, "", },
  29. { unimp, "", },
  30. { unimp, "", },
  31. { unimp, "", },
  32. { unimp, "", },
  33. { unimp, "", },
  34. { unimp, "", },
  35. { unimp, "", },
  36. { unimp, "", },
  37. { unimp, "", },
  38. { unimp, "", },
  39. { unimp, "", },
  40. { unimp, "", },
  41. { unimp, "", },
  42. { unimp, "", },
  43. { unimp, "", },
  44. { unimp, "", },
  45. { unimp, "", },
  46. { unimp, "", },
  47. { unimp, "", },
  48. { unimp, "", },
  49. { unimp, "", },
  50. { unimp, "", },
  51. { Icvts, "cvt.s", Ifloat },
  52. { Icvtd, "cvt.d", Ifloat },
  53. { unimp, "", },
  54. { unimp, "", },
  55. { Icvtw, "cvt.w", Ifloat },
  56. { unimp, "", },
  57. { unimp, "", },
  58. { unimp, "", },
  59. { unimp, "", },
  60. { unimp, "", },
  61. { unimp, "", },
  62. { unimp, "", },
  63. { unimp, "", },
  64. { unimp, "", },
  65. { unimp, "", },
  66. { unimp, "", },
  67. { Ifcmp, "c.f", Ifloat },
  68. { Ifcmp, "c.un", Ifloat },
  69. { Ifcmp, "c.eq", Ifloat },
  70. { Ifcmp, "c.ueq", Ifloat },
  71. { Ifcmp, "c.olt", Ifloat },
  72. { Ifcmp, "c.ult", Ifloat },
  73. { Ifcmp, "c.ole", Ifloat },
  74. { Ifcmp, "c.ule", Ifloat },
  75. { Ifcmp, "c,sf", Ifloat },
  76. { Ifcmp, "c.ngle",Ifloat },
  77. { Ifcmp, "c.seq", Ifloat },
  78. { Ifcmp, "c.ngl", Ifloat },
  79. { Ifcmp, "c.lt", Ifloat },
  80. { Ifcmp, "c.nge", Ifloat },
  81. { Ifcmp, "c.le", Ifloat },
  82. { Ifcmp, "c.ngt", Ifloat },
  83. { 0 }
  84. };
  85. void
  86. unimp(ulong inst)
  87. {
  88. print("op %d\n", inst&0x3f);
  89. Bprint(bioout, "Unimplemented floating point Trap IR %.8lux\n", inst);
  90. longjmp(errjmp, 0);
  91. }
  92. void
  93. inval(ulong inst)
  94. {
  95. Bprint(bioout, "Invalid Operation Exception IR %.8lux\n", inst);
  96. longjmp(errjmp, 0);
  97. }
  98. void
  99. ifmt(int r)
  100. {
  101. Bprint(bioout, "Invalid Floating Data Format f%d pc 0x%lux\n", r, reg.r[15]);
  102. longjmp(errjmp, 0);
  103. }
  104. void
  105. floatop(int dst, int s1, int s2)
  106. {
  107. }
  108. void
  109. doubop(int dst, int s1, int s2)
  110. {
  111. }
  112. void
  113. Iswc1(ulong inst)
  114. {
  115. }
  116. void
  117. Ifsub(ulong ir)
  118. {
  119. }
  120. void
  121. Ifmov(ulong ir)
  122. {
  123. }
  124. void
  125. Ifabs(ulong ir)
  126. {
  127. }
  128. void
  129. Ifneg(ulong ir)
  130. {
  131. }
  132. void
  133. Icvtd(ulong ir)
  134. {
  135. }
  136. void
  137. Icvts(ulong ir)
  138. {
  139. }
  140. void
  141. Icvtw(ulong ir)
  142. {
  143. }
  144. void
  145. Ifadd(ulong ir)
  146. {
  147. }
  148. void
  149. Ifmul(ulong ir)
  150. {
  151. }
  152. void
  153. Ifdiv(ulong ir)
  154. {
  155. }
  156. void
  157. Ilwc1(ulong inst)
  158. {
  159. }
  160. void
  161. Ibcfbct(ulong inst)
  162. {
  163. }
  164. void
  165. Imtct(ulong ir)
  166. {
  167. }
  168. void
  169. Imfcf(ulong ir)
  170. {
  171. }
  172. void
  173. Icop1(ulong ir)
  174. {
  175. }
  176. void
  177. Ifcmp(ulong ir)
  178. {
  179. }