mqmachu.cgs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # frv testcase for mqmachu $GRi,$GRj,$GRk
  2. # mach: frv fr500 fr400
  3. .include "testutils.inc"
  4. start
  5. .global mqmachu
  6. mqmachu:
  7. set_fr_iimmed 3,2,fr8 ; multiply small numbers
  8. set_fr_iimmed 2,3,fr10
  9. set_fr_iimmed 1,2,fr9 ; multiply by 1
  10. set_fr_iimmed 2,1,fr11
  11. mqmachu fr8,fr10,acc0
  12. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  13. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  14. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  15. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  16. test_accg_immed 0,accg0
  17. test_acc_immed 6,acc0
  18. test_accg_immed 0,accg1
  19. test_acc_immed 6,acc1
  20. test_accg_immed 0,accg2
  21. test_acc_immed 2,acc2
  22. test_accg_immed 0,accg3
  23. test_acc_immed 2,acc3
  24. set_fr_iimmed 0,2,fr8 ; multiply by 0
  25. set_fr_iimmed 2,0,fr10
  26. set_fr_iimmed 0x3fff,2,fr9 ; 15 bit result
  27. set_fr_iimmed 2,0x3fff,fr11
  28. mqmachu fr8,fr10,acc0
  29. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  30. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  31. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  32. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  33. test_accg_immed 0,accg0
  34. test_acc_immed 6,acc0
  35. test_accg_immed 0,accg1
  36. test_acc_immed 6,acc1
  37. test_accg_immed 0,accg2
  38. test_acc_limmed 0x0000,0x8000,acc2
  39. test_accg_immed 0,accg3
  40. test_acc_limmed 0x0000,0x8000,acc3
  41. set_fr_iimmed 0x4000,2,fr8 ; 16 bit result
  42. set_fr_iimmed 2,0x4000,fr10
  43. set_fr_iimmed 0x8000,2,fr9 ; 17 bit result
  44. set_fr_iimmed 2,0x8000,fr11
  45. mqmachu fr8,fr10,acc0
  46. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  47. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  48. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  49. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  50. test_accg_immed 0,accg0
  51. test_acc_limmed 0x0000,0x8006,acc0
  52. test_accg_immed 0,accg1
  53. test_acc_limmed 0x0000,0x8006,acc1
  54. test_accg_immed 0,accg2
  55. test_acc_immed 0x00018000,acc2
  56. test_accg_immed 0,accg3
  57. test_acc_immed 0x00018000,acc3
  58. set_fr_iimmed 0x7fff,0x7fff,fr8 ; max positive result
  59. set_fr_iimmed 0x7fff,0x7fff,fr10
  60. set_fr_iimmed 0x8000,0x8000,fr9 ; max positive result
  61. set_fr_iimmed 0x8000,0x8000,fr11
  62. mqmachu fr8,fr10,acc0
  63. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  64. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  65. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  66. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  67. test_accg_immed 0,accg0
  68. test_acc_immed 0x3fff8007,acc0
  69. test_accg_immed 0,accg1
  70. test_acc_immed 0x3fff8007,acc1
  71. test_accg_immed 0,accg2
  72. test_acc_limmed 0x4001,0x8000,acc2
  73. test_accg_immed 0,accg3
  74. test_acc_limmed 0x4001,0x8000,acc3
  75. set_fr_iimmed 0xffff,0xffff,fr8 ; max positive result
  76. set_fr_iimmed 0xffff,0xffff,fr10
  77. set_fr_iimmed 0xffff,0xffff,fr9 ; max positive result
  78. set_fr_iimmed 0xffff,0xffff,fr11
  79. mqmachu fr8,fr10,acc0
  80. test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear
  81. test_spr_bits 2,1,0,msr0 ; msr0.ovf not set
  82. test_spr_bits 1,0,0,msr0 ; msr0.aovf not set
  83. test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set
  84. test_accg_immed 1,accg0
  85. test_acc_limmed 0x3ffd,0x8008,acc0
  86. test_accg_immed 1,accg1
  87. test_acc_limmed 0x3ffd,0x8008,acc1
  88. test_accg_immed 1,accg2
  89. test_acc_limmed 0x3fff,0x8001,acc2
  90. test_accg_immed 1,accg3
  91. test_acc_limmed 0x3fff,0x8001,acc3
  92. set_accg_immed 0xff,accg0 ; saturation
  93. set_acc_immed 0xffffffff,acc0
  94. set_accg_immed 0xff,accg1
  95. set_acc_immed 0xffffffff,acc1
  96. set_accg_immed 0xff,accg2 ; saturation
  97. set_acc_immed 0xffffffff,acc2
  98. set_accg_immed 0xff,accg3
  99. set_acc_immed 0xffffffff,acc3
  100. set_fr_iimmed 1,1,fr8
  101. set_fr_iimmed 1,1,fr10
  102. set_fr_iimmed 1,1,fr9
  103. set_fr_iimmed 1,1,fr11
  104. mqmachu fr8,fr10,acc0
  105. test_spr_bits 0x3c,2,0xf,msr0 ; msr0.sie is set
  106. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  107. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  108. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  109. test_accg_immed 0xff,accg0
  110. test_acc_limmed 0xffff,0xffff,acc0
  111. test_accg_immed 0xff,accg1
  112. test_acc_limmed 0xffff,0xffff,acc1
  113. test_accg_immed 0xff,accg2
  114. test_acc_limmed 0xffff,0xffff,acc2
  115. test_accg_immed 0xff,accg3
  116. test_acc_limmed 0xffff,0xffff,acc3
  117. set_fr_iimmed 0xffff,0x0000,fr8
  118. set_fr_iimmed 0xffff,0xffff,fr10
  119. set_fr_iimmed 0x0000,0xffff,fr9
  120. set_fr_iimmed 0xffff,0xffff,fr11
  121. mqmachu fr8,fr10,acc0
  122. test_spr_bits 0x3c,2,0x9,msr0 ; msr0.sie is set
  123. test_spr_bits 2,1,1,msr0 ; msr0.ovf is set
  124. test_spr_bits 1,0,1,msr0 ; msr0.aovf is set
  125. test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set
  126. test_accg_immed 0xff,accg0
  127. test_acc_limmed 0xffff,0xffff,acc0
  128. test_accg_immed 0xff,accg1
  129. test_acc_limmed 0xffff,0xffff,acc1
  130. test_accg_immed 0xff,accg2
  131. test_acc_limmed 0xffff,0xffff,acc2
  132. test_accg_immed 0xff,accg3
  133. test_acc_limmed 0xffff,0xffff,acc3
  134. pass