Remove unused declaration and macros
[binutils-gdb.git] / sim / testsuite / or1k / fpu64a32-unordered.S
blobdee9e87f25c395a52ca568d0cf637b971d7375dd
1 /* Tests some basic unordered fpu compare instructions.
3    Copyright (C) 2019-2024 Free Software Foundation, Inc.
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18 # mach: or1k
19 # output: report(0x400921f9);\n
20 # output: report(0xf01b866e);\n
21 # output: report(0x4005bf09);\n
22 # output: report(0x95aaf790);\n
23 # output: report(0x7ff80000);\n
24 # output: report(0x00000000);\n
25 # output: \n
26 # output: report(0x00000001);\n
27 # output: \n
28 # output: report(0x00000000);\n
29 # output: \n
30 # output: report(0x00000001);\n
31 # output: \n
32 # output: exit(0)\n
34 #include "or1k-asm-test-helpers.h"
36         STANDARD_TEST_ENVIRONMENT
38         .section .data
39         .align 4
40         .type   pi, @object
41         .size   pi, 8
42 anchor:
43 pi:
44         .double  3.14159
46         .type   e, @object
47         .size   e, 8
49         .double  2.71828
51         .section .text
52 start_tests:
53         PUSH LINK_REGISTER_R9
55         /* Test unordered double comparisons.  Setting up:
56          *  r11      pointer to data
57          *  r12,r13  pi  as double
58          *  r14,r15  e   as double
59          *  r16,r17  nan as double
60          */
61         l.movhi r11, ha(anchor)
62         l.addi  r11, r11, lo(anchor)
63         l.lwz   r12, 0(r11)
64         l.lwz   r13, 4(r11)
66         l.lwz   r14, 8(r11)
67         l.lwz   r15, 12(r11)
69         /* Make a NaN.  */
70         lf.sub.d r16,r18, r12,r13, r12,r13
71         lf.div.d r16,r18, r16,r18, r16,r18
73         /* Output to ensure we loaded it correctly.  */
74         REPORT_REG_TO_CONSOLE r12
75         REPORT_REG_TO_CONSOLE r13
77         REPORT_REG_TO_CONSOLE r14
78         REPORT_REG_TO_CONSOLE r15
80         REPORT_REG_TO_CONSOLE r16
81         REPORT_REG_TO_CONSOLE r18
82         PRINT_NEWLINE_TO_CONSOLE
84         lf.sfuge.d r12,r13, r14,r15
85         MOVE_FROM_SPR r2, SPR_SR
86         REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
87         PRINT_NEWLINE_TO_CONSOLE
89         lf.sfun.d r12,r13, r14,r15
90         MOVE_FROM_SPR r2, SPR_SR
91         REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
92         PRINT_NEWLINE_TO_CONSOLE
94         lf.sfun.d r12,r13, r16,r18
95         MOVE_FROM_SPR r2, SPR_SR
96         REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
97         PRINT_NEWLINE_TO_CONSOLE
99         POP LINK_REGISTER_R9
100         RETURN_TO_LINK_REGISTER_R9