wmul.cgs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Intel(r) Wireless MMX(tm) technology testcase for WMUL
  2. # mach: xscale
  3. # as: -mcpu=xscale+iwmmxt
  4. .include "testutils.inc"
  5. start
  6. .global wmul
  7. wmul:
  8. # Enable access to CoProcessors 0 & 1 before
  9. # we attempt these instructions.
  10. mvi_h_gr r1, 3
  11. mcr p15, 0, r1, cr15, cr1, 0
  12. # Test Unsigned, Most Significant Multiply
  13. mvi_h_gr r0, 0x12345678
  14. mvi_h_gr r1, 0x9abcdef0
  15. mvi_h_gr r2, 0x11111111
  16. mvi_h_gr r3, 0x22222222
  17. mvi_h_gr r4, 0
  18. mvi_h_gr r5, 0
  19. tmcrr wr0, r0, r1
  20. tmcrr wr1, r2, r3
  21. tmcrr wr2, r4, r5
  22. wmulum wr2, wr0, wr1
  23. tmrrc r0, r1, wr0
  24. tmrrc r2, r3, wr1
  25. tmrrc r4, r5, wr2
  26. test_h_gr r0, 0x12345678
  27. test_h_gr r1, 0x9abcdef0
  28. test_h_gr r2, 0x11111111
  29. test_h_gr r3, 0x22222222
  30. test_h_gr r4, 0x013605c3
  31. test_h_gr r5, 0x14a11db9
  32. # Test Unsigned, Least Significant Multiply
  33. mvi_h_gr r0, 0x12345678
  34. mvi_h_gr r1, 0x9abcdef0
  35. mvi_h_gr r2, 0x11111111
  36. mvi_h_gr r3, 0x22222222
  37. mvi_h_gr r4, 0
  38. mvi_h_gr r5, 0
  39. tmcrr wr0, r0, r1
  40. tmcrr wr1, r2, r3
  41. tmcrr wr2, r4, r5
  42. wmulul wr2, wr0, wr1
  43. tmrrc r0, r1, wr0
  44. tmrrc r2, r3, wr1
  45. tmrrc r4, r5, wr2
  46. test_h_gr r0, 0x12345678
  47. test_h_gr r1, 0x9abcdef0
  48. test_h_gr r2, 0x11111111
  49. test_h_gr r3, 0x22222222
  50. test_h_gr r4, 0xa974b5f8
  51. test_h_gr r5, 0x84f87be0
  52. # Test Signed, Most Significant Multiply
  53. mvi_h_gr r0, 0x12345678
  54. mvi_h_gr r1, 0x9abcdef0
  55. mvi_h_gr r2, 0x11111111
  56. mvi_h_gr r3, 0x22222222
  57. mvi_h_gr r4, 0
  58. mvi_h_gr r5, 0
  59. tmcrr wr0, r0, r1
  60. tmcrr wr1, r2, r3
  61. tmcrr wr2, r4, r5
  62. wmulsm wr2, wr0, wr1
  63. tmrrc r0, r1, wr0
  64. tmrrc r2, r3, wr1
  65. tmrrc r4, r5, wr2
  66. test_h_gr r0, 0x12345678
  67. test_h_gr r1, 0x9abcdef0
  68. test_h_gr r2, 0x11111111
  69. test_h_gr r3, 0x22222222
  70. test_h_gr r4, 0x013605c3
  71. test_h_gr r5, 0xf27ffb97
  72. # Test Signed, Least Significant Multiply
  73. mvi_h_gr r0, 0x12345678
  74. mvi_h_gr r1, 0x9abcdef0
  75. mvi_h_gr r2, 0x11111111
  76. mvi_h_gr r3, 0x22222222
  77. mvi_h_gr r4, 0
  78. mvi_h_gr r5, 0
  79. tmcrr wr0, r0, r1
  80. tmcrr wr1, r2, r3
  81. tmcrr wr2, r4, r5
  82. wmulsl wr2, wr0, wr1
  83. tmrrc r0, r1, wr0
  84. tmrrc r2, r3, wr1
  85. tmrrc r4, r5, wr2
  86. test_h_gr r0, 0x12345678
  87. test_h_gr r1, 0x9abcdef0
  88. test_h_gr r2, 0x11111111
  89. test_h_gr r3, 0x22222222
  90. test_h_gr r4, 0xa974b5f8
  91. test_h_gr r5, 0x84f87be0
  92. pass