mqmulhu.cgs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # frv testcase for mqmulhu $GRi,$GRj,$GRk
  2. # mach: all
  3. .include "testutils.inc"
  4. start
  5. .global mqmulhu
  6. mqmulhu:
  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. mqmulhu fr8,fr10,acc0
  12. test_accg_immed 0,accg0
  13. test_acc_immed 6,acc0
  14. test_accg_immed 0,accg1
  15. test_acc_immed 6,acc1
  16. test_accg_immed 0,accg2
  17. test_acc_immed 2,acc2
  18. test_accg_immed 0,accg3
  19. test_acc_immed 2,acc3
  20. set_fr_iimmed 0,2,fr8 ; multiply by 0
  21. set_fr_iimmed 2,0,fr10
  22. set_fr_iimmed 0x3fff,2,fr9 ; 15 bit result
  23. set_fr_iimmed 2,0x3fff,fr11
  24. mqmulhu fr8,fr10,acc0
  25. test_accg_immed 0,accg0
  26. test_acc_immed 0,acc0
  27. test_accg_immed 0,accg1
  28. test_acc_immed 0,acc1
  29. test_accg_immed 0,accg2
  30. test_acc_limmed 0x0000,0x7ffe,acc2
  31. test_accg_immed 0,accg3
  32. test_acc_limmed 0x0000,0x7ffe,acc3
  33. set_fr_iimmed 0x4000,2,fr8 ; 16 bit result
  34. set_fr_iimmed 2,0x4000,fr10
  35. set_fr_iimmed 0x8000,2,fr9 ; 17 bit result
  36. set_fr_iimmed 2,0x8000,fr11
  37. mqmulhu fr8,fr10,acc0
  38. test_accg_immed 0,accg0
  39. test_acc_limmed 0x0000,0x8000,acc0
  40. test_accg_immed 0,accg1
  41. test_acc_limmed 0x0000,0x8000,acc1
  42. test_accg_immed 0,accg2
  43. test_acc_immed 0x00010000,acc2
  44. test_accg_immed 0,accg3
  45. test_acc_immed 0x00010000,acc3
  46. set_fr_iimmed 0x7fff,0x7fff,fr8 ; max positive result
  47. set_fr_iimmed 0x7fff,0x7fff,fr10
  48. set_fr_iimmed 0x8000,0x8000,fr9 ; max positive result
  49. set_fr_iimmed 0x8000,0x8000,fr11
  50. mqmulhu fr8,fr10,acc0
  51. test_accg_immed 0,accg0
  52. test_acc_immed 0x3fff0001,acc0
  53. test_accg_immed 0,accg1
  54. test_acc_immed 0x3fff0001,acc1
  55. test_accg_immed 0,accg2
  56. test_acc_limmed 0x4000,0x0000,acc2
  57. test_accg_immed 0,accg3
  58. test_acc_limmed 0x4000,0x0000,acc3
  59. set_fr_iimmed 0xffff,0xffff,fr8 ; max positive result
  60. set_fr_iimmed 0xffff,0xffff,fr10
  61. set_fr_iimmed 0xffff,0xffff,fr9 ; max positive result
  62. set_fr_iimmed 0xffff,0xffff,fr11
  63. mqmulhu fr8,fr10,acc0
  64. test_accg_immed 0,accg0
  65. test_acc_limmed 0xfffe,0x0001,acc0
  66. test_accg_immed 0,accg1
  67. test_acc_limmed 0xfffe,0x0001,acc1
  68. test_accg_immed 0,accg2
  69. test_acc_limmed 0xfffe,0x0001,acc2
  70. test_accg_immed 0,accg3
  71. test_acc_limmed 0xfffe,0x0001,acc3
  72. pass