find.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Tests the find instructions.
  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(0x00000001);\n
  15. # output: report(0x00000001);\n
  16. # output: \n
  17. # output: report(0x80000000);\n
  18. # output: report(0x00000020);\n
  19. # output: \n
  20. # output: report(0x55555555);\n
  21. # output: report(0x00000001);\n
  22. # output: \n
  23. # output: report(0xaaaaaaaa);\n
  24. # output: report(0x00000002);\n
  25. # output: \n
  26. # output: report(0x00018000);\n
  27. # output: report(0x00000010);\n
  28. # output: \n
  29. # output: report(0xc0000000);\n
  30. # output: report(0x0000001f);\n
  31. # output: \n
  32. # output: report(0x00000000);\n
  33. # output: report(0x00000000);\n
  34. # output: \n
  35. # output: report(0x00000001);\n
  36. # output: report(0x00000001);\n
  37. # output: \n
  38. # output: report(0x80000000);\n
  39. # output: report(0x00000020);\n
  40. # output: \n
  41. # output: report(0x55555555);\n
  42. # output: report(0x0000001f);\n
  43. # output: \n
  44. # output: report(0xaaaaaaaa);\n
  45. # output: report(0x00000020);\n
  46. # output: \n
  47. # output: report(0x00018000);\n
  48. # output: report(0x00000011);\n
  49. # output: \n
  50. # output: report(0xc0000000);\n
  51. # output: report(0x00000020);\n
  52. # output: \n
  53. # output: report(0x00000000);\n
  54. # output: report(0x00000000);\n
  55. # output: \n
  56. # output: exit(0)\n
  57. #include "or1k-asm-test-helpers.h"
  58. .macro TEST_FIND opcode, operand
  59. LOAD_IMMEDIATE r5, \operand
  60. REPORT_REG_TO_CONSOLE r5
  61. \opcode r4, r5
  62. REPORT_REG_TO_CONSOLE r4
  63. PRINT_NEWLINE_TO_CONSOLE
  64. .endm
  65. STANDARD_TEST_ENVIRONMENT
  66. .section .text
  67. start_tests:
  68. PUSH LINK_REGISTER_R9
  69. /* Test l.ff1 */
  70. TEST_FIND l.ff1, 0x00000001
  71. TEST_FIND l.ff1, 0x80000000
  72. TEST_FIND l.ff1, 0x55555555
  73. TEST_FIND l.ff1, 0xaaaaaaaa
  74. TEST_FIND l.ff1, 0x00018000
  75. TEST_FIND l.ff1, 0xc0000000
  76. TEST_FIND l.ff1, 0x00000000
  77. /* Test l.fl1 */
  78. TEST_FIND l.fl1, 0x00000001
  79. TEST_FIND l.fl1, 0x80000000
  80. TEST_FIND l.fl1, 0x55555555
  81. TEST_FIND l.fl1, 0xaaaaaaaa
  82. TEST_FIND l.fl1, 0x00018000
  83. TEST_FIND l.fl1, 0xc0000000
  84. TEST_FIND l.fl1, 0x00000000
  85. POP LINK_REGISTER_R9
  86. RETURN_TO_LINK_REGISTER_R9