fpu64a32-unordered.S 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Tests some basic unordered fpu compare instructions.
  2. Copyright (C) 2019-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(0x400921f9);\n
  15. # output: report(0xf01b866e);\n
  16. # output: report(0x4005bf09);\n
  17. # output: report(0x95aaf790);\n
  18. # output: report(0x7ff80000);\n
  19. # output: report(0x00000000);\n
  20. # output: \n
  21. # output: report(0x00000001);\n
  22. # output: \n
  23. # output: report(0x00000000);\n
  24. # output: \n
  25. # output: report(0x00000001);\n
  26. # output: \n
  27. # output: exit(0)\n
  28. #include "or1k-asm-test-helpers.h"
  29. STANDARD_TEST_ENVIRONMENT
  30. .section .data
  31. .align 4
  32. .type pi, @object
  33. .size pi, 8
  34. anchor:
  35. pi:
  36. .double 3.14159
  37. .type e, @object
  38. .size e, 8
  39. e:
  40. .double 2.71828
  41. .section .text
  42. start_tests:
  43. PUSH LINK_REGISTER_R9
  44. /* Test unordered double comparisons. Setting up:
  45. * r11 pointer to data
  46. * r12,r13 pi as double
  47. * r14,r15 e as double
  48. * r16,r17 nan as double
  49. */
  50. l.ori r11, r0, ha(anchor)
  51. l.addi r11, r11, lo(anchor)
  52. l.lwz r12, 0(r11)
  53. l.lwz r13, 4(r11)
  54. l.lwz r14, 8(r11)
  55. l.lwz r15, 12(r11)
  56. /* Make a NaN. */
  57. lf.sub.d r16,r18, r12,r13, r12,r13
  58. lf.div.d r16,r18, r16,r18, r16,r18
  59. /* Output to ensure we loaded it correctly. */
  60. REPORT_REG_TO_CONSOLE r12
  61. REPORT_REG_TO_CONSOLE r13
  62. REPORT_REG_TO_CONSOLE r14
  63. REPORT_REG_TO_CONSOLE r15
  64. REPORT_REG_TO_CONSOLE r16
  65. REPORT_REG_TO_CONSOLE r18
  66. PRINT_NEWLINE_TO_CONSOLE
  67. lf.sfuge.d r12,r13, r14,r15
  68. MOVE_FROM_SPR r2, SPR_SR
  69. REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
  70. PRINT_NEWLINE_TO_CONSOLE
  71. lf.sfun.d r12,r13, r14,r15
  72. MOVE_FROM_SPR r2, SPR_SR
  73. REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
  74. PRINT_NEWLINE_TO_CONSOLE
  75. lf.sfun.d r12,r13, r16,r18
  76. MOVE_FROM_SPR r2, SPR_SR
  77. REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
  78. PRINT_NEWLINE_TO_CONSOLE
  79. POP LINK_REGISTER_R9
  80. RETURN_TO_LINK_REGISTER_R9