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