mmachs.cgs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. # frv testcase for mmachs $GRi,$GRj,$ACCk
  2. # mach: frv fr500 fr400
  3. .include "testutils.inc"
  4. start
  5. .global mmachs
  6. mmachs:
  7. ; Positive operands
  8. set_fr_iimmed 2,3,fr7 ; multiply small numbers
  9. set_fr_iimmed 3,2,fr8
  10. mmachs fr7,fr8,acc0
  11. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  12. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  13. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  14. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  15. test_accg_immed 0,accg0
  16. test_acc_immed 6,acc0
  17. test_accg_immed 0,accg1
  18. test_acc_immed 6,acc1
  19. set_fr_iimmed 0,1,fr7 ; multiply by 0
  20. set_fr_iimmed 2,0,fr8
  21. mmachs fr7,fr8,acc0
  22. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  23. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  24. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  25. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  26. test_accg_immed 0,accg0
  27. test_acc_immed 6,acc0
  28. test_accg_immed 0,accg1
  29. test_acc_immed 6,acc1
  30. set_fr_iimmed 2,1,fr7 ; multiply by 1
  31. set_fr_iimmed 1,2,fr8
  32. mmachs fr7,fr8,acc0
  33. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  34. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  35. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  36. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  37. test_accg_immed 0,accg0
  38. test_acc_immed 8,acc0
  39. test_accg_immed 0,accg1
  40. test_acc_immed 8,acc1
  41. set_fr_iimmed 0x3fff,2,fr7 ; 15 bit result
  42. set_fr_iimmed 2,0x3fff,fr8
  43. mmachs fr7,fr8,acc0
  44. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  45. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  46. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  47. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  48. test_accg_immed 0,accg0
  49. test_acc_limmed 0,0x8006,acc0
  50. test_accg_immed 0,accg1
  51. test_acc_limmed 0,0x8006,acc1
  52. set_fr_iimmed 0x4000,2,fr7 ; 16 bit result
  53. set_fr_iimmed 2,0x4000,fr8
  54. mmachs fr7,fr8,acc0
  55. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  56. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  57. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  58. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  59. test_accg_immed 0,accg0
  60. test_acc_limmed 0x0001,0x0006,acc0
  61. test_accg_immed 0,accg1
  62. test_acc_limmed 0x0001,0x0006,acc1
  63. set_fr_iimmed 0x7fff,0x7fff,fr7 ; max positive result
  64. set_fr_iimmed 0x7fff,0x7fff,fr8
  65. mmachs fr7,fr8,acc0
  66. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  67. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  68. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  69. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  70. test_accg_immed 0,accg0
  71. test_acc_limmed 0x4000,0x0007,acc0
  72. test_accg_immed 0,accg1
  73. test_acc_limmed 0x4000,0x0007,acc1
  74. ; Mixed operands
  75. set_fr_iimmed 2,0xfffd,fr7 ; multiply small numbers
  76. set_fr_iimmed 0xfffd,2,fr8
  77. mmachs fr7,fr8,acc0
  78. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  79. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  80. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  81. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  82. test_accg_immed 0,accg0
  83. test_acc_limmed 0x4000,0x0001,acc0
  84. test_accg_immed 0,accg1
  85. test_acc_limmed 0x4000,0x0001,acc1
  86. set_fr_iimmed 0xfffe,1,fr7 ; multiply by 1
  87. set_fr_iimmed 1,0xfffe,fr8
  88. mmachs fr7,fr8,acc0
  89. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  90. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  91. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  92. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  93. test_accg_immed 0,accg0
  94. test_acc_limmed 0x3fff,0xffff,acc0
  95. test_accg_immed 0,accg1
  96. test_acc_limmed 0x3fff,0xffff,acc1
  97. set_fr_iimmed 0xfffe,0,fr7 ; multiply by 0
  98. set_fr_iimmed 0,0xfffe,fr8
  99. mmachs fr7,fr8,acc0
  100. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  101. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  102. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  103. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  104. test_accg_immed 0,accg0
  105. test_acc_limmed 0x3fff,0xffff,acc0
  106. test_accg_immed 0,accg1
  107. test_acc_limmed 0x3fff,0xffff,acc1
  108. set_fr_iimmed 0x2001,0xfffe,fr7 ; 15 bit result
  109. set_fr_iimmed 0xfffe,0x2001,fr8
  110. mmachs fr7,fr8,acc0
  111. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  112. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  113. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  114. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  115. test_accg_immed 0,accg0
  116. test_acc_limmed 0x3fff,0xbffd,acc0
  117. test_accg_immed 0,accg1
  118. test_acc_limmed 0x3fff,0xbffd,acc1
  119. set_fr_iimmed 0x4000,0xfffe,fr7 ; 16 bit result
  120. set_fr_iimmed 0xfffe,0x4000,fr8
  121. mmachs fr7,fr8,acc0
  122. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  123. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  124. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  125. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  126. test_accg_immed 0,accg0
  127. test_acc_limmed 0x3fff,0x3ffd,acc0
  128. test_accg_immed 0,accg1
  129. test_acc_limmed 0x3fff,0x3ffd,acc1
  130. set_fr_iimmed 0x7fff,0x8000,fr7 ; max negative result
  131. set_fr_iimmed 0x8000,0x7fff,fr8
  132. mmachs fr7,fr8,acc0
  133. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  134. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  135. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  136. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  137. test_accg_immed 0xff,accg0
  138. test_acc_limmed 0xffff,0xbffd,acc0
  139. test_accg_immed 0xff,accg1
  140. test_acc_limmed 0xffff,0xbffd,acc1
  141. ; Negative operands
  142. set_fr_iimmed 0xfffe,0xfffd,fr7 ; multiply small numbers
  143. set_fr_iimmed 0xfffd,0xfffe,fr8
  144. mmachs fr7,fr8,acc0
  145. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  146. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  147. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  148. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  149. test_accg_immed 0xff,accg0
  150. test_acc_limmed 0xffff,0xc003,acc0
  151. test_accg_immed 0xff,accg1
  152. test_acc_limmed 0xffff,0xc003,acc1
  153. set_fr_iimmed 0xffff,0xfffe,fr7 ; multiply by -1
  154. set_fr_iimmed 0xfffe,0xffff,fr8
  155. mmachs fr7,fr8,acc0
  156. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  157. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  158. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  159. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  160. test_accg_immed 0xff,accg0
  161. test_acc_limmed 0xffff,0xc005,acc0
  162. test_accg_immed 0xff,accg1
  163. test_acc_limmed 0xffff,0xc005,acc1
  164. set_fr_iimmed 0x8001,0x8001,fr7 ; almost max positive result
  165. set_fr_iimmed 0x8001,0x8001,fr8
  166. mmachs fr7,fr8,acc0
  167. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  168. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  169. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  170. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  171. test_accg_immed 0,accg0
  172. test_acc_immed 0x3ffec006,acc0
  173. test_accg_immed 0,accg1
  174. test_acc_immed 0x3ffec006,acc1
  175. set_fr_iimmed 0x8000,0x8000,fr7 ; max positive result
  176. set_fr_iimmed 0x8000,0x8000,fr8
  177. mmachs fr7,fr8,acc0
  178. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  179. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  180. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  181. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  182. test_accg_immed 0,accg0
  183. test_acc_immed 0x7ffec006,acc0
  184. test_accg_immed 0,accg1
  185. test_acc_immed 0x7ffec006,acc1
  186. set_accg_immed 0x7f,accg0 ; saturation
  187. set_acc_immed 0xffffffff,acc0
  188. set_accg_immed 0x7f,accg1
  189. set_acc_immed 0xffffffff,acc1
  190. set_fr_iimmed 1,1,fr7
  191. set_fr_iimmed 1,1,fr8
  192. mmachs fr7,fr8,acc0
  193. test_accg_immed 0x7f,accg0
  194. test_acc_limmed 0xffff,0xffff,acc0
  195. test_accg_immed 0x7f,accg1
  196. test_acc_limmed 0xffff,0xffff,acc1
  197. set_fr_iimmed 0x7fff,0x7fff,fr7 ; saturation
  198. set_fr_iimmed 0x7fff,0x7fff,fr8
  199. mmachs fr7,fr8,acc0
  200. test_spr_bits 0x3c,2,0xc,msr0 ; msr0.sie is set
  201. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  202. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  203. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  204. test_accg_immed 0x7f,accg0
  205. test_acc_limmed 0xffff,0xffff,acc0
  206. test_accg_immed 0x7f,accg1
  207. test_acc_limmed 0xffff,0xffff,acc1
  208. set_accg_immed 0x80,accg0 ; saturation
  209. set_acc_immed 0,acc0
  210. set_accg_immed 0x80,accg1
  211. set_acc_immed 0,acc1
  212. set_fr_iimmed 0xffff,0,fr7
  213. set_fr_iimmed 1,0xffff,fr8
  214. mmachs fr7,fr8,acc0
  215. test_spr_bits 0x3c,2,0x8,msr0 ; msr0.sie is set
  216. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  217. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  218. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  219. test_accg_immed 0x80,accg0
  220. test_acc_immed 0,acc0
  221. test_accg_immed 0x80,accg1
  222. test_acc_immed 0,acc1
  223. set_fr_iimmed 0x0000,0x8000,fr7 ; saturation
  224. set_fr_iimmed 0x7fff,0x7fff,fr8
  225. mmachs fr7,fr8,acc0
  226. test_spr_bits 0x3c,2,0x4,msr0 ; msr0.sie is set
  227. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  228. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  229. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  230. test_accg_immed 0x80,accg0
  231. test_acc_immed 0,acc0
  232. test_accg_immed 0x80,accg1
  233. test_acc_immed 0,acc1
  234. pass