wsad.cgs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Intel(r) Wireless MMX(tm) technology testcase for WSAD
  2. # mach: xscale
  3. # as: -mcpu=xscale+iwmmxt
  4. .include "testutils.inc"
  5. start
  6. .global wsad
  7. wsad:
  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 Byte wide absolute accumulation
  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, 0x22222222
  18. mvi_h_gr r5, 0x22222222
  19. tmcrr wr0, r0, r1
  20. tmcrr wr1, r2, r3
  21. tmcrr wr2, r4, r5
  22. wsadb 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, 0x2222258e
  31. test_h_gr r5, 0x00000000
  32. # Test Byte wide absolute accumulation with zeroing
  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, 0x22222222
  38. mvi_h_gr r5, 0x22222222
  39. tmcrr wr0, r0, r1
  40. tmcrr wr1, r2, r3
  41. tmcrr wr2, r4, r5
  42. wsadbz 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, 0x0000036c
  51. test_h_gr r5, 0x00000000
  52. # Test Halfword wide absolute accumulation
  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, 0x22222222
  58. mvi_h_gr r5, 0x22222222
  59. tmcrr wr0, r0, r1
  60. tmcrr wr1, r2, r3
  61. tmcrr wr2, r4, r5
  62. wsadh 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, 0x22239e14
  71. test_h_gr r5, 0x00000000
  72. # Test Halfword wide absolute accumulation with zeroing
  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, 0x22222222
  78. mvi_h_gr r5, 0x22222222
  79. tmcrr wr0, r0, r1
  80. tmcrr wr1, r2, r3
  81. tmcrr wr2, r4, r5
  82. wsadhz 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, 0x00017bf2
  91. test_h_gr r5, 0x00000000
  92. pass