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