OLD | NEW |
1 /* rx.c --- opcode semantics for stand-alone RX simulator. | 1 /* rx.c --- opcode semantics for stand-alone RX simulator. |
2 | 2 |
3 Copyright (C) 2008-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2008-2013 Free Software Foundation, Inc. |
4 Contributed by Red Hat, Inc. | 4 Contributed by Red Hat, Inc. |
5 | 5 |
6 This file is part of the GNU simulators. | 6 This file is part of the GNU simulators. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
11 (at your option) any later version. | 11 (at your option) any later version. |
12 | 12 |
13 This program is distributed in the hope that it will be useful, | 13 This program is distributed in the hope that it will be useful, |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 { \ | 725 { \ |
726 int i, c=0; \ | 726 int i, c=0; \ |
727 count = US2(); \ | 727 count = US2(); \ |
728 val = (type)US1(); \ | 728 val = (type)US1(); \ |
729 tprintf("%lld " #OP " %d\n", val, count); \ | 729 tprintf("%lld " #OP " %d\n", val, count); \ |
730 for (i = 0; i < count; i ++) \ | 730 for (i = 0; i < count; i ++) \ |
731 { \ | 731 { \ |
732 c = val & carry_mask; \ | 732 c = val & carry_mask; \ |
733 val OP 1; \ | 733 val OP 1; \ |
734 } \ | 734 } \ |
735 if (count) \ | 735 set_oszc (val, 4, c); \ |
736 set_oszc (val, 4, c); \ | |
737 PD (val); \ | 736 PD (val); \ |
738 } | 737 } |
739 | 738 |
740 typedef union { | 739 typedef union { |
741 int i; | 740 int i; |
742 float f; | 741 float f; |
743 } FloatInt; | 742 } FloatInt; |
744 | 743 |
745 static inline int | 744 static inline int |
746 float2int (float f) | 745 float2int (float f) |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 break; | 1794 break; |
1796 | 1795 |
1797 case RXO_sat: | 1796 case RXO_sat: |
1798 if (FLAG_O && FLAG_S) | 1797 if (FLAG_O && FLAG_S) |
1799 PD (0x7fffffffUL); | 1798 PD (0x7fffffffUL); |
1800 else if (FLAG_O && ! FLAG_S) | 1799 else if (FLAG_O && ! FLAG_S) |
1801 PD (0x80000000UL); | 1800 PD (0x80000000UL); |
1802 E1; | 1801 E1; |
1803 break; | 1802 break; |
1804 | 1803 |
| 1804 case RXO_satr: |
| 1805 if (FLAG_O && ! FLAG_S) |
| 1806 { |
| 1807 put_reg (6, 0x0); |
| 1808 put_reg (5, 0x7fffffff); |
| 1809 put_reg (4, 0xffffffff); |
| 1810 } |
| 1811 else if (FLAG_O && FLAG_S) |
| 1812 { |
| 1813 put_reg (6, 0xffffffff); |
| 1814 put_reg (5, 0x80000000); |
| 1815 put_reg (4, 0x0); |
| 1816 } |
| 1817 E1; |
| 1818 break; |
| 1819 |
1805 case RXO_sbb: | 1820 case RXO_sbb: |
1806 MATH_OP (-, ! carry); | 1821 MATH_OP (-, ! carry); |
1807 break; | 1822 break; |
1808 | 1823 |
1809 case RXO_sccnd: | 1824 case RXO_sccnd: |
1810 if (GS()) | 1825 if (GS()) |
1811 PD (1); | 1826 PD (1); |
1812 else | 1827 else |
1813 PD (0); | 1828 PD (0); |
1814 E1; | 1829 E1; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 } | 2256 } |
2242 | 2257 |
2243 printf("\n"); | 2258 printf("\n"); |
2244 printf("%13s memory stalls\n", comma (memory_stalls)); | 2259 printf("%13s memory stalls\n", comma (memory_stalls)); |
2245 printf("%13s register stalls\n", comma (register_stalls)); | 2260 printf("%13s register stalls\n", comma (register_stalls)); |
2246 printf("%13s branches taken (non-return)\n", comma (branch_stalls)); | 2261 printf("%13s branches taken (non-return)\n", comma (branch_stalls)); |
2247 printf("%13s branch alignment stalls\n", comma (branch_alignment_stalls)); | 2262 printf("%13s branch alignment stalls\n", comma (branch_alignment_stalls)); |
2248 printf("%13s fast returns\n", comma (fast_returns)); | 2263 printf("%13s fast returns\n", comma (fast_returns)); |
2249 #endif | 2264 #endif |
2250 } | 2265 } |
OLD | NEW |