xor.S 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /* Tests instructions l.xor, l.xori.
  2. Copyright (C) 2017-2022 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. # mach: or1k
  14. # output: report(0x00000000);\n
  15. # output: report(0x00000000);\n
  16. # output: report(0x00000000);\n
  17. # output: report(0x00000000);\n
  18. # output: report(0x00000000);\n
  19. # output: report(0x00000000);\n
  20. # output: \n
  21. # output: report(0xffffffff);\n
  22. # output: report(0xffffffff);\n
  23. # output: report(0x00000000);\n
  24. # output: report(0x00000000);\n
  25. # output: report(0x00000000);\n
  26. # output: report(0x00000000);\n
  27. # output: \n
  28. # output: report(0xaaaaaaaa);\n
  29. # output: report(0x00000000);\n
  30. # output: report(0xaaaaaaaa);\n
  31. # output: report(0x00000000);\n
  32. # output: report(0x00000000);\n
  33. # output: report(0x00000000);\n
  34. # output: \n
  35. # output: report(0xaaaaaaaa);\n
  36. # output: report(0xaaaaaaaa);\n
  37. # output: report(0x00000000);\n
  38. # output: report(0x00000000);\n
  39. # output: report(0x00000000);\n
  40. # output: report(0x00000000);\n
  41. # output: \n
  42. # output: report(0x55555555);\n
  43. # output: report(0x00000000);\n
  44. # output: report(0x55555555);\n
  45. # output: report(0x00000000);\n
  46. # output: report(0x00000000);\n
  47. # output: report(0x00000000);\n
  48. # output: \n
  49. # output: report(0x55555555);\n
  50. # output: report(0x55555555);\n
  51. # output: report(0x00000000);\n
  52. # output: report(0x00000000);\n
  53. # output: report(0x00000000);\n
  54. # output: report(0x00000000);\n
  55. # output: \n
  56. # output: report(0xaaaaaaaa);\n
  57. # output: report(0x55555555);\n
  58. # output: report(0xffffffff);\n
  59. # output: report(0x00000000);\n
  60. # output: report(0x00000000);\n
  61. # output: report(0x00000000);\n
  62. # output: \n
  63. # output: report(0x4c70f07c);\n
  64. # output: report(0xb38f0f83);\n
  65. # output: report(0xffffffff);\n
  66. # output: report(0x00000000);\n
  67. # output: report(0x00000000);\n
  68. # output: report(0x00000000);\n
  69. # output: \n
  70. # output: report(0x4c70f07c);\n
  71. # output: report(0xc4c70f07);\n
  72. # output: report(0x88b7ff7b);\n
  73. # output: report(0x00000000);\n
  74. # output: report(0x00000000);\n
  75. # output: report(0x00000000);\n
  76. # output: \n
  77. # output: report(0xb38f0f83);\n
  78. # output: report(0x38f0f83b);\n
  79. # output: report(0x8b7ff7b8);\n
  80. # output: report(0x00000000);\n
  81. # output: report(0x00000000);\n
  82. # output: report(0x00000000);\n
  83. # output: \n
  84. # output: report(0x00000000);\n
  85. # output: report(0x00000000);\n
  86. # output: report(0x00000000);\n
  87. # output: report(0x00000000);\n
  88. # output: report(0x00000000);\n
  89. # output: report(0x00000000);\n
  90. # output: \n
  91. # output: report(0xffffffff);\n
  92. # output: report(0x0000ffff);\n
  93. # output: report(0x00000000);\n
  94. # output: report(0x00000000);\n
  95. # output: report(0x00000000);\n
  96. # output: report(0x00000000);\n
  97. # output: \n
  98. # output: report(0xaaaaaaaa);\n
  99. # output: report(0x00000000);\n
  100. # output: report(0xaaaaaaaa);\n
  101. # output: report(0x00000000);\n
  102. # output: report(0x00000000);\n
  103. # output: report(0x00000000);\n
  104. # output: \n
  105. # output: report(0xaaaaaaaa);\n
  106. # output: report(0x0000aaaa);\n
  107. # output: report(0x55550000);\n
  108. # output: report(0x00000000);\n
  109. # output: report(0x00000000);\n
  110. # output: report(0x00000000);\n
  111. # output: \n
  112. # output: report(0x55555555);\n
  113. # output: report(0x00000000);\n
  114. # output: report(0x55555555);\n
  115. # output: report(0x00000000);\n
  116. # output: report(0x00000000);\n
  117. # output: report(0x00000000);\n
  118. # output: \n
  119. # output: report(0x55555555);\n
  120. # output: report(0x00005555);\n
  121. # output: report(0x55550000);\n
  122. # output: report(0x00000000);\n
  123. # output: report(0x00000000);\n
  124. # output: report(0x00000000);\n
  125. # output: \n
  126. # output: report(0xaaaaaaaa);\n
  127. # output: report(0x00005555);\n
  128. # output: report(0xaaaaffff);\n
  129. # output: report(0x00000000);\n
  130. # output: report(0x00000000);\n
  131. # output: report(0x00000000);\n
  132. # output: \n
  133. # output: report(0x4c70f07c);\n
  134. # output: report(0x00000f83);\n
  135. # output: report(0x4c70ffff);\n
  136. # output: report(0x00000000);\n
  137. # output: report(0x00000000);\n
  138. # output: report(0x00000000);\n
  139. # output: \n
  140. # output: report(0x4c70f07c);\n
  141. # output: report(0x00000f07);\n
  142. # output: report(0x4c70ff7b);\n
  143. # output: report(0x00000000);\n
  144. # output: report(0x00000000);\n
  145. # output: report(0x00000000);\n
  146. # output: \n
  147. # output: report(0xb38f0f83);\n
  148. # output: report(0x0000f83b);\n
  149. # output: report(0x4c70f7b8);\n
  150. # output: report(0x00000000);\n
  151. # output: report(0x00000000);\n
  152. # output: report(0x00000000);\n
  153. # output: \n
  154. # output: exit(0)\n
  155. #include "or1k-asm-test-helpers.h"
  156. STANDARD_TEST_ENVIRONMENT
  157. .section .text
  158. start_tests:
  159. PUSH LINK_REGISTER_R9
  160. /* Always set OVE. We should never trigger an exception, even if
  161. this bit is set. */
  162. SET_SPR_SR_FLAGS SPR_SR_OVE, r2, r3
  163. /* Test the l.xor instruction with a range of operands. */
  164. TEST_INST_I32_I32 l.xor, 0x00000000, 0x00000000
  165. TEST_INST_I32_I32 l.xor, 0xffffffff, 0xffffffff
  166. TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0x00000000
  167. TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0xaaaaaaaa
  168. TEST_INST_I32_I32 l.xor, 0x55555555, 0x00000000
  169. TEST_INST_I32_I32 l.xor, 0x55555555, 0x55555555
  170. TEST_INST_I32_I32 l.xor, 0xaaaaaaaa, 0x55555555
  171. TEST_INST_I32_I32 l.xor, 0x4c70f07c, 0xb38f0f83
  172. TEST_INST_I32_I32 l.xor, 0x4c70f07c, 0xc4c70f07
  173. TEST_INST_I32_I32 l.xor, 0xb38f0f83, 0x38f0f83b
  174. /* Test the l.xori instruction with a range of operands. */
  175. TEST_INST_I32_I16 l.xori, 0x00000000, 0x0000
  176. TEST_INST_I32_I16 l.xori, 0xffffffff, 0xffff
  177. TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0x0000
  178. TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0xaaaa
  179. TEST_INST_I32_I16 l.xori, 0x55555555, 0x0000
  180. TEST_INST_I32_I16 l.xori, 0x55555555, 0x5555
  181. TEST_INST_I32_I16 l.xori, 0xaaaaaaaa, 0x5555
  182. TEST_INST_I32_I16 l.xori, 0x4c70f07c, 0x0f83
  183. TEST_INST_I32_I16 l.xori, 0x4c70f07c, 0x0f07
  184. TEST_INST_I32_I16 l.xori, 0xb38f0f83, 0xf83b
  185. POP LINK_REGISTER_R9
  186. RETURN_TO_LINK_REGISTER_R9