mqmachs.cgs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. # frv testcase for mqmachs $GRi,$GRj,$ACCk
  2. # mach: frv fr500 fr400
  3. .include "testutils.inc"
  4. start
  5. .global mqmachs
  6. mqmachs:
  7. ; Positive operands
  8. set_fr_iimmed 2,3,fr8 ; multiply small numbers
  9. set_fr_iimmed 3,2,fr10
  10. set_fr_iimmed 0,1,fr9 ; multiply by 0
  11. set_fr_iimmed 2,0,fr11
  12. mqmachs fr8,fr10,acc0
  13. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  14. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  15. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  16. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  17. test_accg_immed 0,accg0
  18. test_acc_immed 6,acc0
  19. test_accg_immed 0,accg1
  20. test_acc_immed 6,acc1
  21. test_accg_immed 0,accg2
  22. test_acc_immed 0,acc2
  23. test_accg_immed 0,accg3
  24. test_acc_immed 0,acc3
  25. set_fr_iimmed 2,1,fr8 ; multiply by 1
  26. set_fr_iimmed 1,2,fr10
  27. set_fr_iimmed 0x3fff,2,fr9 ; 15 bit result
  28. set_fr_iimmed 2,0x3fff,fr11
  29. mqmachs fr8,fr10,acc0
  30. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  31. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  32. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  33. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  34. test_accg_immed 0,accg0
  35. test_acc_immed 8,acc0
  36. test_accg_immed 0,accg1
  37. test_acc_immed 8,acc1
  38. test_accg_immed 0,accg2
  39. test_acc_limmed 0,0x7ffe,acc2
  40. test_accg_immed 0,accg3
  41. test_acc_limmed 0,0x7ffe,acc3
  42. set_fr_iimmed 0x4000,2,fr8 ; 16 bit result
  43. set_fr_iimmed 2,0x4000,fr10
  44. set_fr_iimmed 0x7fff,0x7fff,fr9 ; max positive result
  45. set_fr_iimmed 0x7fff,0x7fff,fr11
  46. mqmachs fr8,fr10,acc0
  47. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  48. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  49. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  50. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  51. test_accg_immed 0,accg0
  52. test_acc_limmed 0x0000,0x8008,acc0
  53. test_accg_immed 0,accg1
  54. test_acc_limmed 0x0000,0x8008,acc1
  55. test_accg_immed 0,accg2
  56. test_acc_limmed 0x3fff,0x7fff,acc2
  57. test_accg_immed 0,accg3
  58. test_acc_limmed 0x3fff,0x7fff,acc3
  59. ; Mixed operands
  60. set_fr_iimmed 2,0xfffd,fr8 ; multiply small numbers
  61. set_fr_iimmed 0xfffd,2,fr10
  62. set_fr_iimmed 0xfffe,1,fr9 ; multiply by 1
  63. set_fr_iimmed 1,0xfffe,fr11
  64. mqmachs fr8,fr10,acc0
  65. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  66. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  67. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  68. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  69. test_accg_immed 0,accg0
  70. test_acc_limmed 0x0000,0x8002,acc0
  71. test_accg_immed 0,accg1
  72. test_acc_limmed 0x0000,0x8002,acc1
  73. test_accg_immed 0,accg2
  74. test_acc_limmed 0x3fff,0x7ffd,acc2
  75. test_accg_immed 0,accg3
  76. test_acc_limmed 0x3fff,0x7ffd,acc3
  77. set_fr_iimmed 0xfffe,0,fr8 ; multiply by 0
  78. set_fr_iimmed 0,0xfffe,fr10
  79. set_fr_iimmed 0x2001,0xfffe,fr9 ; 15 bit result
  80. set_fr_iimmed 0xfffe,0x2001,fr11
  81. mqmachs fr8,fr10,acc0
  82. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  83. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  84. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  85. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  86. test_accg_immed 0,accg0
  87. test_acc_limmed 0x0000,0x8002,acc0
  88. test_accg_immed 0,accg1
  89. test_acc_limmed 0x0000,0x8002,acc1
  90. test_accg_immed 0,accg2
  91. test_acc_limmed 0x3fff,0x3ffb,acc2
  92. test_accg_immed 0,accg3
  93. test_acc_limmed 0x3fff,0x3ffb,acc3
  94. set_fr_iimmed 0x4000,0xfffe,fr8 ; 16 bit result
  95. set_fr_iimmed 0xfffe,0x4000,fr10
  96. set_fr_iimmed 0x7fff,0x8000,fr9 ; max negative result
  97. set_fr_iimmed 0x8000,0x7fff,fr11
  98. mqmachs fr8,fr10,acc0
  99. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  100. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  101. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  102. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  103. test_accg_immed 0,accg0
  104. test_acc_limmed 0x0000,0x0002,acc0
  105. test_accg_immed 0,accg1
  106. test_acc_limmed 0x0000,0x0002,acc1
  107. test_accg_immed 0xff,accg2
  108. test_acc_limmed 0xffff,0xbffb,acc2
  109. test_accg_immed 0xff,accg3
  110. test_acc_limmed 0xffff,0xbffb,acc3
  111. ; Negative operands
  112. set_fr_iimmed 0xfffe,0xfffd,fr8 ; multiply small numbers
  113. set_fr_iimmed 0xfffd,0xfffe,fr10
  114. set_fr_iimmed 0xffff,0xfffe,fr9 ; multiply by -1
  115. set_fr_iimmed 0xfffe,0xffff,fr11
  116. mqmachs fr8,fr10,acc0
  117. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  118. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  119. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  120. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  121. test_accg_immed 0,accg0
  122. test_acc_limmed 0x0000,0x0008,acc0
  123. test_accg_immed 0,accg1
  124. test_acc_limmed 0x0000,0x0008,acc1
  125. test_accg_immed 0xff,accg2
  126. test_acc_limmed 0xffff,0xbffd,acc2
  127. test_accg_immed 0xff,accg3
  128. test_acc_limmed 0xffff,0xbffd,acc3
  129. set_fr_iimmed 0x8001,0x8001,fr8 ; almost max positive result
  130. set_fr_iimmed 0x8001,0x8001,fr10
  131. set_fr_iimmed 0x8000,0x8000,fr9 ; max positive result
  132. set_fr_iimmed 0x8000,0x8000,fr11
  133. mqmachs fr8,fr10,acc0
  134. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  135. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  136. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  137. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  138. test_accg_immed 0,accg0
  139. test_acc_immed 0x3fff0009,acc0
  140. test_accg_immed 0,accg1
  141. test_acc_immed 0x3fff0009,acc1
  142. test_accg_immed 0,accg2
  143. test_acc_immed 0x3fffbffd,acc2
  144. test_accg_immed 0,accg3
  145. test_acc_immed 0x3fffbffd,acc3
  146. set_accg_immed 0x7f,accg0 ; saturation
  147. set_acc_immed 0xffffffff,acc0
  148. set_accg_immed 0x7f,accg1
  149. set_acc_immed 0xffffffff,acc1
  150. set_accg_immed 0x7f,accg2 ; saturation
  151. set_acc_immed 0xffffffff,acc2
  152. set_accg_immed 0x7f,accg3
  153. set_acc_immed 0xffffffff,acc3
  154. set_fr_iimmed 1,1,fr8
  155. set_fr_iimmed 1,1,fr10
  156. set_fr_iimmed 0x7fff,0x7fff,fr9 ; saturation
  157. set_fr_iimmed 0x7fff,0x7fff,fr11
  158. mqmachs fr8,fr10,acc0
  159. test_spr_bits 0x3c,2,0xf,msr0 ; msr0.sie is set
  160. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  161. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  162. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  163. test_accg_immed 0x7f,accg0
  164. test_acc_limmed 0xffff,0xffff,acc0
  165. test_accg_immed 0x7f,accg1
  166. test_acc_limmed 0xffff,0xffff,acc1
  167. test_accg_immed 0x7f,accg2
  168. test_acc_limmed 0xffff,0xffff,acc2
  169. test_accg_immed 0x7f,accg3
  170. test_acc_limmed 0xffff,0xffff,acc3
  171. set_accg_immed 0x80,accg0 ; saturation
  172. set_acc_immed 0,acc0
  173. set_accg_immed 0x80,accg1
  174. set_acc_immed 0,acc1
  175. set_accg_immed 0x80,accg2 ; saturation
  176. set_acc_immed 0,acc2
  177. set_accg_immed 0x80,accg3
  178. set_acc_immed 0,acc3
  179. set_fr_iimmed 0xffff,0,fr8
  180. set_fr_iimmed 1,0xffff,fr10
  181. set_fr_iimmed 0x0000,0x8000,fr9 ; saturation
  182. set_fr_iimmed 0x7fff,0x7fff,fr11
  183. mqmachs fr8,fr10,acc0
  184. test_spr_bits 0x3c,2,0x9,msr0 ; msr0.sie is set
  185. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  186. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  187. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  188. test_accg_immed 0x80,accg0
  189. test_acc_immed 0,acc0
  190. test_accg_immed 0x80,accg1
  191. test_acc_immed 0,acc1
  192. test_accg_immed 0x80,accg2
  193. test_acc_immed 0,acc2
  194. test_accg_immed 0x80,accg3
  195. test_acc_immed 0,acc3
  196. pass