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/>. */
19 # output: report(0x40490fd0);\n
20 # output: report(0x402df84d);\n
21 # output: report(0x7fc00000);\n
23 # output: report(0x00000001);\n
25 # output: report(0x00000000);\n
27 # output: report(0x00000001);\n
29 # output: report(0x00000001);\n
33 #include "or1k-asm-test-helpers.h"
35 STANDARD_TEST_ENVIRONMENT
54 /* Test unordered float comparisons. Setting up:
60 l.movhi r11, ha(anchor)
61 l.addi r11, r11, lo(anchor)
67 lf.sub.s r16, r13, r13
68 lf.div.s r16, r16, r16
70 /* Output to ensure we loaded it correctly. */
71 REPORT_REG_TO_CONSOLE r12
72 REPORT_REG_TO_CONSOLE r13
73 REPORT_REG_TO_CONSOLE r16
74 PRINT_NEWLINE_TO_CONSOLE
77 MOVE_FROM_SPR r2, SPR_SR
78 REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
79 PRINT_NEWLINE_TO_CONSOLE
82 MOVE_FROM_SPR r2, SPR_SR
83 REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
84 PRINT_NEWLINE_TO_CONSOLE
87 MOVE_FROM_SPR r2, SPR_SR
88 REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
89 PRINT_NEWLINE_TO_CONSOLE
92 MOVE_FROM_SPR r2, SPR_SR
93 REPORT_BIT_TO_CONSOLE r2, SPR_SR_F
94 PRINT_NEWLINE_TO_CONSOLE
97 RETURN_TO_LINK_REGISTER_R9