mmachu.cgs 4.7 KB

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