wsub.cgs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. # Intel(r) Wireless MMX(tm) technology testcase for WSUB
  2. # mach: xscale
  3. # as: -mcpu=xscale+iwmmxt
  4. .include "testutils.inc"
  5. start
  6. .global wsub
  7. wsub:
  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 Unsaturated Byte subtraction
  13. mvi_h_gr r0, 0x12345678
  14. mvi_h_gr r1, 0x9abcde00
  15. mvi_h_gr r2, 0x11111111
  16. mvi_h_gr r3, 0x11111111
  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. wsubb 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, 0x9abcde00
  28. test_h_gr r2, 0x11111111
  29. test_h_gr r3, 0x11111111
  30. test_h_gr r4, 0x01234567
  31. test_h_gr r5, 0x89abcdef
  32. # Test Unsigned saturated Byte subtraction
  33. mvi_h_gr r0, 0x12345678
  34. mvi_h_gr r1, 0x9abcde00
  35. mvi_h_gr r2, 0x11111111
  36. mvi_h_gr r3, 0x11111111
  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. wsubbus 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, 0x9abcde00
  48. test_h_gr r2, 0x11111111
  49. test_h_gr r3, 0x11111111
  50. test_h_gr r4, 0x01234567
  51. test_h_gr r5, 0x89abcd00
  52. # Test Signed saturated Byte subtraction
  53. mvi_h_gr r0, 0x12345678
  54. mvi_h_gr r1, 0x9abcde00
  55. mvi_h_gr r2, 0x11111111
  56. mvi_h_gr r3, 0x11111111
  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. wsubbss 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, 0x9abcde00
  68. test_h_gr r2, 0x11111111
  69. test_h_gr r3, 0x11111111
  70. test_h_gr r4, 0x01234567
  71. test_h_gr r5, 0x89abcdef
  72. # Test Unsaturated Halfword subtraction
  73. mvi_h_gr r0, 0x12345678
  74. mvi_h_gr r1, 0x9abcde00
  75. mvi_h_gr r2, 0x11111111
  76. mvi_h_gr r3, 0x11111111
  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. wsubh 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, 0x9abcde00
  88. test_h_gr r2, 0x11111111
  89. test_h_gr r3, 0x11111111
  90. test_h_gr r4, 0x01234567
  91. test_h_gr r5, 0x89abccef
  92. # Test Unsigned saturated Halfword subtraction
  93. mvi_h_gr r0, 0x12345678
  94. mvi_h_gr r1, 0x9abcde00
  95. mvi_h_gr r2, 0x11111111
  96. mvi_h_gr r3, 0x11111111
  97. mvi_h_gr r4, 0
  98. mvi_h_gr r5, 0
  99. tmcrr wr0, r0, r1
  100. tmcrr wr1, r2, r3
  101. tmcrr wr2, r4, r5
  102. wsubhus wr2, wr0, wr1
  103. tmrrc r0, r1, wr0
  104. tmrrc r2, r3, wr1
  105. tmrrc r4, r5, wr2
  106. test_h_gr r0, 0x12345678
  107. test_h_gr r1, 0x9abcde00
  108. test_h_gr r2, 0x11111111
  109. test_h_gr r3, 0x11111111
  110. test_h_gr r4, 0x01234567
  111. test_h_gr r5, 0x89abccef
  112. # Test Signed saturated Halfword subtraction
  113. mvi_h_gr r0, 0x12345678
  114. mvi_h_gr r1, 0x9abcde00
  115. mvi_h_gr r2, 0x11111111
  116. mvi_h_gr r3, 0x11111111
  117. mvi_h_gr r4, 0
  118. mvi_h_gr r5, 0
  119. tmcrr wr0, r0, r1
  120. tmcrr wr1, r2, r3
  121. tmcrr wr2, r4, r5
  122. wsubhss wr2, wr0, wr1
  123. tmrrc r0, r1, wr0
  124. tmrrc r2, r3, wr1
  125. tmrrc r4, r5, wr2
  126. test_h_gr r0, 0x12345678
  127. test_h_gr r1, 0x9abcde00
  128. test_h_gr r2, 0x11111111
  129. test_h_gr r3, 0x11111111
  130. test_h_gr r4, 0x01234567
  131. test_h_gr r5, 0x89abccef
  132. # Test Unsaturated Word subtraction
  133. mvi_h_gr r0, 0x12345678
  134. mvi_h_gr r1, 0x9abcde00
  135. mvi_h_gr r2, 0x11111111
  136. mvi_h_gr r3, 0x11111111
  137. mvi_h_gr r4, 0
  138. mvi_h_gr r5, 0
  139. tmcrr wr0, r0, r1
  140. tmcrr wr1, r2, r3
  141. tmcrr wr2, r4, r5
  142. wsubw wr2, wr0, wr1
  143. tmrrc r0, r1, wr0
  144. tmrrc r2, r3, wr1
  145. tmrrc r4, r5, wr2
  146. test_h_gr r0, 0x12345678
  147. test_h_gr r1, 0x9abcde00
  148. test_h_gr r2, 0x11111111
  149. test_h_gr r3, 0x11111111
  150. test_h_gr r4, 0x01234567
  151. test_h_gr r5, 0x89abccef
  152. # Test Unsigned saturated Word subtraction
  153. mvi_h_gr r0, 0x12345678
  154. mvi_h_gr r1, 0x9abcde00
  155. mvi_h_gr r2, 0x11111111
  156. mvi_h_gr r3, 0x11111111
  157. mvi_h_gr r4, 0
  158. mvi_h_gr r5, 0
  159. tmcrr wr0, r0, r1
  160. tmcrr wr1, r2, r3
  161. tmcrr wr2, r4, r5
  162. wsubwus wr2, wr0, wr1
  163. tmrrc r0, r1, wr0
  164. tmrrc r2, r3, wr1
  165. tmrrc r4, r5, wr2
  166. test_h_gr r0, 0x12345678
  167. test_h_gr r1, 0x9abcde00
  168. test_h_gr r2, 0x11111111
  169. test_h_gr r3, 0x11111111
  170. test_h_gr r4, 0x01234567
  171. test_h_gr r5, 0x89abccef
  172. # Test Signed saturated Word subtraction
  173. mvi_h_gr r0, 0x12345678
  174. mvi_h_gr r1, 0x9abcde00
  175. mvi_h_gr r2, 0x11111111
  176. mvi_h_gr r3, 0x11111111
  177. mvi_h_gr r4, 0
  178. mvi_h_gr r5, 0
  179. tmcrr wr0, r0, r1
  180. tmcrr wr1, r2, r3
  181. tmcrr wr2, r4, r5
  182. wsubwss wr2, wr0, wr1
  183. tmrrc r0, r1, wr0
  184. tmrrc r2, r3, wr1
  185. tmrrc r4, r5, wr2
  186. test_h_gr r0, 0x12345678
  187. test_h_gr r1, 0x9abcde00
  188. test_h_gr r2, 0x11111111
  189. test_h_gr r3, 0x11111111
  190. test_h_gr r4, 0x01234567
  191. test_h_gr r5, 0x89abccef
  192. pass