annotate extra/gcc6809lw-4.6.4-2.patch @ 396:d0c0fede5021

Update to gcc6809lw patch which may help compilation of some sources Due to persistent random compiler crashes and errors related to "M_REGS", this patch update (4.6.4-2) essentially removes the varius constraints allowing the "soft registers" in most operations. It was causing more problems than it solved and it is not clear that the logic behind those soft registers even makes sense any more. This patch also fixes a bogus comparison related to selecting the right size for a constant. Instead of the excessively clever comparison scheme that was previously in use, the comparisons have been replaced with straight forward comparisions for the top and bottom of the relevant 2's complement ranges.
author William Astle <lost@l-w.ca>
date Mon, 20 Jul 2015 22:32:41 -0600
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
396
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1 diff -urN gcc-4.6.4-clean/config.sub gcc-4.6.4/config.sub
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2 --- gcc-4.6.4-clean/config.sub 2010-05-25 07:22:07.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3 +++ gcc-4.6.4/config.sub 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4 @@ -313,7 +313,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5 c6x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6 basic_machine=tic6x-unknown
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8 - m6811 | m68hc11 | m6812 | m68hc12 | picochip)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
9 + m6809 | m6811 | m68hc11 | m6812 | m68hc12 | picochip)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
10 # Motorola 68HC11/12.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
11 basic_machine=$basic_machine-unknown
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
12 os=-none
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
13 @@ -354,7 +354,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
14 | i*86-* | i860-* | i960-* | ia64-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
15 | ip2k-* | iq2000-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
16 | lm32-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
17 - | m32c-* | m32r-* | m32rle-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
18 + | m32c-* | m32r-* | m32rle-* | m6809-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
19 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
20 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
21 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
22 @@ -509,6 +509,10 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
23 basic_machine=arm-unknown
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
24 os=-cegcc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
25 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
26 + coco)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
27 + basic_machine=coco
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
28 + os=-none
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
29 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
30 convex-c1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
31 basic_machine=c1-convex
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
32 os=-bsd
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
33 diff -urN gcc-4.6.4-clean/configure gcc-4.6.4/configure
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
34 --- gcc-4.6.4-clean/configure 2011-12-18 03:03:44.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
35 +++ gcc-4.6.4/configure 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
36 @@ -3439,6 +3439,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
37 m32r-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
38 noconfigdirs="$noconfigdirs ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
39 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
40 + m6809*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
41 + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 target-libgloss ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
42 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
43 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
44 noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
45 libgloss_dir=m68hc11
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
46 diff -urN gcc-4.6.4-clean/configure.ac gcc-4.6.4/configure.ac
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
47 --- gcc-4.6.4-clean/configure.ac 2011-11-18 04:45:44.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
48 +++ gcc-4.6.4/configure.ac 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
49 @@ -885,6 +885,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
50 m32r-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
51 noconfigdirs="$noconfigdirs ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
52 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
53 + m6809*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
54 + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 target-libgloss ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
55 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
56 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
57 noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
58 libgloss_dir=m68hc11
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
59 diff -urN gcc-4.6.4-clean/gcc/calls.c gcc-4.6.4/gcc/calls.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
60 --- gcc-4.6.4-clean/gcc/calls.c 2012-02-09 10:27:25.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
61 +++ gcc-4.6.4/gcc/calls.c 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
62 @@ -2561,7 +2561,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
63 call sequence.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
64 Also do the adjustments before a throwing call, otherwise
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
65 exception handling can fail; PR 19225. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
66 - if (pending_stack_adjust >= 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
67 + if (pending_stack_adjust >= 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
68 || (pending_stack_adjust > 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
69 && (flags & ECF_MAY_BE_ALLOCA))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
70 || (pending_stack_adjust > 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
71 diff -urN gcc-4.6.4-clean/gcc/config/m6809/crt0.S gcc-4.6.4/gcc/config/m6809/crt0.S
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
72 --- gcc-4.6.4-clean/gcc/config/m6809/crt0.S 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
73 +++ gcc-4.6.4/gcc/config/m6809/crt0.S 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
74 @@ -0,0 +1,180 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
75 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
76 +;;; Copyright 2006, 2007, 2008, 2009 by Brian Dominy <brian@oddchange.com>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
77 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
78 +;;; This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
79 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
80 +;;; GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
81 +;;; it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
82 +;;; the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
83 +;;; any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
84 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
85 +;;; GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
86 +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
87 +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
88 +;;; GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
89 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
90 +;;; You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
91 +;;; along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
92 +;;; <http://www.gnu.org/licenses/>.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
93 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
94 + /* Declare external for main() */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
95 + .globl _main
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
96 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
97 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
98 +/* The startup is heavily dependent on the type of machine and
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
99 +OS environment that is available at the start point.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
100 +For the most part, the general idea is the same across machines,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
101 +but the implementation is vastly different. This is managed via
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
102 +conditional compiles throughout the startup code for each of the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
103 +supported machines. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
104 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
105 +#ifdef TARGET_COCO /* CoCo memory map */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
106 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
107 +#define COCO_RAMROM_MODE 0xFFDE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
108 +#define COCO_ALLRAM_MODE 0xFFDF
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
109 +#define COCO_PAGE1 0xFFD5
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
110 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
111 +/* SAM M1 and M0 adjusts the memory size */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
112 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
113 +#define BASIC_WARMSTART_FLAG 0x0071
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
114 +#define BASIC_START 0xA027
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
115 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
116 +#define __STACK_TOP 0x6800
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
117 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
118 +#else /* Simulator (default) memory map */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
119 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
120 +#define SIM_EXIT_REG 0xFF01
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
121 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
122 +#define __STACK_TOP 0xFE00
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
123 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
124 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
125 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
126 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
127 + /* Declare all linker sections, and combine them into a single bank */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
128 + .bank prog
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
129 + .area .text (BANK=prog)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
130 + .area .data (BANK=prog)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
131 + .area .ctors (BANK=prog)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
132 + .word 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
133 + .area .dtors (BANK=prog)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
134 + .word 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
135 + .area .bss (BANK=prog)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
136 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
137 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
138 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
139 + ;;; __exit : Exit point from the program
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
140 + ;;; For simulation, this writes to a special I/O register that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
141 + ;;; the simulator interprets as end-of-program.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
142 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
143 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
144 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
145 + .globl __exit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
146 +__exit:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
147 +#ifdef TARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
148 + ;; Go back to ROM/RAM mode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
149 + sta COCO_RAMROM_MODE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
150 + clr BASIC_WARMSTART_FLAG
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
151 + jmp BASIC_START
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
152 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
153 + tfr x,d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
154 + stb SIM_EXIT_REG
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
155 + bra __exit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
156 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
157 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
158 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
159 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
160 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
161 + ;;; __start : Entry point to the program
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
162 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
163 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
164 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
165 + .globl __start
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
166 +__start:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
167 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
168 +#ifdef HAVE_DIRECT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
169 + ;; Initialize the direct page pointer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
170 + lda #<s_.direct
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
171 + tfr a,dp
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
172 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
173 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
174 +#ifdef TARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
175 + ;; Turn off interrupts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
176 + orcc #(0x10|0x40)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
177 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
178 + ;; Setup All RAM Mode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
179 + sta COCO_ALLRAM_MODE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
180 +#endif /* TARGET_COCO */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
181 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
182 + ;; Initialize the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
183 + lds #__STACK_TOP - 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
184 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
185 + ;; Call any "initializer" functions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
186 + ldu #s_.ctors
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
187 +__ctors_loop:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
188 + ldy ,u++
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
189 + cmpy #0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
190 + beq __ctors_done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
191 + jsr ,y
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
192 + bra __ctors_loop
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
193 +__ctors_done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
194 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
195 + ;; Enable interrupts on the simulator
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
196 +#ifndef TARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
197 + andcc #~(0x10|0x40)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
198 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
199 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
200 + ;; Set up the environment
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
201 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
202 + ;; Set up argc/argv arrays
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
203 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
204 + ;; Call the main function. The exit code will
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
205 + ;; be returned in the X register, unless compiled
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
206 + ;; with -mdret, in which case it comes back in D.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
207 + jsr _main
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
208 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
209 + ;; Call any finalizer functions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
210 + ldu #s_.dtors
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
211 +__dtors_loop:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
212 + ldy ,u++
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
213 + cmpy #0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
214 + beq __dtors_done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
215 + jsr ,y
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
216 + bra __dtors_loop
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
217 +__dtors_done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
218 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
219 + ;; If main returns, then invoke _exit() to stop the program
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
220 + ;; The C library doesn't support -mdret yet, so move the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
221 + ;; argument first.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
222 +#ifdef __DRET__
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
223 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
224 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
225 + jmp _exit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
226 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
227 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
228 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
229 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
230 + ;;; __crt0_vector : Default handler for interrupts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
231 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
232 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
233 +___crt0_vector:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
234 + ;; The default behavior is to simply ignore all
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
235 + ;; non-reset interrupts.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
236 + rti
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
237 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
238 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
239 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
240 + ;;; vector : The interrupt vector table
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
241 + ;;; The linker will ensure that this gets loaded at address 0xFFF0.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
242 + ;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
243 + .area vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
244 +vectors:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
245 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
246 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
247 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
248 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
249 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
250 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
251 + .word ___crt0_vector
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
252 + .word __start
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
253 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
254 + .end __start
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
255 diff -urN gcc-4.6.4-clean/gcc/config/m6809/libgcc1.s gcc-4.6.4/gcc/config/m6809/libgcc1.s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
256 --- gcc-4.6.4-clean/gcc/config/m6809/libgcc1.s 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
257 +++ gcc-4.6.4/gcc/config/m6809/libgcc1.s 2015-07-20 19:44:52.766843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
258 @@ -0,0 +1,511 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
259 +/* libgcc routines for m6809
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
260 + Copyright (C) 2006 Free Software Foundation, Inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
261 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
262 +This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
263 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
264 +GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
265 +it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
266 +the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
267 +any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
268 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
269 +GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
270 +but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
271 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
272 +GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
273 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
274 +You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
275 +along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
276 +<http://www.gnu.org/licenses/>. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
277 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
278 +/* As a special exception, if you link this library with other files,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
279 + some of which are compiled with GCC, to produce an executable,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
280 + this library does not by itself cause the resulting executable
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
281 + to be covered by the GNU General Public License.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
282 + This exception does not however invalidate any other reasons why
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
283 + the executable file might be covered by the GNU General Public License. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
284 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
285 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
286 +#define SIGFPE jmp _abort
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
287 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
288 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
289 + ; Shift functions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
290 + ; On input, D is value to be shifted, and X has shift count.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
291 + ; Result is also in D.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
292 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
293 +#ifdef L_ashlhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
294 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
295 + .globl _ashlhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
296 +_ashlhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
297 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
298 +1$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
299 + leax -1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
300 + cmpx #-1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
301 + beq 2$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
302 + aslb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
303 + rola
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
304 + bra 1$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
305 +2$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
306 + puls x,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
307 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
308 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
309 +#ifdef L_ashrhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
310 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
311 + .globl _ashrhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
312 +_ashrhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
313 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
314 +1$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
315 + leax -1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
316 + cmpx #-1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
317 + beq 2$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
318 + asra
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
319 + rorb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
320 + bra 1$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
321 +2$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
322 + puls x,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
323 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
324 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
325 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
326 +#ifdef L_lshrhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
327 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
328 + .globl _lshrhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
329 +_lshrhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
330 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
331 +1$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
332 + leax -1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
333 + cmpx #-1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
334 + beq 2$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
335 + lsra
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
336 + rorb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
337 + bra 1$
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
338 +2$:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
339 + puls x,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
340 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
341 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
342 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
343 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
344 +#ifdef L_softregs
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
345 + .area direct
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
346 + .globl m0, m1, m2, m3, m4, m5, m6, m7
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
347 + .globl m8, m9, m10, m11, m12, m13, m14, m15
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
348 +m0: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
349 +m1: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
350 +m2: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
351 +m3: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
352 +m4: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
353 +m5: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
354 +m6: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
355 +m7: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
356 +m8: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
357 +m9: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
358 +m10: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
359 +m11: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
360 +m12: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
361 +m13: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
362 +m14: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
363 +m15: .blkb 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
364 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
365 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
366 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
367 +#ifdef L_ashlsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
368 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
369 + .globl _ashlsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
370 +_ashlsi3_one:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
371 + asl 3,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
372 + rol 2,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
373 + rol 1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
374 + rol ,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
375 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
376 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
377 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
378 +#ifdef L_ashlsi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
379 + /* X points to the SImode (source/dest)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
380 + B is the count */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
381 +_ashlsi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
382 + pshs u
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
383 + cmpb #16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
384 + blt try8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
385 + subb #16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
386 + ; Shift by 16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
387 + ldu 2,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
388 + stu ,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
389 +try8:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
390 + cmpb #8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
391 + blt try_rest
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
392 + subb #8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
393 + ; Shift by 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
394 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
395 +try_rest:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
396 + tstb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
397 + beq done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
398 +do_rest:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
399 + ; Shift by 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
400 + asl 3,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
401 + rol 2,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
402 + rol 1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
403 + rol ,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
404 + decb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
405 + bne do_rest
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
406 +done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
407 + puls u,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
408 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
409 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
410 +#ifdef L_ashrsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
411 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
412 + .globl _ashlsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
413 +_ashrsi3_one:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
414 + asr ,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
415 + ror 1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
416 + ror 2,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
417 + ror 3,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
418 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
419 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
420 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
421 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
422 +#ifdef L_lshrsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
423 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
424 + .globl _lshrsi3_one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
425 +_lshrsi3_one:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
426 + lsr ,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
427 + ror 1,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
428 + ror 2,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
429 + ror 3,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
430 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
431 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
432 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
433 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
434 +#ifdef L_clzsi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
435 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
436 + .globl ___clzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
437 + ; Input: X = 16-bit unsigned integer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
438 + ; Output: X = number of leading zeros
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
439 + ; This function destroys the value in D.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
440 +___clzhi2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
441 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
442 + ; Find the offset of the leftmost '1' bit in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
443 + ; the left half of the word.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
444 + ;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
445 + ; Bits are numbered in the table with 1 meaning the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
446 + ; LSB and 8 meaning the MSB.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
447 + ;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
448 + ; If nonzero, then clz is 8-a.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
449 + tfr x,d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
450 + ldx #___clz_tab
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
451 + tfr a,b
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
452 + clra
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
453 + ldb d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
454 + bne upper_bit_set
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
455 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
456 +lower_bit_set:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
457 + ; If the upper byte is zero, then check the lower
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
458 + ; half of the word. Return 16-a.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
459 + puls d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
460 + clra
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
461 + ldb d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
462 + negb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
463 + addb #16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
464 + bra done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
465 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
466 +upper_bit_set:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
467 + negb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
468 + addb #8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
469 + puls x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
470 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
471 +done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
472 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
473 + puls pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
474 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
475 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
476 +#ifdef L_clzdi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
477 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
478 + .globl ___clzsi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
479 + ; Input: 32-bit unsigned integer is on the stack, just
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
480 + ; above the return address
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
481 + ; Output: X = number of leading zeros
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
482 +___clzsi2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
483 + ; Check the upper 16-bit word
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
484 + ; If it is not zero, then return clzhi2(X).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
485 + ; A branch can be used instead of a call since no
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
486 + ; postprocessing is needed. Use long branch form
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
487 + ; though since functions may not be near each other.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
488 + ldx 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
489 + lbne ___clzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
490 + ldx 4,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
491 + jsr ___clzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
492 + leax 16,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
493 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
494 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
495 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
496 +#ifdef L_ctzsi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
497 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
498 + .globl ___ctzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
499 + ; Input: X = 16-bit unsigned integer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
500 + ; Output: X = number of trailing zeros
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
501 + ; F(x) = 15 - clzhi2(X & -x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
502 + ; This function destroys the value in D.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
503 +___ctzhi2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
504 + tfr x,d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
505 + coma
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
506 + comb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
507 + addd #1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
508 + pshs a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
509 + pshs b
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
510 + tfr x,d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
511 + andb ,s+
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
512 + anda ,s+
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
513 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
514 + jsr ___clzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
515 + tfr x,d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
516 + subd #16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
517 + coma
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
518 + comb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
519 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
520 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
521 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
522 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
523 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
524 +#ifdef L_ctzdi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
525 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
526 + .globl ___ctzsi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
527 + ; Input: 32-bit unsigned integer is on the stack, just
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
528 + ; above the return address
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
529 + ; Output: X = number of leading zeros
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
530 +___ctzsi2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
531 + ; Check the lower 16-bit word
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
532 + ; If it is not zero, then return ctzhi2(X).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
533 + ; A branch can be used instead of a call since no
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
534 + ; postprocessing is needed. Use long branch form
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
535 + ; though since functions may not be near each other.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
536 + ldx 4,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
537 + lbne ___ctzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
538 + ldx 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
539 + jsr ___ctzhi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
540 + leax 16,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
541 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
542 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
543 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
544 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
545 +#ifdef L_mulhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
546 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
547 +;;; ___mulhi3 - signed/unsigned multiply
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
548 +;;; Called by GCC to implement 16x16 multiplication
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
549 +;;; Arguments: Two 16-bit values, one in stack, one in X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
550 +;;; Result: 16-bit result in X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
551 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
552 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
553 + .globl _mulhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
554 +_mulhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
555 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
556 + lda 5,s ; left msb * right lsb * 256
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
557 + ldb ,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
558 + mul
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
559 + tfr b,a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
560 + clrb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
561 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
562 + ldb 1,s ; left lsb * right msb * 256
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
563 + lda 4,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
564 + mul
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
565 + tfr b,a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
566 + clrb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
567 + leax d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
568 + ldb 1,s ; left lsb * right lsb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
569 + lda 5,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
570 + mul
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
571 + leax d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
572 + puls d,pc ; kill D to remove initial push
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
573 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
574 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
575 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
576 +#ifdef L_divhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
577 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
578 +;;; ___divhi3 - signed division
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
579 +;;; Arguments: Dividend in X, divisor on the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
580 +;;; Returns result in X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
581 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
582 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
583 + .globl _divhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
584 +_divhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
585 + ldd 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
586 + bne do_div ; check dividend
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
587 + SIGFPE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
588 +do_div:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
589 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
590 + jsr _seuclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
591 + puls x,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
592 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
593 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
594 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
595 +#ifdef L_modhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
596 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
597 +;;; ___modhi3 - signed modulo
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
598 +;;; Arguments: Dividend in X, divisor on the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
599 +;;; Returns result in X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
600 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
601 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
602 + .globl _modhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
603 +_modhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
604 + ldd 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
605 + bne do_mod ; check dividend
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
606 + SIGFPE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
607 +do_mod:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
608 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
609 + jsr _seuclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
610 + leas 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
611 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
612 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
613 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
614 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
615 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
616 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
617 +#ifdef L_udivhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
618 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
619 +;;; ___udivhi3 - unsigned division
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
620 +;;; Arguments: Dividend in X, divisor on the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
621 +;;; Returns result in X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
622 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
623 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
624 + .globl _udivhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
625 +_udivhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
626 + ldd 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
627 + bne do_udiv ; check dividend
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
628 + SIGFPE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
629 +do_udiv:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
630 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
631 + jsr _euclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
632 + puls x,pc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
633 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
634 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
635 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
636 +#ifdef L_umodhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
637 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
638 +;;; ___umodhi3 - unsigned modulo
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
639 +;;; Arguments: Dividend in X, divisor on the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
640 +;;; Returns result in X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
641 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
642 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
643 + .globl _umodhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
644 +_umodhi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
645 + ldd 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
646 + bne do_umod ; check dividend
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
647 + SIGFPE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
648 +do_umod:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
649 + pshs x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
650 + jsr _euclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
651 + leas 2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
652 + tfr d,x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
653 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
654 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
655 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
656 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
657 +#ifdef L_euclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
658 +; unsigned euclidean division
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
659 +; calling: (left / right)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
660 +; push left
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
661 +; ldd right
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
662 +; jsr _euclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
663 +; quotient on the stack (left)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
664 +; modulus in d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
665 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
666 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
667 + .globl _euclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
668 + left=5
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
669 + right=1 ; word
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
670 + count=0 ; byte
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
671 + CARRY=1 ; alias
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
672 +_euclid:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
673 + leas -3,s ; 2 local variables
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
674 + clr count,s ; prescale divisor
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
675 + inc count,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
676 + tsta
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
677 +presc:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
678 + bmi presc_done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
679 + inc count,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
680 + aslb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
681 + rola
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
682 + bra presc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
683 +presc_done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
684 + std right,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
685 + ldd left,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
686 + clr left,s ; quotient = 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
687 + clr left+1,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
688 +mod1:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
689 + subd right,s ; check subtract
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
690 + bcc mod2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
691 + addd right,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
692 + andcc #~CARRY
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
693 + bra mod3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
694 +mod2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
695 + orcc #CARRY
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
696 +mod3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
697 + rol left+1,s ; roll in carry
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
698 + rol left,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
699 + lsr right,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
700 + ror right+1,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
701 + dec count,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
702 + bne mod1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
703 + leas 3,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
704 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
705 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
706 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
707 +#ifdef L_seuclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
708 +; signed euclidean division
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
709 +; calling: (left / right)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
710 +; push left
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
711 +; ldd right
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
712 +; jsr _seuclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
713 +; quotient on the stack (left)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
714 +; modulus in d
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
715 + .area .text
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
716 + .globl _seuclid
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
717 + left=6
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
718 + right=2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
719 + quot_sign=1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
720 + mod_sign=0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
721 +_seuclid:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
722 + leas -4,s ; 3 local variables
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
723 + std right,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
724 + clr mod_sign,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
725 + clr quot_sign,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
726 + ldd left,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
727 + bge mod_abs
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
728 + inc mod_sign,s ; sign(mod) = sign(left)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
729 + inc quot_sign,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
730 + bsr negd ; abs(left) -> D
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
731 +mod_abs:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
732 + pshs b,a ; push abs(left)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
733 + ldd right+2,s ; all references shifted by 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
734 + bge quot_abs
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
735 + dec quot_sign+2,s ; sign(quot) = sign(left) XOR sign(right)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
736 + bsr negd ; abs(right) -> D
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
737 +quot_abs:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
738 + jsr _euclid ; call (unsigned) euclidean division
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
739 + std right+2,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
740 + puls a,b ; quot -> D
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
741 + tst quot_sign,s ; all references no longer shifted
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
742 + beq quot_done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
743 + bsr negd
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
744 +quot_done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
745 + std left,s ; quot -> left
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
746 + ldd right,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
747 + tst mod_sign,s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
748 + beq mod_done
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
749 + bsr negd
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
750 +mod_done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
751 + leas 4,s ; destroy stack frame
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
752 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
753 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
754 +negd: ; self-explanatory !
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
755 + nega
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
756 + negb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
757 + sbca #0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
758 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
759 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
760 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
761 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
762 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
763 +#ifdef L_pending_addsi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
764 +_addsi3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
765 + rts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
766 +#endif /* L_pending_addsi3 */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
767 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
768 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
769 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
770 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.c gcc-4.6.4/gcc/config/m6809/m6809.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
771 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.c 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
772 +++ gcc-4.6.4/gcc/config/m6809/m6809.c 2015-07-20 22:11:37.726714746 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
773 @@ -0,0 +1,3023 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
774 +/*-------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
775 + FILE: m6809.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
776 +-------------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
777 +/* Subroutines for insn-output.c for MC6809.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
778 + Copyright (C) 1989-2007 Free Software Foundation, Inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
779 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
780 + MC6809 Version by Tom Jones (jones@sal.wisc.edu)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
781 + Space Astronomy Laboratory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
782 + University of Wisconsin at Madison
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
783 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
784 + minor changes to adapt it to gcc-2.5.8 by Matthias Doerfel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
785 + ( msdoerfe@informatik.uni-erlangen.de )
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
786 + also added #pragma interrupt (inspired by gcc-6811)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
787 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
788 + minor changes to adapt it to gcc-2.8.0 by Eric Botcazou
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
789 + (ebotcazou@multimania.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
790 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
791 + minor changes to adapt it to gcc-2.95.3 by Eric Botcazou
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
792 + (ebotcazou@multimania.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
793 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
794 + major cleanup, improvements, and upgrade to gcc 3.4 by Brian Dominy
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
795 + (brian@oddchange.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
796 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
797 + additional adjustments, etc., for gcc 4.6.1 by William Astle (lost@l-w.ca)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
798 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
799 +This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
800 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
801 +GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
802 +it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
803 +the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
804 +any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
805 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
806 +GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
807 +but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
808 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
809 +GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
810 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
811 +You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
812 +along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
813 +<http://www.gnu.org/licenses/>. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
814 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
815 +#include <string.h>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
816 +#include <time.h>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
817 +#include <sys/types.h>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
818 +#include <sys/timeb.h>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
819 +#include <stdio.h>
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
820 +#include "config.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
821 +#include "system.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
822 +#include "coretypes.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
823 +#include "tm.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
824 +#include "tree.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
825 +#include "rtl.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
826 +#include "tm_p.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
827 +#include "regs.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
828 +#include "flags.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
829 +#include "hard-reg-set.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
830 +#include "real.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
831 +#include "tree.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
832 +#include "insn-config.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
833 +#include "conditions.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
834 +#include "insn-flags.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
835 +#include "output.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
836 +#include "insn-attr.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
837 +#include "function.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
838 +#include "target.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
839 +#include "target-def.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
840 +#include "expr.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
841 +#include "recog.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
842 +#include "cpplib.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
843 +#include "c-family/c-pragma.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
844 +#include "c-family/c-common.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
845 +#include "toplev.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
846 +#include "optabs.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
847 +#include "version.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
848 +#include "df.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
849 +#include "rtlhooks-def.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
850 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
851 +/* macro to return TRUE if length of operand mode is one byte */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
852 +#define BYTE_MODE(X) ((GET_MODE_SIZE (GET_MODE (X))) == 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
853 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
854 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
855 +/* REAL_REG_P(x) is a true if the rtx 'x' represents a real CPU
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
856 +register and not a fake one that is emulated in software. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
857 +#define REAL_REG_P(x) (REG_P(x) && !M_REG_P(x))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
858 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
859 +/*-------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
860 + Target hooks, moved from target.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
861 +-------------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
862 +static void m6809_encode_section_info (tree decl, rtx rtl, int new_decl_p ATTRIBUTE_UNUSED);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
863 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
864 +#undef TARGET_ENCODE_SECTION_INFO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
865 +#define TARGET_ENCODE_SECTION_INFO m6809_encode_section_info
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
866 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
867 +#undef TARGET_ASM_FILE_START
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
868 +#define TARGET_ASM_FILE_START m6809_asm_file_start
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
869 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
870 +#undef TARGET_ASM_ALIGNED_HI_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
871 +#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
872 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
873 +#undef TARGET_ASM_ALIGNED_SI_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
874 +#define TARGET_ASM_ALIGNED_SI_OP NULL
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
875 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
876 +#undef TARGET_ASM_UNALIGNED_HI_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
877 +#define TARGET_ASM_UNALIGNED_HI_OP "\t.word\t"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
878 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
879 +#undef TARGET_ASM_UNALIGNED_SI_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
880 +#define TARGET_ASM_UNALIGNED_SI_OP NULL
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
881 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
882 +#undef TARGET_RTX_COSTS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
883 +#define TARGET_RTX_COSTS m6809_rtx_costs
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
884 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
885 +#undef TARGET_ATTRIBUTE_TABLE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
886 +#define TARGET_ATTRIBUTE_TABLE m6809_attribute_table
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
887 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
888 +#undef TARGET_INIT_BUILTINS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
889 +#define TARGET_INIT_BUILTINS m6809_init_builtins
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
890 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
891 +#undef TARGET_EXPAND_BUILTIN
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
892 +#define TARGET_EXPAND_BUILTIN m6809_expand_builtin
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
893 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
894 +#undef TARGET_DEFAULT_TARGET_FLAGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
895 +#define TARGET_DEFAULT_TARGET_FLAGS (MASK_REG_ARGS | MASK_DIRECT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
896 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
897 +#undef TARGET_FUNCTION_OK_FOR_SIBCALL
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
898 +#define TARGET_FUNCTION_OK_FOR_SIBCALL m6809_function_ok_for_sibcall
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
899 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
900 +#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
901 +#define TARGET_ASM_TRAMPOLINE_TEMPLATE m6809_asm_trampoline_template
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
902 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
903 +#undef TARGET_TRAMPOLINE_INIT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
904 +#define TARGET_TRAMPOLINE_INIT m6809_initialize_trampoline
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
905 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
906 +#undef TARGET_FRAME_POINTER_REQUIRED
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
907 +#define TARGET_FRAME_POINTER_REQUIRED m6809_frame_pointer_required
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
908 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
909 +#undef TARGET_OPTION_OVERRIDE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
910 +#define TARGET_OPTION_OVERRIDE m6809_override_options
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
911 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
912 +/* External variables used */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
913 +extern int reload_completed; /* set in toplev.c */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
914 +extern FILE *asm_out_file;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
915 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
916 +static int last_mem_size; /* operand size (bytes) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
917 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
918 +/* True if the section was recently changed and another .area
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
919 + * directive needs to be output before emitting the next label. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
920 +int section_changed = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
921 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
922 +/* Section names. The defaults here are used until an
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
923 + * __attribute__((section)) is seen that changes it. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
924 +char code_section_op[128] = "\t.area .text";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
925 +char data_section_op[128] = "\t.area .data";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
926 +char bss_section_op[128] = "\t.area .bss";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
927 +const char *code_bank_option = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
928 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
929 +/* TRUE if the direct mode prefix might be valid in this context.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
930 + * This is set by 'print_address' prior to calling output_addr_const,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
931 + * which performs into 'print_direct_prefix' to do the final checks. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
932 +static int check_direct_prefix_flag;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
933 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
934 +/* Nonzero if an address is being printed in a context which does not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
935 + * permit any PIC modifications to the address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
936 +static int pic_ok_for_addr_p = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
937 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
938 +/* Current code page. This supports machines which can do bank
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
939 + * switching to allow for more than 64KB of code/data. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
940 +char far_code_page[64];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
941 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
942 +/* Current bank name */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
943 +static char current_bank_name[8] = "-1";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
944 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
945 +/* Default bank name */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
946 +static char default_code_bank_name[8] = "-1";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
947 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
948 +/* Direct memory reserved as soft registers */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
949 +unsigned int m6809_soft_regs = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
950 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
951 +/* ABI version */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
952 +unsigned int m6809_abi_version = M6809_ABI_VERSION_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
953 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
954 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
955 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
956 + * Called after options have been parsed.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
957 + * If overrides have been specified on the command-line, then
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
958 + * these values are copied into the main storage variables.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
959 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
960 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
961 +m6809_override_options (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
962 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
963 + /* Handle -mfar-code-page */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
964 + if (far_code_page_option == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
965 + far_code_page_option = "__default_code_page";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
966 + strcpy (far_code_page, far_code_page_option);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
967 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
968 + /* Handle -mcode-section, -mdata-section, and -mbss-section */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
969 + if (code_section_ptr != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
970 + sprintf (code_section_op, "\t.area %s", code_section_ptr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
971 + if (data_section_ptr != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
972 + sprintf (data_section_op, "\t.area %s", data_section_ptr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
973 + if (bss_section_ptr != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
974 + sprintf (bss_section_op, "\t.area %s", bss_section_ptr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
975 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
976 + /* Handle -mcode-bank */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
977 + if (code_bank_option != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
978 + sprintf (default_code_bank_name, "%s", code_bank_option);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
979 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
980 + /* Handle -mabi-version or -mno-reg-args */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
981 + if (m6809_abi_version_ptr != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
982 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
983 + if (!strcmp (m6809_abi_version_ptr, "stack"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
984 + m6809_abi_version = M6809_ABI_VERSION_STACK;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
985 + else if (!strcmp (m6809_abi_version_ptr, "regs"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
986 + m6809_abi_version = M6809_ABI_VERSION_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
987 + else if (!strcmp (m6809_abi_version_ptr, "bx"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
988 + m6809_abi_version = M6809_ABI_VERSION_BX;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
989 + else if (!strcmp (m6809_abi_version_ptr, "latest"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
990 + m6809_abi_version = M6809_ABI_VERSION_LATEST;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
991 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
992 + m6809_abi_version = atoi (m6809_abi_version_ptr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
993 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
994 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
995 + /* The older -mno-reg-args option is deprecated, and treated
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
996 + as -mabi=stack. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
997 + if (!TARGET_REG_ARGS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
998 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
999 + warning (WARNING_OPT "-mno-reg-args deprecated; use -mabi=stack instead.");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1000 + m6809_abi_version = M6809_ABI_VERSION_STACK;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1001 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1002 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1003 + /* -fexceptions is unsupported */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1004 + flag_exceptions = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1005 + flag_non_call_exceptions = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1006 + flag_unwind_tables = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1007 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1008 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1009 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1010 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1011 + * Output prefix that directs the assembler to use a direct-mode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1012 + * instruction if globally enabled, address is a symbol, and symbol
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1013 + * has been marked as in direct page. Also, never do this if
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1014 + * using the indirect mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1015 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1016 +print_direct_prefix (FILE * file, rtx addr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1017 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1018 + if (TARGET_DIRECT &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1019 + (GET_CODE (addr) == SYMBOL_REF) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1020 + SYMBOL_REF_FLAG (addr) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1021 + check_direct_prefix_flag)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1022 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1023 + putc ('*', file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1024 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1025 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1026 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1027 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1028 +/** Prints an operand (that is not an address) in assembly from RTL. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1029 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1030 +print_operand (FILE * file, rtx x, int code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1031 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1032 + if (REG_P (x)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1033 + /* gcc currently allocates the entire 16-bit 'd' register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1034 + * even when it only needs an 8-bit value. So here it
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1035 + * is tricked into printing only the lower 8-bit 'b'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1036 + * register into the assembly output.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1037 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1038 + * Eventually gcc should be modified to allocate a/b
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1039 + * independently and this hack can be removed.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1040 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1041 + * Occasionally, we may want to do an operation using
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1042 + * the 'a' register instead of 'b'; use the 'A' code
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1043 + * to specify that.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1044 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1045 + if (code == 'A')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1046 + fputs ("a", file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1047 + else if ((BYTE_MODE (x)) && (REGNO (x) == HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1048 + fputs ("b", file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1049 + else if (M_REG_P (x) && code == 'L')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1050 + /* Soft registers can be treated like memory and accessed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1051 + * at a particular offset. TODO : handle 'W' */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1052 + fputs (reg_names[REGNO (x)+1], file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1053 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1054 + fputs (reg_names[REGNO (x)], file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1055 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1056 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1057 + else if (MEM_P (x)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1058 + last_mem_size = GET_MODE_SIZE (GET_MODE (x));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1059 + if (code == 'L') { /* LSH of word address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1060 + if (GET_CODE (XEXP (x, 0)) == MEM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1061 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1062 + /* Offseting an indirect addressing mode is not supported */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1063 + error ("expression too complex for 6809 (offset indirect mode)");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1064 + debug_rtx (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1065 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1066 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1067 + x = adjust_address (x, QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1068 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1069 + else if (code == 'M') { /* MSH of word address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1070 + if (GET_CODE (XEXP (x, 0)) == MEM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1071 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1072 + /* Offseting an indirect addressing mode is not supported */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1073 + error ("expression too complex for 6809 (offset indirect mode)");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1074 + debug_rtx (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1075 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1076 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1077 + x = adjust_address (x, QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1078 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1079 + else if (code == 'W') { /* least significant half of 32-bit */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1080 + x = adjust_address (x, HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1081 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1082 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1083 + pic_ok_for_addr_p = (code != 'C');
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1084 + output_address (XEXP (x, 0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1085 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1086 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1087 + else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != DImode) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1088 + union { double d; int i[2]; } u;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1089 + u.i[0] = CONST_DOUBLE_LOW (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1090 + u.i[1] = CONST_DOUBLE_HIGH (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1091 + fprintf (file, "#%#9.9g", u.d);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1092 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1093 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1094 + else if (code == 'R') {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1095 + fprintf (file, "%s",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1096 + m6809_get_regs_printable (INTVAL (x)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1097 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1098 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1099 + else {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1100 + if (code == 'L') { /* LSH of word address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1101 + x = gen_rtx_CONST_INT (VOIDmode, (INTVAL(x) & 0xff));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1102 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1103 + else if (code == 'M') { /* MSH of word address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1104 + x = gen_rtx_CONST_INT (VOIDmode, ((INTVAL(x) >> 8) & 0xff));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1105 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1106 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1107 + putc ('#', file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1108 + output_addr_const (file, x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1109 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1110 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1111 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1112 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1113 +/** Prints an address operand to assembler from its RTL representation. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1114 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1115 +print_operand_address (FILE *file, rtx addr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1116 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1117 + register rtx base = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1118 + register rtx offset = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1119 + int regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1120 + int indirect_flag = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1121 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1122 + check_direct_prefix_flag = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1123 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1124 + /*** check for indirect addressing ***/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1125 + if (MEM_P (addr)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1126 + last_mem_size = GET_MODE_SIZE (GET_MODE (addr));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1127 + addr = XEXP (addr, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1128 + if (pic_ok_for_addr_p)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1129 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1130 + indirect_flag = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1131 + fprintf (file, "[");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1132 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1133 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1134 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1135 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1136 + switch (GET_CODE (addr)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1137 + case REG:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1138 + regno = REGNO (addr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1139 + fprintf (file, ",%s", reg_names[regno]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1140 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1141 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1142 + case PRE_DEC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1143 + regno = REGNO (XEXP (addr, 0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1144 + fputs (((last_mem_size == 1) ? ",-" : ",--"), file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1145 + fprintf (file, "%s", reg_names[regno]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1146 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1147 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1148 + case POST_INC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1149 + regno = REGNO (XEXP (addr, 0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1150 + fprintf (file, ",%s", reg_names[regno]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1151 + fputs (((last_mem_size == 1) ? "+" : "++"), file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1152 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1153 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1154 + case PLUS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1155 + base = XEXP (addr, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1156 + if (MEM_P (base))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1157 + base = XEXP (base, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1158 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1159 + offset = XEXP (addr, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1160 + if (MEM_P (offset))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1161 + offset = XEXP (offset, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1162 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1163 + if ((CONSTANT_ADDRESS_P (base)) && (CONSTANT_ADDRESS_P (offset))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1164 + if (!indirect_flag)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1165 + check_direct_prefix_flag = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1166 + output_addr_const (file, base);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1167 + check_direct_prefix_flag = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1168 + fputs ("+", file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1169 + output_addr_const (file, offset);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1170 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1171 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1172 + else if ((CONSTANT_ADDRESS_P (base)) && (A_REG_P (offset))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1173 + output_addr_const (file, base);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1174 + fprintf (file, ",%s", reg_names[REGNO (offset)]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1175 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1176 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1177 + else if ((CONSTANT_ADDRESS_P (offset)) && (A_REG_P (base))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1178 + output_addr_const (file, offset);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1179 + fprintf (file, ",%s", reg_names[REGNO (base)]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1180 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1181 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1182 + /*** accumulator offset ***/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1183 + else if (((D_REG_P (offset)) || (Q_REG_P (offset)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1184 + && (A_REG_P (base))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1185 + fprintf (file, "%s,%s",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1186 + reg_names[REGNO (offset)], reg_names[REGNO (base)]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1187 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1188 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1189 + else if (((D_REG_P (base)) || (Q_REG_P (base)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1190 + && (A_REG_P (offset))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1191 + fprintf (file, "%s,%s",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1192 + reg_names[REGNO (base)], reg_names[REGNO (offset)]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1193 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1194 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1195 + else if (GET_CODE (base) == PRE_DEC) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1196 + regno = REGNO (XEXP (base, 0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1197 + fputs (((last_mem_size == 1) ? ",-" : ",--"), file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1198 + fprintf (file, "%s", reg_names[regno]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1199 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1200 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1201 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1202 + abort ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1203 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1204 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1205 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1206 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1207 + /* Set this global before calling output_addr_const() */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1208 + if (!indirect_flag)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1209 + check_direct_prefix_flag = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1210 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1211 + /* When printing a SYMBOL_REF in PIC mode, do not print the leading
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1212 + * '#' and follow it by ',pcr' to enable relative addressing. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1213 + if (flag_pic && pic_ok_for_addr_p && GET_CODE (addr) == SYMBOL_REF)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1214 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1215 + ASM_OUTPUT_SYMBOL_REF (file, addr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1216 + fputs (",pcr", file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1217 + pic_ok_for_addr_p = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1218 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1219 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1220 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1221 + output_addr_const (file, addr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1222 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1223 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1224 + check_direct_prefix_flag = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1225 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1226 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1227 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1228 + if (indirect_flag)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1229 + fprintf (file, "]");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1230 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1231 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1232 +/*-------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1233 + Update the CC Status
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1234 +---------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1235 + Set the cc_status for the results of an insn whose pattern is EXP.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1236 + We assume that jumps don't affect the condition codes.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1237 + All else, clobbers the condition codes, by assumption.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1238 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1239 + We assume that ALL add, minus, etc. instructions effect the condition
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1240 + codes.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1241 +-------------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1242 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1243 +notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1244 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1245 + int src_code;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1246 + int dst_code;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1247 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1248 + /*** recognize SET insn's ***/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1249 + if (GET_CODE (exp) == SET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1250 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1251 + src_code = GET_CODE (SET_SRC (exp));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1252 + dst_code = GET_CODE (SET_DEST (exp));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1253 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1254 + /* Jumps do not alter the cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1255 + if (SET_DEST (exp) == pc_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1256 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1257 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1258 + /* Moving one register into another register (tfr):
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1259 + Doesn't alter the cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1260 + if (REG_P (SET_DEST (exp)) && (REG_P (SET_SRC (exp))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1261 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1262 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1263 + /* Moving memory into a register (load): Sets cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1264 + if (REG_P (SET_DEST (exp)) && src_code == MEM) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1265 + cc_status.value1 = SET_SRC (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1266 + cc_status.value2 = SET_DEST (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1267 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1268 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1269 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1270 + /* Moving register into memory (store): Sets cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1271 + if (dst_code == MEM && REG_P (SET_SRC (exp))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1272 + cc_status.value1 = SET_SRC (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1273 + cc_status.value2 = SET_DEST (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1274 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1275 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1276 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1277 + /* Function calls clobber the cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1278 + else if (GET_CODE (SET_SRC (exp)) == CALL) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1279 + CC_STATUS_INIT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1280 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1281 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1282 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1283 + /* Tests and compares set the cc's in predictable ways. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1284 + else if (SET_DEST (exp) == cc0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1285 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1286 + cc_status.flags = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1287 + cc_status.value1 = SET_SRC (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1288 + cc_status.value2 = SET_DEST (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1289 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1290 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1291 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1292 + else if (A_REG_P (SET_DEST (exp)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1293 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1294 + CC_STATUS_INIT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1295 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1296 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1297 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1298 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1299 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1300 + /* Certain instructions affect the condition codes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1301 + switch (src_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1302 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1303 + case PLUS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1304 + case MINUS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1305 + case NEG:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1306 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1307 + /* These instructions set the condition codes,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1308 + * and may modify the V bit. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1309 + cc_status.flags |= CC_NO_OVERFLOW;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1310 + /* FALLTHRU */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1311 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1312 + case AND:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1313 + case IOR:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1314 + case XOR:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1315 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1316 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1317 + /* These instructions set the condition codes,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1318 + * but cannot overflow (V=0). */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1319 + cc_status.value1 = SET_SRC (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1320 + cc_status.value2 = SET_DEST (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1321 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1322 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1323 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1324 + /* Everything else is clobbered */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1325 + CC_STATUS_INIT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1326 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1327 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1328 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1329 + } /* SET */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1330 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1331 + else if (GET_CODE (exp) == PARALLEL
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1332 + && GET_CODE (XVECEXP (exp, 0, 0)) == SET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1333 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1334 + if (SET_DEST (XVECEXP (exp, 0, 0)) == pc_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1335 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1336 + if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1337 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1338 + CC_STATUS_INIT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1339 + cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1340 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1341 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1342 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1343 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1344 + /*** default action if we haven't recognized something
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1345 + and returned earlier ***/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1346 + CC_STATUS_INIT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1347 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1348 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1349 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1350 +/** Returns nonzero if the expression EXP can be implemented using one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1351 + * of the 6809's single operand instructions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1352 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1353 +m6809_single_operand_operator (rtx exp)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1354 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1355 + rtx op1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1356 + HOST_WIDE_INT val;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1357 + enum rtx_code code;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1358 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1359 + debug_rtx(exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1360 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1361 + code = GET_CODE (exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1362 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1363 + /* Unary operators always qualify */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1364 + switch (code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1365 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1366 + case NEG:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1367 + case NOT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1368 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1369 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1370 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1371 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1372 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1373 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1374 + /* Binary operators can only qualify if the second
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1375 + * argument is a CONST_INT of certain value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1376 + op1 = XEXP (exp, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1377 + if (GET_CODE (op1) != CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1378 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1379 + val = INTVAL (op1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1380 + switch (code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1381 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1382 + case PLUS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1383 + case MINUS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1384 + if (val == -1 || val == 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1385 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1386 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1387 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1388 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1389 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1390 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1391 + case ROTATE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1392 + case ROTATERT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1393 + if (val == 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1394 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1395 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1396 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1397 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1398 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1399 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1400 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1401 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1402 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1403 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1404 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1405 +/** Return a bitarray of the hard registers which are used by a function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1406 +unsigned int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1407 +m6809_get_live_regs (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1408 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1409 + unsigned int regs = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1410 + int regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1411 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1412 + if (frame_pointer_needed)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1413 + regs |= (1 << HARD_FRAME_POINTER_REGNUM);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1414 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1415 + for (regno = HARD_X_REGNUM; regno <= HARD_U_REGNUM; regno++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1416 + if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1417 + regs |= (1 << regno);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1418 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1419 + return regs;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1420 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1421 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1422 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1423 +/** Return a printable version of a list of hard registers, suitable
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1424 + * for use in a PSHx or PULx insn. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1425 +const char *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1426 +m6809_get_regs_printable (unsigned int regs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1427 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1428 + static char list[64];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1429 + char *listp = list;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1430 + unsigned int regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1431 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1432 + for (regno=0; regno < FIRST_PSEUDO_REGISTER; regno++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1433 + if ((regs & (1 << regno)) && !S_REGNO_P (regno))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1434 + listp += sprintf (listp,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1435 + (listp == list) ? "%s" : ",%s", reg_names[regno]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1436 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1437 + return list;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1438 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1439 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1440 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1441 +/** Return the total number of bytes covered by a set of hard registers. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1442 +unsigned int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1443 +m6809_get_regs_size (unsigned int regs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1444 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1445 + unsigned int regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1446 + unsigned int size = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1447 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1448 + for (regno=0; regno < FIRST_PSEUDO_REGISTER; regno++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1449 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1450 + /* Only count register in the given register set */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1451 + if (REGSET_CONTAINS_P (regno, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1452 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1453 + /* Add 1 or 2 byte, depending on the size of the register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1454 + * Since 'D' may be in both sets, check for WORD_REGSET first. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1455 + if (REGSET_CONTAINS_P(regno, WORD_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1456 + size += 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1457 + else if (REGSET_CONTAINS_P(regno, BYTE_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1458 + size++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1459 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1460 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1461 + return size;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1462 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1463 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1464 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1465 +/* Given the target of call instruction in X,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1466 + * return the tree node that contains the function declaration for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1467 + * that target.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1468 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1469 + * If the rtx or the tree do not appear valid for any reason,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1470 + * then return NULL_TREE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1471 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1472 +static tree call_target_decl (rtx x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1473 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1474 + tree decl;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1475 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1476 + /* Make sure the target is really a MEM. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1477 + if (!x || !MEM_P (x))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1478 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1479 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1480 + /* Make sure the address is a SYMBOL_REF. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1481 + x = XEXP (x, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1482 + if (!x || (GET_CODE (x) != SYMBOL_REF))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1483 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1484 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1485 + /* Get the declaration of this symbol */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1486 + decl = SYMBOL_REF_DECL (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1487 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1488 + /* Make sure the declaration is really a function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1489 + if (!decl || (TREE_CODE(decl) != FUNCTION_DECL))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1490 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1491 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1492 + return decl;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1493 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1494 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1495 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1496 +/** Returns nonzero if a function, whose declaration is in DECL,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1497 + * was declared to have the attribute given by ATTR_NAME. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1498 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1499 +m6809_function_has_type_attr_p (tree decl, const char *attr_name)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1500 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1501 + tree type;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1502 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1503 + type = TREE_TYPE (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1504 + return lookup_attribute (attr_name, TYPE_ATTRIBUTES (type)) != NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1505 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1506 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1507 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1508 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1509 +/** Returns nonzero if the current function was declared to have the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1510 + * attribute given by ATTR_NAME. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1511 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1512 +m6809_current_function_has_type_attr_p (const char *attr_name)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1513 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1514 + return m6809_function_has_type_attr_p (current_function_decl, attr_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1515 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1516 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1517 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1518 +/** Return nonzero if the current function has no return value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1519 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1520 +m6809_current_function_is_void (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1521 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1522 + return (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1523 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1524 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1525 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1526 +/** Get the value of a declaration's 'bank', as set by the 'bank'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1527 + * attribute. If no bank was declared, it returns NULL by default. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1528 +const char *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1529 +m6809_get_decl_bank (tree decl)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1530 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1531 + tree attr;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1532 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1533 + /* Lookup the 'bank' attribute. If it does not exist, then
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1534 + * return NULL */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1535 + attr = lookup_attribute ("bank", DECL_ATTRIBUTES (decl));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1536 + if (attr == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1537 + return NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1538 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1539 + /* Make sure it has a value assigned to it */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1540 + attr = TREE_VALUE (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1541 + if (attr == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1542 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1543 + warning (WARNING_OPT "banked function did not declare a bank number");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1544 + return NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1545 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1546 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1547 + /* Return the bank name */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1548 + attr = TREE_VALUE (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1549 + return TREE_STRING_POINTER (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1550 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1551 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1552 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1553 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1554 +m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1555 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1556 + /* Check the function declaration for special properties.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1557 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1558 + * If the function was declare with __attribute__((bank)), output
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1559 + * assembler definitions to force the function to go into the named
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1560 + * bank.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1561 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1562 + const char *bank_name = m6809_get_decl_bank (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1563 + if (bank_name != NULL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1564 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1565 + /* Declare __self_bank as a local assembler value that denotes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1566 + * which bank the current function is in. This is required only
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1567 + * when the bank actually changes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1568 + if (strcmp (bank_name, current_bank_name))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1569 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1570 + fprintf (asm_out_file, "__self_bank\t.equ %s\n", bank_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1571 + strcpy (current_bank_name, bank_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1572 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1573 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1574 + /* Declare a global assembler value that denotes which bank the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1575 + * named function is in. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1576 + fprintf (asm_out_file, "__%s_bank\t.gblequ %s\n", name, bank_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1577 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1578 + /* Force the current function into a new area */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1579 + fprintf (asm_out_file, "\t.bank bank_%s (FSFX=_%s)\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1580 + bank_name, bank_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1581 + fprintf (asm_out_file, "\t.area bank_%s (BANK=bank_%s)\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1582 + bank_name, bank_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1583 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1584 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1585 + /* Emit the label for the function's name */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1586 + ASM_OUTPUT_LABEL (asm_out_file, name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1587 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1588 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1589 +#if 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1590 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1591 + * Handle pragmas. Note that only the last branch pragma seen in the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1592 + * source has any affect on code generation.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1593 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1594 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1595 +#define BAD_PRAGMA(msgid, arg) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1596 + do { warning (WARNING_OPT msgid, arg); return -1; } while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1597 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1598 +static int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1599 +pragma_parse (const char *name, tree *sect)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1600 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1601 + tree s, x;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1602 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1603 + if (pragma_lex (&x) != CPP_OPEN_PAREN)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1604 + BAD_PRAGMA ("missing '(' after '#pragma %s' - ignored", name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1605 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1606 + if (pragma_lex (&s) != CPP_STRING)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1607 + BAD_PRAGMA ("missing section name in '#pragma %s' - ignored", name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1608 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1609 + if (pragma_lex (&x) != CPP_CLOSE_PAREN)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1610 + BAD_PRAGMA ("missing ')' for '#pragma %s' - ignored", name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1611 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1612 + if (pragma_lex (&x) != CPP_EOF)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1613 + warning (WARNING_OPT "junk at end of '#pragma %s'", name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1614 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1615 + *sect = s;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1616 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1617 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1618 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1619 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1620 +/*
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1621 + * Handle #pragma section.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1622 + * This is deprecated; code should use __attribute__(section("name"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1623 + * instead.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1624 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1625 +void pragma_section (cpp_reader *pfile ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1626 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1627 + tree sect;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1628 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1629 + if (pragma_parse ("section", &sect))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1630 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1631 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1632 + snprintf (code_section_op, 6+TREE_STRING_LENGTH (sect),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1633 + ".area\t%s", TREE_STRING_POINTER (sect));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1634 + snprintf (data_section_op, 6+TREE_STRING_LENGTH (sect),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1635 + ".area\t%s", TREE_STRING_POINTER (sect));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1636 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1637 + /* Mark a flag that sections have changed. Upon emitting another
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1638 + * declaration, the new .area directive will be written. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1639 + section_changed++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1640 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1641 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1642 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1643 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1644 + * Check a `double' value for validity for a particular machine mode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1645 + * Called by the CHECK_FLOAT_VALUE() machine-dependent macro.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1646 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1647 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1648 +check_float_value (enum machine_mode mode, double *d, int overflow)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1649 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1650 + if (mode == SFmode) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1651 + if (*d > 1.7014117331926443e+38) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1652 + error("magnitude of constant too large for `float'");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1653 + *d = 1.7014117331926443e+38;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1654 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1655 + else if (*d < -1.7014117331926443e+38) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1656 + error("magnitude of constant too large for `float'");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1657 + *d = -1.7014117331926443e+38;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1658 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1659 + else if ((*d > 0) && (*d < 2.9387358770557188e-39)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1660 + warning(WARNING_OPT "`float' constant truncated to zero");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1661 + *d = 0.0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1662 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1663 + else if ((*d < 0) && (*d > -2.9387358770557188e-39)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1664 + warning(WARNING_OPT "`float' constant truncated to zero");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1665 + *d = 0.0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1666 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1667 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1668 + return overflow;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1669 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1670 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1671 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1672 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1673 +/** Declare that the target supports named output sections. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1674 +bool m6809_have_named_section = (bool)1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1675 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1676 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1677 +/** Write to the assembler file a directive to place
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1678 + * subsequent objects to a different section in the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1679 + * object file. ASxxxx uses the "area" directive for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1680 + * this purpose. It does not however support generalized
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1681 + * alignment, and can only place items on an odd/even
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1682 + * boundary. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1683 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1684 +m6809_asm_named_section (
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1685 + const char *name,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1686 + unsigned int flags ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1687 + tree decl)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1688 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1689 + fprintf (asm_out_file, "\t.area\t%s\n", name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1690 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1691 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1692 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1693 +enum reg_class
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1694 +m6809_preferred_reload_class (rtx x, enum reg_class regclass)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1695 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1696 + /* Check cases based on type code of rtx */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1697 + switch (GET_CODE(x))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1698 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1699 + /*
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1700 + * Observation, 2015-07-19, William Astle
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1701 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1702 + * The original comparison for range for 16 bits was wrong, adding 0x80
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1703 + * instead of 0x8000. Replaced both 8 bit and 16 bit comparisions with
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1704 + * a more straight forward range comparison - excessive cleverness isn't
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1705 + * really required here.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1706 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1707 + case CONST_INT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1708 + /* Constants that can fit into 1 byte should be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1709 + * loaded into a Q_REGS reg */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1710 + if ((INTVAL(x) >= -128 && INTVAL(x) <= 127) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1711 +// if (((unsigned) (INTVAL(x) + 0x80) < 0x100) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1712 + (regclass > A_REGS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1713 + return Q_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1714 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1715 + /* 16-bit constants should be loaded into A_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1716 + * when possible. gcc may already require A_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1717 + * or D_REGS for certain types of instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1718 + * This case applies mostly to simple copy operations
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1719 + * to/from memory when any register will do, but
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1720 + * it's best to avoid using D register since it is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1721 + * needed for other things.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1722 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1723 + else if ((INTVAL(x) >= -32768 && INTVAL(x) <= 32767) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1724 +// else if (((unsigned) (INTVAL(x) + 0x80) < 0x10000) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1725 + (regclass > A_REGS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1726 + return A_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1727 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1728 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1729 + case SYMBOL_REF:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1730 + case LABEL_REF:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1731 + /* Addresses should always be loaded into A_REGS */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1732 + if (regclass >= A_REGS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1733 + return (A_REGS);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1734 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1735 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1736 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1737 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1738 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1739 + /* Check cases based on mode of rtx */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1740 + if ((GET_MODE(x) == QImode) && (regclass != A_REGS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1741 + return Q_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1742 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1743 + /* Default: return whatever class reload suggested */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1744 + return regclass;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1745 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1746 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1747 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1748 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1749 + * Check a new declaration for the "section" attribute.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1750 + * If it exists, and the target section is "direct", then mark
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1751 + * the declaration (in RTL) to indicate special treatment.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1752 + * When the variable is referenced later, we test for this flag
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1753 + * and can emit special asm text to force the assembler to use
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1754 + * short instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1755 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1756 +static void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1757 +m6809_encode_section_info (tree decl, rtx rtl, int new_decl_p ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1758 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1759 + tree attr, id;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1760 + const char *name;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1761 + const char *decl_name;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1762 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1763 + /* We only care about variable declarations, not functions */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1764 + if (TREE_CODE (decl) != VAR_DECL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1765 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1766 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1767 + /* For debugging purposes only; grab the decl's name */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1768 + decl_name = IDENTIFIER_POINTER (DECL_NAME (decl));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1769 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1770 + /* Give up if the decl doesn't have any RTL */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1771 + if (!DECL_RTL (decl))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1772 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1773 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1774 + /* See if it has a section attribute */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1775 + attr = lookup_attribute ("section", DECL_ATTRIBUTES (decl));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1776 + if (!attr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1777 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1778 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1779 + /* See if the section attribute has a value */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1780 + id = TREE_VALUE (TREE_VALUE (attr));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1781 + if (!id)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1782 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1783 + name = TREE_STRING_POINTER (id);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1784 + if (!name)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1785 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1786 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1787 + /* See if the value is 'direct'. If so, mark it. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1788 + if (!strcmp (name, "direct"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1789 + SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1790 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1791 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1792 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1793 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1794 + * Output code to perform a complex shift, for which there is no
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1795 + * direct support in the instruction set.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1796 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1797 + * shift1 is an instruction pattern for performing a 1-bit modification.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1798 + * This code wraps that pattern in a loop to perform the shift N times,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1799 + * where N is given by the address register in operands[2].
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1800 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1801 + * To support 16-bit shifts, shift2 can also be provided: it is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1802 + * a second instruction to be included in the loop. 8-bit shift
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1803 + * insns will pass NULL here.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1804 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1805 + * The insn length of shift1/shift2 is assumed to be 1 byte,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1806 + * which works in all of the cases it is needed so far.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1807 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1808 +static void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1809 +m6809_gen_register_shift (
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1810 + rtx *operands,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1811 + const char *shift1,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1812 + const char *shift2 )
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1813 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1814 + char beq_pattern[32];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1815 + char bra_pattern[32];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1816 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1817 + int shiftlen = (shift1 && shift2) ? 2 : 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1818 + int cmplen = (REGNO (operands[2]) == HARD_X_REGNUM) ? 3 : 4;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1819 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1820 + int beq_offset = 2 + shiftlen + 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1821 + int bra_offset = shiftlen + 2 + cmplen + 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1822 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1823 + sprintf (beq_pattern, "beq\t.+%d", beq_offset);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1824 + sprintf (bra_pattern, "bra\t.-%d", bra_offset);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1825 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1826 + output_asm_insn ("pshs\t%2", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1827 + output_asm_insn ("lea%2\t-1,%2", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1828 + output_asm_insn ("cmp%2\t#-1", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1829 + output_asm_insn (beq_pattern, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1830 + if (shift1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1831 + output_asm_insn (shift1, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1832 + if (shift2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1833 + output_asm_insn (shift2, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1834 + output_asm_insn (bra_pattern, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1835 + output_asm_insn ("puls\t%2", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1836 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1837 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1838 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1839 +/** Generate RTL for the upper 8-bits of a 16-bit constant. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1840 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1841 +gen_rtx_const_high (rtx r)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1842 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1843 + unsigned char v = (INTVAL (r) >> 8) & 0xFF;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1844 + signed char s = (signed char)v;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1845 + return gen_int_mode (s, QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1846 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1847 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1848 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1849 +/** Generate RTL for the lower 8-bits of a 16-bit constant. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1850 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1851 +gen_rtx_const_low (rtx r)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1852 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1853 + unsigned char v = INTVAL (r) & 0xFF;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1854 + signed char s = (signed char)v;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1855 + return gen_int_mode (s, QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1856 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1857 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1858 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1859 +/** Generate RTL to allocate/free bytes on the stack.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1860 + * CODE is given as MINUS when allocating and PLUS when freeing,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1861 + * to match the semantics of a downward-growing stack. SIZE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1862 + * is always given as a positive integer.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1863 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1864 +static rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1865 +gen_rtx_stack_adjust (enum rtx_code code, int size)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1866 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1867 + if (size <= 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1868 + return NULL_RTX;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1869 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1870 + if (code == MINUS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1871 + size = -size;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1872 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1873 + return gen_rtx_SET (Pmode, stack_pointer_rtx,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1874 + gen_rtx_PLUS (Pmode, stack_pointer_rtx,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1875 + gen_int_mode (size, HImode)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1876 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1877 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1878 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1879 +/** Generate RTL to push/pop a set of registers. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1880 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1881 +gen_rtx_register_pushpop (int op, int regs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1882 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1883 + rtx nregs = gen_int_mode (regs, QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1884 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1885 + if (op == UNSPEC_PUSH_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1886 + return gen_register_push (nregs);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1887 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1888 + return gen_register_pop (nregs);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1889 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1890 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1891 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1892 +/* Given a register set REGS, where the bit positions correspond to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1893 + * hard register numbers, return another bitmask that represents the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1894 + * order in which those registers would be pushed/popped.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1895 + * Registers that are pushed first have higher bit positions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1896 + * The pop order is just the reverse bitmask.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1897 + * These values are the same as the bitmasks actually used in the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1898 + * machine instructions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1899 +static unsigned int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1900 +register_push_order (int regs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1901 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1902 + unsigned int order = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1903 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1904 + if (REGSET_CONTAINS_P (HARD_PC_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1905 + order |= 0x80;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1906 + if (REGSET_CONTAINS_P (HARD_U_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1907 + order |= 0x40;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1908 + if (REGSET_CONTAINS_P (HARD_Y_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1909 + order |= 0x20;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1910 + if (REGSET_CONTAINS_P (HARD_X_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1911 + order |= 0x10;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1912 + if (REGSET_CONTAINS_P (HARD_DP_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1913 + order |= 0x8;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1914 + if (REGSET_CONTAINS_P (HARD_B_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1915 + order |= 0x4;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1916 + if (REGSET_CONTAINS_P (HARD_A_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1917 + order |= 0x2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1918 + if (REGSET_CONTAINS_P (HARD_CC_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1919 + order |= 0x1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1920 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1921 + if (REGSET_CONTAINS_P (HARD_D_REGNUM, regs))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1922 + order |= (0x4 | 0x2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1923 + return order;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1924 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1925 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1926 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1927 +/* Returns nonzero if two consecutive push or pop instructions,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1928 + * as determined by the OP, can be merged into a single instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1929 + * The first instruction in the sequence pushes/pops REGS1; the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1930 + * second applies to REGS2.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1931 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1932 + * If true, the resulting instruction can use (regs1 | regs2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1933 + * safely.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1934 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1935 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1936 +m6809_can_merge_pushpop_p (int op, int regs1, int regs2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1937 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1938 + /* Register sets must not overlap */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1939 + if (regs1 & regs2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1940 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1941 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1942 + if (op == UNSPEC_PUSH_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1943 + return (register_push_order (regs1) > register_push_order (regs2));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1944 + else if (op == UNSPEC_POP_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1945 + return (register_push_order (regs1) < register_push_order (regs2));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1946 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1947 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1948 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1949 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1950 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1951 +/** Emit instructions for making a library call.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1952 + * MODE is the mode of the operation.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1953 + * NAME is the library function name.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1954 + * OPERANDS is the rtx array provided by the recognizer.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1955 + * COUNT is the number of input operands to the call, and
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1956 + * should be 1 for a unary op or 2 for a binary op.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1957 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1958 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1959 +emit_libcall_insns (enum machine_mode mode,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1960 + const char *name,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1961 + rtx *operands,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1962 + int count)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1963 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1964 + /* Generate an rtx for the call target. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1965 + rtx symbol = gen_rtx_SYMBOL_REF (Pmode, name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1966 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1967 + /* Emit the library call. Slightly different based
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1968 + on the number of operands */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1969 + if (count == 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1970 + emit_library_call (symbol, LCT_NORMAL, mode,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1971 + 2, operands[1], mode, operands[2], mode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1972 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1973 + emit_library_call (symbol, LCT_NORMAL, mode,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1974 + 1, operands[1], mode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1975 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1976 + /* The library call is expected to put its result
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1977 + in LIBCALL_VALUE, so need to copy it into the destination. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1978 + emit_move_insn (operands[0], LIBCALL_VALUE(mode));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1979 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1980 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1981 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1982 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1983 + * A small helper function that writes out a single branch instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1984 + * OPCODE is the short name, e.g. "ble".
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1985 + * OPERANDS has the rtx for the target label.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1986 + * LONG_P is nonzero if we are emitting a long branch, and need to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1987 + * prepend an 'l' to the opcode name.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1988 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1989 +void output_branch_insn1 (const char *opcode, rtx *operands, int long_p)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1990 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1991 + char pattern[64];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1992 + sprintf (pattern, "%s%s\t%%l0", long_p ? "l" : "", opcode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1993 + output_asm_insn (pattern, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1994 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1995 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1996 +/**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1997 + * Output a branch/conditional branch insn of the proper
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1998 + * length. code identifies the particular branch insn.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
1999 + * operands holds the branch target in operands[0].
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2000 + * length says what the size of this insn should be.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2001 + * Based on the length, we know whether it should be a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2002 + * short (8-bit) or long (16-bit) branch.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2003 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2004 +const char *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2005 +output_branch_insn (enum rtx_code code, rtx *operands, int length)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2006 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2007 + int shortform;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2008 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2009 + /* Decide whether or not to use the long or short form.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2010 + * Calculate automatically based on insn lengths. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2011 + shortform = ((length > 2) ? 0 : 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2012 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2013 + /* Determine the proper opcode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2014 + * Use the short (2-byte) opcode if the target is within
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2015 + * reach. Otherwise, use jmp (3-byte opcode), unless
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2016 + * compiling with -fpic, in which case we'll need to use
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2017 + * lbra (4-byte opcode).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2018 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2019 + switch (code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2020 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2021 + case LABEL_REF:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2022 + if (shortform)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2023 + output_branch_insn1 ("bra", operands, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2024 + else if (flag_pic)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2025 + output_branch_insn1 ("bra", operands, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2026 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2027 + output_branch_insn1 ("jmp", operands, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2028 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2029 + case EQ:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2030 + output_branch_insn1 ("beq", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2031 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2032 + case NE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2033 + output_branch_insn1 ("bne", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2034 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2035 + case GT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2036 + output_branch_insn1 ("bgt", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2037 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2038 + case GTU:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2039 + output_branch_insn1 ("bhi", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2040 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2041 + case LT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2042 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2043 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2044 + output_branch_insn1 ("bmi", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2045 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2046 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2047 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2048 + output_branch_insn1 ("blt", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2049 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2050 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2051 + case LTU:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2052 + output_branch_insn1 ("blo", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2053 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2054 + case GE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2055 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2056 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2057 + output_branch_insn1 ("bpl", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2058 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2059 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2060 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2061 + output_branch_insn1 ("bge", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2062 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2063 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2064 + case GEU:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2065 + output_branch_insn1 ("bhs", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2066 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2067 + case LE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2068 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2069 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2070 + output_branch_insn1 ("bmi", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2071 + output_branch_insn1 ("beq", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2072 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2073 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2074 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2075 + output_branch_insn1 ("ble", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2076 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2077 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2078 + case LEU:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2079 + output_branch_insn1 ("bls", operands, !shortform);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2080 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2081 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2082 + abort();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2083 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2084 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2085 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2086 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2087 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2088 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2089 +/** Returns the "cost" of an RTL expression.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2090 + * In general, the expression "COSTS_N_INSNS(1)" is used to represent
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2091 + * the cost of a fast 8-bit arithmetic instruction that operates on
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2092 + * a reg/mem or a reg/immed. Other costs are relative to this.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2093 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2094 + * Notes:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2095 + * - The cost of a REG is always zero; this cannot be changed.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2096 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2097 + * - On the 6809, instructions on two registers will nearly always take
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2098 + * longer than those that operate on a register and a constant/memory,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2099 + * because of the way the instruction set is structured.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2100 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2101 + * TODO: multiply HImode by 2 should be done via shifts, instead of add.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2102 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2103 +static bool
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2104 +m6809_rtx_costs (rtx X, int code, int outer_code ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2105 + int *total, bool speed)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2106 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2107 + int has_const_arg = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2108 + HOST_WIDE_INT const_arg;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2109 + enum machine_mode mode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2110 + int nargs = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2111 + rtx op0, op1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2112 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2113 + /* Data RTXs return a value between 0-3, depending on complexity.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2114 + All of these are less than COSTS_N_INSNS(1). */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2115 + switch (code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2116 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2117 + case CC0:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2118 + case PC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2119 + *total = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2120 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2121 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2122 + case CONST_INT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2123 + if (X == const0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2124 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2125 + *total = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2126 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2127 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2128 + else if ((unsigned) INTVAL (X) < 077)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2129 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2130 + *total = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2131 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2132 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2133 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2134 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2135 + *total = 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2136 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2137 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2138 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2139 + case LABEL_REF: case CONST:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2140 + *total = 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2141 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2142 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2143 + case SYMBOL_REF:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2144 + /* References to memory are made cheaper if they have
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2145 + * the 'direct' mode attribute set */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2146 + *total = (SYMBOL_REF_FLAG (X)) ? 1 : 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2147 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2148 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2149 + case MEM:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2150 + /* See what form of address was given */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2151 + X = XEXP (X, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2152 + switch (GET_CODE (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2153 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2154 + case SYMBOL_REF:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2155 + *total = (SYMBOL_REF_FLAG (X)) ? 1 : 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2156 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2157 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2158 + case CONST_INT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2159 + *total = 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2160 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2161 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2162 + case MEM:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2163 + *total = COSTS_N_INSNS (1) + 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2164 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2165 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2166 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2167 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2168 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2169 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2170 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2171 + case CONST_DOUBLE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2172 + /* TODO : not sure about this value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2173 + *total = 3;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2174 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2175 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2176 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2177 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2178 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2179 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2180 + /* Decode the rtx */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2181 + mode = GET_MODE (X);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2182 + op0 = XEXP (X, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2183 + op1 = XEXP (X, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2184 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2185 + /* We don't implement anything in SImode or greater. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2186 + if (GET_MODE_SIZE (mode) >= GET_MODE_SIZE (SImode))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2187 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2188 + *total = COSTS_N_INSNS (100);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2189 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2190 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2191 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2192 + /* Figure out if there is a constant argument, and its value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2193 + if (GET_RTX_CLASS (code) == RTX_BIN_ARITH
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2194 + || GET_RTX_CLASS (code) == RTX_COMM_ARITH)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2195 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2196 + nargs = 2;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2197 + if (GET_CODE (op1) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2198 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2199 + has_const_arg = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2200 + const_arg = INTVAL (op1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2201 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2202 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2203 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2204 + /* Penalize a reg/reg operation by adding MEMORY_MOVE_COST,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2205 + * Ignore soft registers, since these are really in memory.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2206 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2207 + * TODO: penalize HImode reg/reg for most operations, except maybe
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2208 + * additions since index registers allow for that.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2209 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2210 + * TODO: shifts by constant N do not always require N instructions;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2211 + * some of this can be done cheaper. The number of actual insns can be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2212 + * predicted well.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2213 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2214 + if (nargs == 2 && REAL_REG_P (op0) && REAL_REG_P (op1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2215 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2216 + *total = MEMORY_MOVE_COST (mode, Q_REGS, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2217 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2218 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2219 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2220 + *total = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2221 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2222 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2223 + /* Operator RTXs are counted as COSTS_N_INSNS(N), where N is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2224 + the estimated number of actual machine instructions needed to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2225 + perform the computation. Some small adjustments are made since
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2226 + some "instructions" are more complex than others. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2227 + switch (code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2228 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2229 + case PLUS: case MINUS: case COMPARE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2230 + /* 6809 handles these natively in QImode, and in HImode as long
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2231 + * as operand 1 is constant. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2232 + if (mode == QImode || (mode == HImode && has_const_arg))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2233 + *total += COSTS_N_INSNS (1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2234 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2235 + *total += COSTS_N_INSNS (GET_MODE_SIZE (mode));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2236 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2237 + /* -1, 0, and 1 can be done using inherent instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2238 + * for PLUS and MINUS in QImode, so don't add extra cost. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2239 + if (has_const_arg
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2240 + && (mode == QImode || mode == HImode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2241 + && (const_arg == -1 || const_arg == 0 || const_arg == 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2242 + && (code == PLUS || code == MINUS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2243 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2244 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2245 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2246 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2247 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2248 + case AND: case IOR: case XOR:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2249 + case NEG: case NOT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2250 + /* 6809 handles these natively in QImode, but requires
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2251 + * splitting in HImode. Treat these as 2 insns. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2252 + *total += COSTS_N_INSNS (1) * GET_MODE_SIZE (mode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2253 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2254 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2255 + case ASHIFT: case ASHIFTRT: case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2256 + case ROTATE: case ROTATERT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2257 + /* 6809 can do shift/rotates of a QImode by a constant in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2258 + * 1 insn times the shift count, or in HImode by a constant
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2259 + * by splitting to 2 insns.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2260 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2261 + * Shift by a nonconstant will take significantly longer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2262 + * than any of these. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2263 + if (has_const_arg)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2264 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2265 + const_arg %= (GET_MODE_SIZE (mode) * 8);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2266 + if (const_arg == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2267 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2268 + *total += COSTS_N_INSNS(1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2269 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2270 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2271 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2272 + /* HImode shifts greater than 8 get optimized due
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2273 + * to register transfer from b to a; this cuts down the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2274 + * cost. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2275 + if (const_arg >= 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2276 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2277 + *total += COSTS_N_INSNS (1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2278 + const_arg -= 8;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2279 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2280 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2281 + /* The computed cost is 'const_arg' 1-bit shifts, doubled
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2282 + if in HImode, minus the cost of the constant itself which
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2283 + will be added in later but really shouldn't be. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2284 + *total += COSTS_N_INSNS (const_arg) * GET_MODE_SIZE (mode) - 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2285 + return true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2286 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2287 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2288 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2289 + /* It may take up to 7 iterations of about 6-7 real
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2290 + * instructions, so make this expensive. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2291 + *total += COSTS_N_INSNS (50);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2292 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2293 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2294 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2295 + case MULT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2296 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2297 + /* Multiply is cheap when both arguments are 8-bits. They
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2298 + could be QImode, or QImode widened to HImode, or a constant
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2299 + that fits into 8-bits. As long as both operands qualify,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2300 + we can use a single mul instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2301 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2302 + Assume that fast multiply can be used, and change this if we find
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2303 + differently... */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2304 + int ok_for_qihi3 = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2305 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2306 + /* Check the first operand */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2307 + switch (GET_MODE (op0))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2308 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2309 + case QImode:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2310 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2311 + case HImode:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2312 + if (GET_CODE (op0) != SIGN_EXTEND && GET_CODE (op0) != ZERO_EXTEND)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2313 + ok_for_qihi3 = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2314 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2315 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2316 + ok_for_qihi3 = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2317 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2318 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2319 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2320 + /* Likewise, check the second operand. This is where constants may appear. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2321 + switch (GET_MODE (op1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2322 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2323 + case QImode:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2324 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2325 + case HImode:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2326 + if (GET_CODE (op1) != SIGN_EXTEND && GET_CODE (op1) != ZERO_EXTEND)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2327 + ok_for_qihi3 = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2328 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2329 + case VOIDmode:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2330 + if (!CONST_OK_FOR_LETTER_P (const_arg, 'K'))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2331 + ok_for_qihi3 = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2332 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2333 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2334 + ok_for_qihi3 = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2335 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2336 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2337 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2338 + /* Fast multiply takes about 4 times as many cycles as a normal
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2339 + arithmetic operation. Otherwise, it will take an expensive libcall. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2340 + if (ok_for_qihi3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2341 + *total += COSTS_N_INSNS (4);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2342 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2343 + *total = COSTS_N_INSNS (50);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2344 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2345 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2346 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2347 + case DIV: case UDIV: case MOD: case UMOD:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2348 + /* These all require more expensive libcalls. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2349 + *total += COSTS_N_INSNS (100);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2350 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2351 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2352 + /* TODO : TRUNCATE, SIGN_EXTEND, and ZERO_EXTEND */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2353 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2354 + /* These can normally be done with autoincrement, etc., so
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2355 + * don't charge for them. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2356 + case PRE_DEC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2357 + case PRE_INC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2358 + case POST_DEC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2359 + case POST_INC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2360 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2361 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2362 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2363 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2364 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2365 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2366 + /* Always return false, and let the caller gather the costs
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2367 + * of the operands */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2368 + return false;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2369 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2370 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2371 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2372 +static tree
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2373 +m6809_handle_fntype_attribute (tree *node, tree name,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2374 + tree args ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2375 + int flags ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2376 + bool *no_add_attrs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2377 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2378 + if (TREE_CODE (*node) != FUNCTION_TYPE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2379 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2380 + warning (WARNING_OPT "'%s' only valid for functions",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2381 + IDENTIFIER_POINTER (name));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2382 + *no_add_attrs = TRUE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2383 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2384 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2385 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2386 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2387 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2388 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2389 +static tree
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2390 +m6809_handle_data_type_attribute (tree *node ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2391 + tree name ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2392 + tree args ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2393 + int flags ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2394 + bool *no_add_attrs ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2395 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2396 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2397 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2398 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2399 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2400 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2401 +static tree
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2402 +m6809_handle_default_attribute (tree *node ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2403 + tree name ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2404 + tree args ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2405 + int flags ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2406 + bool *no_add_attrs ATTRIBUTE_UNUSED )
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2407 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2408 + return NULL_TREE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2409 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2410 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2411 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2412 +/* Table of valid machine attributes */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2413 +const struct attribute_spec m6809_attribute_table[] = { /*
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2414 +{ name, min, max, decl, type, fntype, handler } */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2415 +{ "interrupt", 0, 0, false, true, true, m6809_handle_fntype_attribute },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2416 +{ "naked", 0, 0, false, true, true, m6809_handle_fntype_attribute },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2417 +{ "far", 0, 1, false, true, true, m6809_handle_fntype_attribute },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2418 +{ "bank", 0, 1, true, false, false, m6809_handle_default_attribute },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2419 +{ "boolean", 0, 0, false, true, false, m6809_handle_data_type_attribute },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2420 +{ NULL, 0, 0, false, true, false, NULL },
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2421 +};
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2422 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2423 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2424 +/** Initialize builtin routines for the 6809. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2425 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2426 +m6809_init_builtins (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2427 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2428 + /* Create type trees for each function signature required.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2429 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2430 + * void_ftype_void = void f(void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2431 + * void_ftype_uchar = void f(unsigned char)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2432 + * uchar_ftype_uchar2 = unsigned char f (unsigned char, unsigned char)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2433 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2434 + tree void_ftype_void =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2435 + build_function_type (void_type_node, void_list_node);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2436 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2437 + tree void_ftype_uchar =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2438 + build_function_type (void_type_node,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2439 + tree_cons (NULL_TREE, unsigned_char_type_node, void_list_node));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2440 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2441 + tree uchar_ftype_uchar2 =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2442 + build_function_type (unsigned_char_type_node,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2443 + tree_cons (NULL_TREE, unsigned_char_type_node,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2444 + tree_cons (NULL_TREE, unsigned_char_type_node, void_list_node)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2445 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2446 + /* Register each builtin function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2447 + add_builtin_function ("__builtin_swi", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2448 + M6809_SWI, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2449 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2450 + add_builtin_function ("__builtin_swi2", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2451 + M6809_SWI2, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2452 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2453 + add_builtin_function ("__builtin_swi3", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2454 + M6809_SWI3, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2455 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2456 + add_builtin_function ("__builtin_cwai", void_ftype_uchar,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2457 + M6809_CWAI, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2458 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2459 + add_builtin_function ("__builtin_sync", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2460 + M6809_SYNC, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2461 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2462 + add_builtin_function ("__builtin_nop", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2463 + M6809_NOP, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2464 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2465 + add_builtin_function ("__builtin_blockage", void_ftype_void,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2466 + M6809_BLOCKAGE, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2467 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2468 + add_builtin_function ("__builtin_add_decimal", uchar_ftype_uchar2,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2469 + M6809_ADD_DECIMAL, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2470 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2471 + add_builtin_function ("__builtin_add_carry", uchar_ftype_uchar2,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2472 + M6809_ADD_CARRY, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2473 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2474 + add_builtin_function ("__builtin_sub_carry", uchar_ftype_uchar2,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2475 + M6809_SUB_CARRY, BUILT_IN_MD, NULL, NULL_TREE);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2476 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2477 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2478 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2479 +/** Used by m6809_expand_builtin, given a tree ARGLIST which
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2480 + * refers to the operands of a builtin call, return an rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2481 + * that represents the nth operand, as denoted by OPNUM, which
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2482 + * is a zero-based integer. MODE gives the expected mode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2483 + * of the operand.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2484 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2485 + * This rtx is suitable for use in the emitted RTL for the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2486 + * builtin instruction. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2487 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2488 +m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2489 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2490 + tree arg;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2491 + rtx r;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2492 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2493 + arg = CALL_EXPR_ARG (arglist, opnum);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2494 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2495 + /* Convert the tree to RTL */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2496 + r = expand_expr (arg, NULL_RTX, mode, EXPAND_NORMAL);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2497 + if (r == NULL_RTX)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2498 + return NULL_RTX;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2499 + return r;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2500 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2501 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2502 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2503 +/** Expand a builtin that was registered in init_builtins into
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2504 + * RTL. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2505 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2506 +m6809_expand_builtin (tree exp,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2507 + rtx target,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2508 + rtx subtarget ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2509 + enum machine_mode mode ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2510 + int ignore ATTRIBUTE_UNUSED )
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2511 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2512 + tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2513 + tree arglist = exp;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2514 + unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2515 + rtx r0, r1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2516 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2517 + switch (fcode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2518 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2519 + case M6809_SWI:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2520 + r0 = gen_rtx_CONST_INT (VOIDmode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2521 + emit_insn (target = gen_m6809_swi (r0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2522 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2523 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2524 + case M6809_SWI2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2525 + r0 = gen_rtx_CONST_INT (VOIDmode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2526 + emit_insn (target = gen_m6809_swi (r0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2527 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2528 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2529 + case M6809_SWI3:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2530 + r0 = gen_rtx_CONST_INT (VOIDmode, 3);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2531 + emit_insn (target = gen_m6809_swi (r0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2532 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2533 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2534 + case M6809_CWAI:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2535 + r0 = m6809_builtin_operand (arglist, QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2536 + emit_insn (target = gen_m6809_cwai (r0));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2537 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2538 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2539 + case M6809_SYNC:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2540 + emit_insn (target = gen_m6809_sync ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2541 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2542 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2543 + case M6809_ADD_CARRY:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2544 + r0 = m6809_builtin_operand (arglist, QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2545 + r1 = m6809_builtin_operand (arglist, QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2546 + if (!target)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2547 + target = gen_reg_rtx (QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2548 + emit_insn (gen_addqi3_carry (target, r0, r1));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2549 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2550 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2551 + case M6809_SUB_CARRY:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2552 + r0 = m6809_builtin_operand (arglist, QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2553 + r1 = m6809_builtin_operand (arglist, QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2554 + if (!target)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2555 + target = gen_reg_rtx (QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2556 + emit_insn (gen_subqi3_carry (target, r0, r1));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2557 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2558 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2559 + case M6809_NOP:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2560 + emit_insn (target = gen_nop ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2561 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2562 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2563 + case M6809_BLOCKAGE:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2564 + emit_insn (target = gen_blockage ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2565 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2566 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2567 + case M6809_ADD_DECIMAL:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2568 + r0 = m6809_builtin_operand (arglist, QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2569 + r1 = m6809_builtin_operand (arglist, QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2570 + if (!target)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2571 + target = gen_reg_rtx (QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2572 + emit_insn (gen_addqi3_decimal (target, r0, r1));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2573 + return target;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2574 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2575 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2576 + warning (WARNING_OPT "unknown builtin expansion ignored");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2577 + return NULL_RTX;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2578 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2579 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2580 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2581 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2582 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2583 +/* Returns nonzero if 'x' represents a function that was declared
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2584 + * as __noreturn__. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2585 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2586 +noreturn_functionp (rtx x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2587 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2588 + tree decl = call_target_decl (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2589 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2590 + if (decl == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2591 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2592 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2593 + return TREE_THIS_VOLATILE (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2594 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2595 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2596 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2597 +const char *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2598 +far_function_type_p (tree type)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2599 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2600 + tree attr;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2601 + const char *page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2602 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2603 + /* Return whether or not this decl has the far attribute */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2604 + attr = lookup_attribute ("far", TYPE_ATTRIBUTES (type));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2605 + if (attr == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2606 + return NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2607 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2608 + /* If it is far, check for a value */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2609 + attr = TREE_VALUE (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2610 + if (attr == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2611 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2612 + warning (WARNING_OPT "far code page not specified, using local value");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2613 + return far_code_page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2614 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2615 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2616 + /* We have a TREE_LIST of attribute values, get the first one.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2617 + * It should be an INTEGER_CST. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2618 + attr = TREE_VALUE (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2619 + page = TREE_STRING_POINTER (attr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2620 + return page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2621 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2622 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2623 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2624 +/* For a far function, returns the identifier that states which page
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2625 + * it resides in. Otherwise, returns NULL for ordinary functions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2626 +const char *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2627 +far_functionp (rtx x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2628 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2629 + tree decl, decl_type;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2630 + const char *page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2631 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2632 + /* Find the FUNCTION_DECL corresponding to the rtx being called. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2633 + decl = call_target_decl (x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2634 + if (decl == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2635 + return NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2636 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2637 + /* See if the function has the new 'banked' attribute. These
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2638 + * are numeric instead of text */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2639 + page = m6809_get_decl_bank (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2640 + if (page)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2641 + return page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2642 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2643 + /* No, lookup the type of the function and see if the type
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2644 + * specifies far or not. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2645 + decl_type = TREE_TYPE (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2646 + if (decl_type == NULL_TREE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2647 + return NULL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2648 + return far_function_type_p (decl_type);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2649 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2650 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2651 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2652 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2653 +/** Outputs the assembly language for a far call. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2654 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2655 +output_far_call_insn (rtx *operands, int has_return)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2656 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2657 + static char page_data[64];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2658 + const char *called_page;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2659 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2660 + /* The logic is the same for functions whether or not there
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2661 + * is a return value. Skip over the return value in this
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2662 + * case, so that the call location is always operands[0]. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2663 + if (has_return)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2664 + operands++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2665 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2666 + /* Get the name of the page being called */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2667 + called_page = far_functionp (operands[0]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2668 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2669 +#if 0 /* TODO : broken logic */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2670 + /* See if the called page name is a 'bank' */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2671 + if (isdigit (*called_page))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2672 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2673 + /* New style banking */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2674 + if (!strcmp (called_page, current_bank_name))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2675 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2676 + /* Same page */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2677 + output_asm_insn ("jsr\t%0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2678 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2679 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2680 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2681 + /* Different page */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2682 + output_asm_insn ("jsr\t__far_call_handler\t;new style", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2683 + output_asm_insn ("\t.dw\t%0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2684 + sprintf (page_data, "\t.db\t%s", called_page);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2685 + output_asm_insn (page_data, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2686 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2687 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2688 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2689 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2690 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2691 + /* Are we calling a different page than we are running in? */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2692 + if (!strcmp (called_page, far_code_page))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2693 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2694 + /* Same page : no need to execute a far call */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2695 + if (flag_pic)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2696 + output_asm_insn ("lbsr\t%C0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2697 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2698 + output_asm_insn ("jsr\t%0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2699 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2700 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2701 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2702 + /* Different page : need to emit far call thunk */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2703 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2704 + /* First output a call to the thunk for making far calls. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2705 + if (flag_pic)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2706 + output_asm_insn ("lbsr\t__far_call_handler", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2707 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2708 + output_asm_insn ("jsr\t__far_call_handler\t;old style", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2709 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2710 + /* Now output the name of the call site */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2711 + output_asm_insn ("\t.dw\t%C0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2712 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2713 + /* Finally output the page number */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2714 + sprintf (page_data, "\t.db\t%s", far_functionp (operands[0]));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2715 + output_asm_insn (page_data, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2716 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2717 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2718 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2719 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2720 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2721 +m6809_init_cumulative_args (CUMULATIVE_ARGS cum ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2722 + tree fntype,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2723 + rtx libname ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2724 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2725 + cum = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2726 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2727 + /* For far functions, the current implementation does not allow for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2728 + * stack parameters. So note whenever the called function is far
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2729 + * and in a different page than the current one; such a function
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2730 + * should give an error if a stack parameter is generated. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2731 + if (fntype)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2732 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2733 + const char *called_page = far_function_type_p (fntype);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2734 + if (called_page && strcmp (called_page, far_code_page) && !TARGET_FAR_STACK_PARAM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2735 + cum |= CUM_STACK_INVALID;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2736 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2737 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2738 + if (fntype && TYPE_ARG_TYPES (fntype) != 0 &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2739 + (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2740 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2741 + /* has variable arguments, cannot use registers */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2742 + cum |= (CUM_X_MASK | CUM_B_MASK | CUM_STACK_ONLY);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2743 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2744 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2745 + if (m6809_abi_version == M6809_ABI_VERSION_STACK)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2746 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2747 + /* cannot use registers ; only use the stack */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2748 + cum |= (CUM_STACK_ONLY | CUM_X_MASK | CUM_B_MASK);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2749 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2750 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2751 + return cum;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2752 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2753 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2754 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2755 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2756 +m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2757 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2758 + if (*cump & CUM_STACK_INVALID)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2759 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2760 + *cump &= ~CUM_STACK_INVALID;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2761 + error ("far function needs stack, will not work");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2762 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2763 + return NULL_RTX;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2764 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2765 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2766 +void m6809_asm_trampoline_template(FILE *f)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2767 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2768 + fprintf(f, "ldy #0000\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2769 + fprintf(f, "jmp 0x0000\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2770 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2771 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2772 +/*
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2773 + * Trampoline output:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2774 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2775 + * ldu #&cxt 4 bytes --LDY- ?? ??
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2776 + * jmp fnaddr 3 bytes JMP ?? ??
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2777 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2778 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2779 +m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2780 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2781 + rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2782 + /* TODO - optimize by generating the entire trampoline code here,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2783 + * and removing the template altogether, since there are only two
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2784 + * bytes there that matter. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2785 + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2786 + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 5)), fnaddr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2787 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2788 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2789 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2790 +/** Echo the version of the compiler and the name of the source file
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2791 + * at the beginning of each assembler output file. asm_out_file
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2792 + * is a global FILE * pointing to the output stream. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2793 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2794 +m6809_asm_file_start (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2795 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2796 + const char *module_name;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2797 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2798 + fprintf (asm_out_file, "\n;;; gcc for m6809 : %s %s\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2799 + __DATE__, __TIME__);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2800 + fprintf (asm_out_file, ";;; %s\n", version_string);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2801 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2802 + fprintf (asm_out_file, ";;; ABI version %d\n", m6809_abi_version);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2803 + fprintf (asm_out_file, ";;; %s\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2804 + (TARGET_BYTE_INT ? "-mint8" : "-mint16"));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2805 + if (TARGET_EXPERIMENT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2806 + fprintf (asm_out_file, ";;; -mexperiment\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2807 + if (TARGET_WPC)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2808 + fprintf (asm_out_file, ";;; -mwpc\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2809 + if (TARGET_6309)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2810 + fprintf (asm_out_file, ";;; -m6309\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2811 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2812 + /* Print the name of the module, which is taken as the base name
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2813 + * of the input file.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2814 + * See the 'User-Defined Symbols' section of the assembler
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2815 + * documentation for the rules on valid symbols.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2816 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2817 + module_name = lbasename (main_input_filename);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2818 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2819 + fprintf (asm_out_file, "\t.module\t");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2820 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2821 + if (*module_name >= '0' && *module_name <= '9')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2822 + fprintf (asm_out_file, "_");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2823 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2824 + while (*module_name)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2825 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2826 + if ((*module_name >= '0' && *module_name <= '9')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2827 + || (*module_name >= 'A' && *module_name <= 'Z')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2828 + || (*module_name >= 'a' && *module_name <= 'z')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2829 + || *module_name == '$'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2830 + || *module_name == '.'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2831 + || *module_name == '_')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2832 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2833 + fprintf (asm_out_file, "%c", *module_name);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2834 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2835 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2836 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2837 + fprintf (asm_out_file, "_");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2838 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2839 + module_name++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2840 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2841 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2842 + fprintf (asm_out_file, "\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2843 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2844 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2845 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2846 +/** Returns true if prologue/epilogue code is required for the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2847 + * current function being compiled.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2848 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2849 + * This is just the inverse of whether the function is declared as
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2850 + * 'naked'.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2851 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2852 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2853 +prologue_epilogue_required (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2854 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2855 + return !m6809_current_function_has_type_attr_p ("naked")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2856 + && !m6809_current_function_has_type_attr_p ("noreturn");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2857 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2858 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2859 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2860 +/** Expand RTL for function entry */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2861 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2862 +emit_prologue_insns (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2863 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2864 + rtx insn;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2865 + unsigned int live_regs = m6809_get_live_regs ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2866 + unsigned int frame_size = get_frame_size ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2867 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2868 + /* Save all registers used, including the frame pointer */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2869 + if (live_regs && !m6809_current_function_has_type_attr_p ("interrupt"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2870 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2871 + insn = emit_insn (
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2872 + gen_rtx_register_pushpop (UNSPEC_PUSH_RS, live_regs));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2873 + RTX_FRAME_RELATED_P (insn) = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2874 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2875 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2876 + /* Allocate space for local variables */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2877 + if (frame_size != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2878 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2879 + insn = emit_insn (gen_rtx_stack_adjust (MINUS, frame_size));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2880 + RTX_FRAME_RELATED_P (insn) = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2881 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2882 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2883 + /* Set the frame pointer if it is needed */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2884 + if (frame_pointer_needed)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2885 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2886 + insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2887 + RTX_FRAME_RELATED_P (insn) = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2888 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2889 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2890 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2891 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2892 +/** Expand RTL for function exit */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2893 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2894 +emit_epilogue_insns (bool sibcall_p)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2895 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2896 + unsigned int live_regs = m6809_get_live_regs ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2897 + unsigned int frame_size = get_frame_size ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2898 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2899 + if (frame_size != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2900 + emit_insn (gen_rtx_stack_adjust (PLUS, frame_size));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2901 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2902 + if (sibcall_p)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2903 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2904 + if (live_regs)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2905 + emit_insn (gen_rtx_register_pushpop (UNSPEC_POP_RS, live_regs));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2906 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2907 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2908 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2909 + if (live_regs && !m6809_current_function_has_type_attr_p ("interrupt"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2910 + emit_insn (
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2911 + gen_rtx_register_pushpop (UNSPEC_POP_RS, PC_REGBIT | live_regs));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2912 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2913 + if (m6809_current_function_has_type_attr_p ("interrupt"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2914 + emit_jump_insn (gen_return_rti ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2915 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2916 + emit_jump_insn (gen_return_rts ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2917 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2918 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2919 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2920 +#if 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2921 +/** Predefine some preprocessor names according to the currently
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2922 + * selected compiler options */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2923 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2924 +m6809_cpu_cpp_builtins (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2925 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2926 + if (TARGET_6309)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2927 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2928 + builtin_define_std ("__M6309__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2929 + builtin_define_std ("__m6309__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2930 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2931 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2932 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2933 + builtin_define_std ("__M6809__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2934 + builtin_define_std ("__m6809__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2935 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2936 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2937 + if (TARGET_BYTE_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2938 + builtin_define_std ("__int8__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2939 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2940 + builtin_define_std ("__int16__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2941 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2942 + switch (m6809_abi_version)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2943 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2944 + case M6809_ABI_VERSION_STACK:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2945 + builtin_define_std ("__regargs__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2946 + builtin_define_std ("__ABI_STACK__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2947 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2948 + case M6809_ABI_VERSION_REGS:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2949 + builtin_define_std ("__ABI_REGS__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2950 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2951 + case M6809_ABI_VERSION_BX:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2952 + builtin_define_std ("__ABI_BX__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2953 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2954 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2955 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2956 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2957 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2958 + if (TARGET_WPC)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2959 + builtin_define_std ("__WPC__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2960 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2961 + if (TARGET_DRET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2962 + builtin_define_std ("__DRET__");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2963 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2964 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2965 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2966 +#define MAX_ASM_ASCII_STRING 48
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2967 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2968 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2969 +m6809_output_ascii (FILE *fp, const char *str, unsigned long size)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2970 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2971 + unsigned long i;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2972 + bool use_ascii = true;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2973 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2974 + /* If the size is too large, then break this up into multiple
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2975 + outputs. The assembler can only output roughly 48 bytes at a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2976 + time. Note that if there are lots of escape sequences in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2977 + the string, this may fail. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2978 + if (size > MAX_ASM_ASCII_STRING)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2979 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2980 + m6809_output_ascii (fp, str, MAX_ASM_ASCII_STRING);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2981 + m6809_output_ascii (fp, str + MAX_ASM_ASCII_STRING,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2982 + size - MAX_ASM_ASCII_STRING);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2983 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2984 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2985 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2986 + /* Check for 8-bit codes, which cannot be embedded in an .ascii */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2987 + for (i = 0; i < size; i++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2988 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2989 + int c = str[i] & 0377;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2990 + if (c >= 0x80)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2991 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2992 + use_ascii = false;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2993 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2994 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2995 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2996 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2997 + if (use_ascii)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2998 + fprintf (fp, "\t.ascii \"");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
2999 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3000 + for (i = 0; i < size; i++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3001 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3002 + int c = str[i] & 0377;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3003 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3004 + if (use_ascii)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3005 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3006 + /* Just output the plain character if it is printable,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3007 + otherwise output the escape code for the character.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3008 + The assembler recognizes the same C-style octal escape sequences,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3009 + except that it only supports 7-bit codes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3010 + if (c >= ' ' && c < 0177 && c != '\\' && c != '"')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3011 + putc (c, fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3012 + else switch (c)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3013 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3014 + case '\n':
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3015 +#ifndef TARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3016 + fputs ("\\n", fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3017 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3018 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3019 + /* On the CoCo, we fallthrough and treat '\n' like '\r'. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3020 + case '\r':
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3021 + fputs ("\\r", fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3022 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3023 + case '\t':
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3024 + fputs ("\\t", fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3025 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3026 + case '\f':
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3027 + fputs ("\\f", fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3028 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3029 + case 0:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3030 + fputs ("\\0", fp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3031 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3032 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3033 + fprintf (fp, "\\%03o", c);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3034 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3035 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3036 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3037 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3038 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3039 + fprintf (fp, "\t.byte\t0x%02X\n", c);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3040 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3041 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3042 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3043 + if (use_ascii)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3044 + fprintf (fp, "\"\n");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3045 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3046 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3047 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3048 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3049 +m6809_output_quoted_string (FILE *asm_file, const char *string)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3050 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3051 + char c;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3052 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3053 + if (strlen (string) > MAX_ASM_ASCII_STRING)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3054 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3055 + /* The string length is too large. We'll have to truncate it.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3056 + This is only called from debugging functions, so it's usually
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3057 + not critical. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3058 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3059 + char truncated_string[MAX_ASM_ASCII_STRING+1];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3060 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3061 + /* Copy as many characters as we can. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3062 + strncpy (truncated_string, string, MAX_ASM_ASCII_STRING);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3063 + truncated_string[MAX_ASM_ASCII_STRING] = '\0';
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3064 + string = truncated_string;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3065 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3066 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3067 + /* Copied from toplev.c */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3068 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3069 + putc ('\"', asm_file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3070 + while ((c = *string++) != 0) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3071 + if (ISPRINT (c)) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3072 + if (c == '\"' || c == '\\')
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3073 + putc ('\\', asm_file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3074 + putc (c, asm_file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3075 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3076 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3077 + fprintf (asm_file, "\\%03o", (unsigned char) c);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3078 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3079 + putc ('\"', asm_file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3080 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3081 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3082 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3083 +/** Output the assembly code for a shift instruction where the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3084 + * shift count is not constant. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3085 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3086 +m6809_output_shift_insn (int rtx_code, rtx *operands)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3087 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3088 + struct shift_opcode *op;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3089 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3090 + if (GET_CODE (operands[2]) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3091 + abort ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3092 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3093 + if (optimize_size && GET_MODE (operands[0]) == HImode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3094 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3095 + switch (rtx_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3096 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3097 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3098 + output_asm_insn ("jsr\t_ashlhi3", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3099 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3100 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3101 + output_asm_insn ("jsr\t_ashrhi3", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3102 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3103 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3104 + output_asm_insn ("jsr\t_lshrhi3", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3105 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3106 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3107 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3108 + else if (GET_MODE (operands[0]) == HImode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3109 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3110 + switch (rtx_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3111 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3112 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3113 + m6809_gen_register_shift (operands, "aslb", "rola");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3114 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3115 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3116 + m6809_gen_register_shift (operands, "asra", "rorb");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3117 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3118 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3119 + m6809_gen_register_shift (operands, "lsra", "rorb");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3120 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3121 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3122 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3123 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3124 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3125 + switch (rtx_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3126 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3127 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3128 + m6809_gen_register_shift (operands, "aslb", NULL);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3129 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3130 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3131 + m6809_gen_register_shift (operands, "asrb", NULL);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3132 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3133 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3134 + m6809_gen_register_shift (operands, "lsrb", NULL);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3135 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3136 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3137 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3138 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3139 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3140 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3141 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3142 +m6809_emit_move_insn (rtx dst, rtx src)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3143 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3144 + emit_insn (gen_rtx_SET (VOIDmode, dst, src));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3145 + if (ACC_A_REG_P (dst))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3146 + emit_insn (gen_rtx_USE (VOIDmode, dst));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3147 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3148 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3149 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3150 +/** Split a complex shift instruction into multiple CPU
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3151 + * shift instructions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3152 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3153 +m6809_split_shift (enum rtx_code code, rtx *operands)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3154 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3155 + enum machine_mode mode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3156 + int count;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3157 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3158 + mode = GET_MODE (operands[0]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3159 + count = INTVAL (operands[2]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3160 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3161 + /* Handle a shift count outside the range of 0 .. N-1, where
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3162 + * N is the mode size in bits. We normalize the count, and
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3163 + * for negative counts we also invert the direction of the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3164 + * shift. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3165 + if ((count < 0) || (count >= 8 * GET_MODE_SIZE (mode)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3166 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3167 + if (count < 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3168 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3169 + count = -count;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3170 + code = (code == ASHIFT) ? ASHIFTRT : ASHIFT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3171 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3172 + count %= (8 * GET_MODE_SIZE (mode));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3173 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3174 + gen_rtx_fmt_ee (code, mode, operands[1],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3175 + gen_rtx_CONST_INT (VOIDmode, count)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3176 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3177 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3178 + /* Handle shift by zero explicitly as a no-op. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3179 + if (count == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3180 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3181 + emit_insn (gen_nop ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3182 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3183 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3184 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3185 + /* Decompose the shift by a constant N > 8 into two
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3186 + * shifts, first by 8 and then by N-8.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3187 + * This "speeds up" the process for large shifts that would be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3188 + * handled below, but allows for some optimization.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3189 + * In some cases shift by 8 can be implemented fast. If an
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3190 + * instruction to shift by 8 is defined, it will be used here;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3191 + * otherwise it will be further decomposed as below. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3192 + if (mode == HImode && count > 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3193 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3194 + rtx output = operands[0];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3195 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3196 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3197 + gen_rtx_fmt_ee (code, mode, operands[1],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3198 + gen_rtx_CONST_INT (VOIDmode, 8)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3199 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3200 + /* Unsigned shifts always produce a zero in either the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3201 + * upper or lower half of the output; then, that part
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3202 + * does not need to be shifted anymore. We modify the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3203 + * output and the subsequent instructions to operate in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3204 + * QImode only on the relevant part. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3205 + if (REG_P (output))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3206 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3207 + if (code == ASHIFT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3208 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3209 + output = gen_rtx_REG (QImode, HARD_A_REGNUM);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3210 + mode = QImode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3211 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3212 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3213 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3214 + output = gen_rtx_REG (QImode, HARD_D_REGNUM);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3215 + mode = QImode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3216 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3217 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3218 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3219 + m6809_emit_move_insn (output,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3220 + gen_rtx_fmt_ee (code, mode, copy_rtx (output),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3221 + gen_rtx_CONST_INT (VOIDmode, count-8)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3222 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3223 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3224 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3225 + /* Rewrite the unsigned shift of an 8-bit register by a large constant N
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3226 + * (near to the maximum of 8) as a rotate and mask. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3227 + if (mode == QImode && REG_P (operands[0]) && count >= ((code == ASHIFTRT) ? 7 : 6))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3228 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3229 + unsigned int mask;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3230 + unsigned int was_signed = (code == ASHIFTRT);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3231 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3232 + code = (code == ASHIFT) ? ROTATERT : ROTATE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3233 + if (code == ROTATE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3234 + mask = (count == 6) ? 0x03 : 0x01;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3235 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3236 + mask = (count == 6) ? 0xC0 - 0x100 : 0x80 - 0x100;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3237 + count = 9 - count;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3238 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3239 + do {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3240 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3241 + gen_rtx_fmt_ee (code, QImode, operands[1], const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3242 + } while (--count != 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3243 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3244 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3245 + gen_rtx_fmt_ee (AND, QImode, operands[1],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3246 + gen_rtx_CONST_INT (VOIDmode, mask)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3247 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3248 + if (was_signed)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3249 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3250 + emit_insn (gen_negqi2 (operands[0], copy_rtx (operands[0])));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3251 + if (ACC_A_REG_P (operands[0]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3252 + emit_insn (gen_rtx_USE (VOIDmode, operands[0]));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3253 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3254 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3255 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3256 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3257 + /* Decompose the shift by any constant N > 1 into a sequence
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3258 + * of N shifts.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3259 + * This is done recursively, by creating a shift by 1 and a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3260 + * shift by N-1, as long as N>1. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3261 + if (count > 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3262 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3263 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3264 + gen_rtx_fmt_ee (code, mode, operands[1], const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3265 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3266 + m6809_emit_move_insn (operands[0],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3267 + gen_rtx_fmt_ee (code, mode, operands[1],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3268 + gen_rtx_CONST_INT (VOIDmode, count-1)));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3269 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3270 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3271 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3272 + /* Decompose the single shift of a 16-bit quantity into two
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3273 + * CPU instructions, one for each 8-bit half.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3274 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3275 + if (mode == HImode && count == 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3276 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3277 + rtx first, second;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3278 + enum rtx_code rotate_code;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3279 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3280 + rotate_code = (code == ASHIFT) ? ROTATE : ROTATERT;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3281 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3282 + /* Split the operand into two 8-bit entities.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3283 + * FIRST is the one that will get shifted via a regular CPU
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3284 + * instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3285 + * SECOND is the one that will have the result of the first shift
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3286 + * rotated in.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3287 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3288 + * We initialize first and second as if we are doing a left shift,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3289 + * then swap the operands if it's a right shift.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3290 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3291 + if (REG_P (operands[0]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3292 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3293 + first = gen_rtx_REG (QImode, HARD_D_REGNUM); /* HARD_B_REGNUM? */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3294 + second = gen_rtx_REG (QImode, HARD_A_REGNUM);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3295 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3296 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3297 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3298 + first = adjust_address (operands[0], QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3299 + second = adjust_address (operands[0], QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3300 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3301 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3302 + if (rotate_code == ROTATERT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3303 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3304 + rtx tmp; tmp = first; first = second; second = tmp;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3305 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3306 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3307 + /* Decompose into a shift and a rotate instruction. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3308 + m6809_emit_move_insn (first,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3309 + gen_rtx_fmt_ee (code, QImode, copy_rtx (first), const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3310 + m6809_emit_move_insn (second,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3311 + gen_rtx_fmt_ee (rotate_code, QImode, copy_rtx (second), const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3312 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3313 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3314 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3315 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3316 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3317 +/** Adjust register usage based on compile-time flags. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3318 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3319 +m6809_conditional_register_usage (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3320 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3321 + unsigned int soft_regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3322 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3323 +#ifdef CONFIG_SOFT_REGS_ALWAYS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3324 + m6809_soft_regs = CONFIG_SOFT_REGS_ALWAYS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3325 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3326 + if (!m6809_soft_reg_count)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3327 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3328 + m6809_soft_regs = atoi (m6809_soft_reg_count);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3329 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3330 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3331 + if (m6809_soft_regs == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3332 + return;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3333 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3334 + if (m6809_soft_regs > NUM_M_REGS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3335 + m6809_soft_regs = NUM_M_REGS;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3336 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3337 + /* Registers are marked FIXED by default. Free up if
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3338 + the user wishes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3339 + for (soft_regno = 1; soft_regno < m6809_soft_regs; soft_regno++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3340 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3341 + fixed_regs[SOFT_M0_REGNUM + soft_regno] = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3342 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3343 + /* Mark the softregs as call-clobbered, so that they need
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3344 + * not be saved/restored on function entry/exit. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3345 + call_used_regs[SOFT_M0_REGNUM + soft_regno] = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3346 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3347 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3348 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3349 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3350 +/** Return a RTX representing how to return a value from a function.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3351 + VALTYPE gives the type of the value, FUNC identifies the function
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3352 + itself.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3353 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3354 + In general, we only care about the width of the result. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3355 +rtx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3356 +m6809_function_value (const tree valtype, const tree func ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3357 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3358 + unsigned int regno;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3359 + enum machine_mode mode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3360 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3361 + /* Get the mode (i.e. width) of the result. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3362 + mode = TYPE_MODE (valtype);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3363 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3364 + if (lookup_attribute ("boolean", TYPE_ATTRIBUTES (valtype)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3365 + regno = HARD_Z_REGNUM;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3366 + else if (mode == QImode || (TARGET_DRET && mode == HImode))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3367 + regno = HARD_D_REGNUM;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3368 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3369 + regno = HARD_X_REGNUM;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3370 + return gen_rtx_REG (mode, regno);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3371 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3372 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3373 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3374 +/** Return 1 if REGNO is possibly needed to return the result
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3375 +of a function, 0 otherwise. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3376 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3377 +m6809_function_value_regno_p (unsigned int regno)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3378 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3379 + if (regno == HARD_Z_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3380 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3381 + else if ((TARGET_BYTE_INT || TARGET_DRET) && regno == HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3382 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3383 + else if (!TARGET_DRET && regno == HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3384 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3385 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3386 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3387 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3388 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3389 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3390 +#ifdef TRACE_PEEPHOLE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3391 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3392 +m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3393 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3394 + if (stage == PEEP_END)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3395 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3396 + printf ("%s: peephole %d pattern and predicate matched\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3397 + main_input_filename, peephole_id);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3398 + fflush (stdout);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3399 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3400 + else if (stage == PEEP_COND)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3401 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3402 + printf ("%s: peephole %d? at least pattern matched\n",
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3403 + main_input_filename, peephole_id);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3404 + fflush (stdout);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3405 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3406 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3407 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3408 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3409 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3410 +m6809_match_peephole2 (unsigned int peephole_id ATTRIBUTE_UNUSED,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3411 + unsigned int stage ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3412 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3413 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3414 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3415 +#endif /* TRACE_PEEPHOLE */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3416 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3417 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3418 +/** Return 1 if it is OK to store a value of MODE in REGNO. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3419 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3420 +m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3421 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3422 + /* Soft registers, as they are just memory, can really hold
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3423 + values of any type. However we restrict them to values of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3424 + size HImode or QImode to prevent exhausting them for larger
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3425 + values.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3426 + Word values cannot be placed into the first soft register,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3427 + as it is the low byte that is being placed there, which
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3428 + corrupts the (non-soft) register before it. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3429 + if (M_REGNO_P (regno))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3430 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3431 + switch (GET_MODE_SIZE (mode))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3432 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3433 + case 1:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3434 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3435 + case 2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3436 + return regno != SOFT_M0_REGNUM;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3437 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3438 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3439 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3440 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3441 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3442 + /* VOIDmode can be stored anywhere */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3443 + else if (mode == VOIDmode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3444 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3445 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3446 + /* Zero is a reserved register, but problems occur if we don't
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3447 + say yes here??? */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3448 + else if (regno == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3449 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3450 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3451 + /* For other registers, return true only if the requested size
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3452 + exactly matches the hardware size. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3453 + else if ((G_REGNO_P (regno)) && (GET_MODE_SIZE (mode) == 2))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3454 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3455 + else if ((BYTE_REGNO_P (regno)) && (GET_MODE_SIZE (mode) == 1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3456 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3457 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3458 + return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3459 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3460 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3461 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3462 +/* exp is the call expression. DECL is the called function,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3463 + * or NULL for an indirect call */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3464 +bool
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3465 +m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3466 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3467 + tree type, arg;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3468 + const char *name;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3469 + bool result = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3470 + int argcount = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3471 + int step = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3472 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3473 + /* If there is no DECL, it is an indirect call.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3474 + * Never optimize this??? */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3475 + if (decl == NULL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3476 + goto done;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3477 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3478 + /* Never allow an interrupt handler to be optimized this way. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3479 + if (m6809_function_has_type_attr_p (decl, "interrupt"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3480 + goto done;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3481 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3482 + /* Skip sibcall if the type can't be found for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3483 + * some reason */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3484 + step++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3485 + name = IDENTIFIER_POINTER (DECL_NAME (decl));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3486 + type = TREE_TYPE (decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3487 + if (type == NULL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3488 + goto done;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3489 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3490 + /* Skip sibcall if the target is a far function */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3491 + step++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3492 + if (far_function_type_p (type) != NULL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3493 + goto done;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3494 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3495 + /* Skip sibcall if the called function's arguments are
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3496 + * variable */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3497 + step++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3498 + if (TYPE_ARG_TYPES (type) == NULL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3499 + goto done;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3500 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3501 + /* Allow sibcalls in other cases. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3502 + result = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3503 +done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3504 + /* printf ("%s ok for sibcall? %s, step %d, args %d\n", name, result ? "yes" : "no", step, argcount); */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3505 + return result;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3506 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3507 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3508 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3509 +/** Emit code for the 'casesi' pattern.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3510 + * This pattern is only used in 8-bit mode, and can be disabled
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3511 + * with -mold-case there as well. The rationale for this is to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3512 + * do a better job than the simpler but well-tested 'tablejump'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3513 + * method.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3514 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3515 + * For small jumptables, where the switch expression is an
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3516 + * 8-bit value, the lookup can be done more efficiently
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3517 + * using the "B,X" style index mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3518 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3519 +m6809_do_casesi (rtx index, rtx lower_bound, rtx range,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3520 + rtx table_label, rtx default_label)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3521 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3522 + enum machine_mode mode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3523 + rtx scaled;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3524 + rtx table_in_reg;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3525 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3526 + /* expr.c has to be patched so that it does not promote
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3527 + * the expression to SImode, but rather to HImode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3528 + * Fail now if that isn't the case. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3529 + if (GET_MODE_SIZE (GET_MODE (index)) > GET_MODE_SIZE (HImode))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3530 + error ("try_casesi promotion bug");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3531 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3532 + /* Determine whether or not we are going to work primarily in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3533 + * QImode or HImode. This depends on the size of the index
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3534 + * into the lookup table. QImode can only be used when the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3535 + * index is less than 0x40, since it will be doubled but
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3536 + * must remain unsigned. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3537 + if ((GET_CODE (range) == CONST_INT) && (INTVAL (range) < 0x40))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3538 + mode = QImode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3539 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3540 + mode = HImode;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3541 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3542 + /* Convert to QImode if necessary */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3543 + if (mode == QImode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3544 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3545 + index = gen_lowpart_general (mode, index);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3546 + lower_bound = gen_lowpart_general (mode, lower_bound);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3547 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3548 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3549 + /* Translate from case value to table index by subtraction */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3550 + if (lower_bound != const0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3551 + index = expand_binop (mode, sub_optab, index, lower_bound,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3552 + NULL_RTX, 0, OPTAB_LIB_WIDEN);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3553 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3554 + /* Emit compare-and-jump to test for index out-of-range */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3555 + emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3556 + default_label);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3557 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3558 + /* Put the table address is in a register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3559 + table_in_reg = gen_reg_rtx (Pmode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3560 + emit_move_insn (table_in_reg, gen_rtx_LABEL_REF (Pmode, table_label));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3561 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3562 + /* Emit table lookup and jump */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3563 + if (mode == QImode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3564 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3565 + /* Scale the index */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3566 + scaled = gen_reg_rtx (QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3567 + emit_insn (gen_ashlqi3 (scaled, index, const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3568 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3569 + /* Emit the jump */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3570 + emit_jump_insn (gen_tablejump_short_offset (scaled, table_in_reg));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3571 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3572 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3573 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3574 + /* Scale the index */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3575 + emit_insn (gen_ashlhi3 (index, index, const1_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3576 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3577 + /* Emit the jump */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3578 + emit_jump_insn (gen_tablejump_long_offset (index, table_in_reg));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3579 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3580 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3581 + /* Copied from expr.c */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3582 + if (!CASE_VECTOR_PC_RELATIVE && !flag_pic)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3583 + emit_barrier ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3584 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3585 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3586 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3587 +/** Output the assembly code for a 32-bit add/subtract. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3588 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3589 +m6809_output_addsi3 (int rtx_code, rtx *operands)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3590 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3591 + rtx xoperands[8];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3592 + rtx dst = operands[0];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3593 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3594 + /* Prepare the operands by splitting each SImode into two HImodes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3595 + that can be operated independently. The high word of operand 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3596 + is further divided into two QImode components for use with 'adc'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3597 + style instructions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3598 + xoperands[7] = operands[3];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3599 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3600 + xoperands[0] = adjust_address (dst, HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3601 + xoperands[3] = adjust_address (dst, HImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3602 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3603 +#if 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3604 + xoperands[2] = adjust_address (operands[1], HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3605 + xoperands[6] = adjust_address (operands[1], HImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3606 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3607 + /* Operand 2 may be a MEM or a CONST_INT */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3608 + if (GET_CODE (operands[2]) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3609 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3610 + xoperands[1] = gen_int_mode (INTVAL (operands[2]) & 0xFFFF, HImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3611 + xoperands[4] = gen_int_mode ((INTVAL (operands[2]) >> 24) & 0xFF, QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3612 + xoperands[5] = gen_int_mode ((INTVAL (operands[2]) >> 16) & 0xFF, QImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3613 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3614 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3615 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3616 + xoperands[1] = adjust_address (operands[2], HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3617 + xoperands[4] = adjust_address (operands[2], QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3618 + xoperands[5] = adjust_address (operands[2], QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3619 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3620 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3621 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3622 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3623 +#if 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3624 + xoperands[1] = adjust_address (operands[1], HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3625 + xoperands[4] = adjust_address (operands[1], QImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3626 + xoperands[5] = adjust_address (operands[1], QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3627 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3628 + /* Operand 2 may be a MEM or a CONST_INT */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3629 + if (GET_CODE (operands[2]) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3630 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3631 + xoperands[2] = gen_int_mode ((INTVAL (operands[2])) & 0xFFFF, HImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3632 + xoperands[6] = gen_int_mode ((INTVAL (operands[2]) >> 16) & 0xFFFF, HImode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3633 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3634 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3635 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3636 + xoperands[2] = adjust_address (operands[2], HImode, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3637 + xoperands[6] = adjust_address (operands[2], HImode, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3638 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3639 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3640 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3641 + /* Output the assembly code. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3642 + if (rtx_code == PLUS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3643 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3644 + output_asm_insn ("ld%7\t%2", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3645 + output_asm_insn ("add%7\t%1", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3646 + output_asm_insn ("st%7\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3647 + output_asm_insn ("ld%7\t%6", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3648 + output_asm_insn ("adcb\t%5", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3649 + output_asm_insn ("adca\t%4", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3650 + output_asm_insn ("st%7\t%3", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3651 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3652 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3653 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3654 + output_asm_insn ("ld%7\t%2", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3655 + output_asm_insn ("sub%7\t%1", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3656 + output_asm_insn ("st%7\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3657 + output_asm_insn ("ld%7\t%6", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3658 + output_asm_insn ("sbcb\t%5", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3659 + output_asm_insn ("sbca\t%4", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3660 + output_asm_insn ("st%7\t%3", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3661 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3662 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3663 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3664 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3665 +#if 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3666 +/** Output the assembly code for a 32-bit shift.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3667 +Operands 0 and 1 must be the same rtx, forced by a matching
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3668 +constraint. Operand 2 must be a CONST_INT. Operand 3 is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3669 +"d" in case a temporary reg is needed. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3670 +void
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3671 +m6809_output_shiftsi3 (int rtx_code, rtx *operands)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3672 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3673 + unsigned int count = INTVAL (operands[2]) % 32;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3674 + unsigned int size = 4; /* sizeof (SImode) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3675 + int s;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3676 + rtx xoperands[4];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3677 + int op;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3678 + int start, end, step;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3679 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3680 + /* Initialize */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3681 + if (rtx_code == ASHIFT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3682 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3683 + start = size-1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3684 + end = -1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3685 + step = -1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3686 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3687 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3688 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3689 + start = 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3690 + end = size;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3691 + step = 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3692 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3693 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3694 + xoperands[2] = operands[2];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3695 + xoperands[3] = operands[3];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3696 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3697 + if (count <= 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3698 + abort ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3699 + if (rtx_code == ROTATE || rtx_code == ROTATERT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3700 + abort ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3701 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3702 + /* Extract bit shifts over 16 bits by HImode moves. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3703 + if (count >= 16)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3704 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3705 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3706 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3707 + /* Extract bit shifts over 8 bits by QImode moves. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3708 + if (count >= 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3709 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3710 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3711 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3712 + /* Iterate over the number of bits to be shifted. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3713 + while (count > 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3714 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3715 + /* Each bit to be shifted requires 1 proper bit shift
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3716 + and 3 rotates. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3717 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3718 + /* First, do the arithmetic/logical shift. Left shifts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3719 + start from the LSB; right shifts start from the MSB. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3720 + xoperands[0] = adjust_address (operands[0], QImode, start);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3721 + switch (rtx_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3722 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3723 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3724 + output_asm_insn ("asl\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3725 + start--;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3726 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3727 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3728 + output_asm_insn ("asr\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3729 + start++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3730 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3731 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3732 + output_asm_insn ("lsr\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3733 + start++;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3734 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3735 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3736 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3737 + /* Next, rotate the other bytes */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3738 + for (s = start; s != end; s += step)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3739 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3740 + xoperands[0] = adjust_address (operands[0], QImode, s);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3741 + switch (rtx_code)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3742 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3743 + case ASHIFT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3744 + output_asm_insn ("rol\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3745 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3746 + case ASHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3747 + case LSHIFTRT:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3748 + output_asm_insn ("ror\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3749 + break;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3750 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3751 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3752 + count--;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3753 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3754 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3755 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3756 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3757 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3758 +power_of_two_p (unsigned int n)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3759 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3760 + return (n & (n-1)) == 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3761 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3762 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3763 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3764 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3765 +m6809_can_eliminate (int from, int to)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3766 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3767 + if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3768 + return !frame_pointer_needed;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3769 + return 1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3770 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3771 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3772 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3773 +int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3774 +m6809_initial_elimination_offset (int from, int to)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3775 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3776 + switch (from)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3777 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3778 + case ARG_POINTER_REGNUM:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3779 + return get_frame_size () + m6809_get_regs_size (m6809_get_live_regs ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3780 + case FRAME_POINTER_REGNUM:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3781 + return get_frame_size ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3782 + default:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3783 + gcc_unreachable ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3784 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3785 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3786 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3787 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3788 +bool
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3789 +m6809_frame_pointer_required (void)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3790 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3791 + return false;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3792 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3793 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3794 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3795 +/* Defines the target-specific hooks structure. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3796 +struct gcc_target targetm = TARGET_INITIALIZER;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3797 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.h gcc-4.6.4/gcc/config/m6809/m6809.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3798 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.h 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3799 +++ gcc-4.6.4/gcc/config/m6809/m6809.h 2015-07-20 21:56:53.518727644 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3800 @@ -0,0 +1,1352 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3801 +/* Definitions of target machine for GNU compiler. MC6809 version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3802 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3803 + MC6809 Version by Tom Jones (jones@sal.wisc.edu)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3804 + Space Astronomy Laboratory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3805 + University of Wisconsin at Madison
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3806 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3807 + minor changes to adapt it to gcc-2.5.8 by Matthias Doerfel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3808 + ( msdoerfe@informatik.uni-erlangen.de )
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3809 + also added #pragma interrupt (inspired by gcc-6811)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3810 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3811 + minor changes to adapt it to gcc-2.8.0 by Eric Botcazou
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3812 + (ebotcazou@multimania.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3813 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3814 + minor changes to adapt it to egcs-1.1.2 by Eric Botcazou
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3815 + (ebotcazou@multimania.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3816 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3817 + minor changes to adapt it to gcc-2.95.3 by Eric Botcazou
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3818 + (ebotcazou@multimania.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3819 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3820 + changes for gcc-3.1.1 by ???
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3821 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3822 + further changes for gcc-3.1.1 and beyond by Brian Dominy
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3823 + (brian@oddchange.com)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3824 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3825 + even more changes for gcc-4.6.1 by William Astle (lost@l-w.ca)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3826 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3827 +This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3828 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3829 +GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3830 +it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3831 +the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3832 +any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3833 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3834 +GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3835 +but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3836 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3837 +GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3838 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3839 +You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3840 +along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3841 +<http://www.gnu.org/licenses/>. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3842 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3843 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3844 +/* Helper macros for creating strings with macros */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3845 +#define C_STRING(x) C_STR(x)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3846 +#define C_STR(x) #x
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3847 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3848 +/* Certain parts of GCC include host-side includes, which is bad.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3849 + * Some things that get pulled in need to be undone.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3850 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3851 +#undef HAVE_GAS_HIDDEN
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3852 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3853 +/* Names to predefine in the preprocessor for this target machine. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3854 +/*#define TARGET_CPU_CPP_BUILTINS() m6809_cpu_cpp_builtins () */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3855 +#define TARGET_CPU_CPP_BUILTINS() do \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3856 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3857 + if (TARGET_6309) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3858 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3859 + builtin_define_std ("__M6309__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3860 + builtin_define_std ("__m6309__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3861 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3862 + else \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3863 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3864 + builtin_define_std ("__M6809__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3865 + builtin_define_std ("__m6809__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3866 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3867 + \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3868 + if (TARGET_BYTE_INT) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3869 + builtin_define_std ("__int8__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3870 + else \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3871 + builtin_define_std ("__int16__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3872 + \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3873 + switch (m6809_abi_version) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3874 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3875 + case M6809_ABI_VERSION_STACK: \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3876 + builtin_define_std ("__regargs__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3877 + builtin_define_std ("__ABI_STACK__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3878 + break; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3879 + case M6809_ABI_VERSION_REGS: \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3880 + builtin_define_std ("__ABI_REGS__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3881 + break; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3882 + case M6809_ABI_VERSION_BX: \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3883 + builtin_define_std ("__ABI_BX__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3884 + break; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3885 + default: \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3886 + break; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3887 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3888 + \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3889 + if (TARGET_WPC) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3890 + builtin_define_std ("__WPC__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3891 + \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3892 + if (TARGET_DRET) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3893 + builtin_define_std ("__DRET__"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3894 + } while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3895 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3896 +/* As an embedded target, we have no libc. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3897 +#ifndef inhibit_libc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3898 +#define inhibit_libc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3899 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3900 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3901 +/* Print subsidiary information on the compiler version in use. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3902 +#define TARGET_VERSION fprintf (stderr, " (MC6809)");
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3903 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3904 +/* Run-time compilation parameters selecting different hardware subsets. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3905 +/*extern int target_flags; */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3906 +extern short *reg_renumber; /* def in local_alloc.c */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3907 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3908 +/* Runtime current values of section names */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3909 +extern int section_changed;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3910 +extern char code_section_op[], data_section_op[], bss_section_op[];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3911 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3912 +#define WARNING_OPT 0,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3913 +/*extern const char *m6809_abi_version_ptr; */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3914 +extern unsigned int m6809_soft_regs;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3915 +extern unsigned int m6809_abi_version;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3916 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3917 +/* ABI versions */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3918 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3919 +#define M6809_ABI_VERSION_STACK 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3920 +#define M6809_ABI_VERSION_REGS 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3921 +#define M6809_ABI_VERSION_BX 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3922 +#define M6809_ABI_VERSION_LATEST (M6809_ABI_VERSION_BX)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3923 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3924 +/* Allow $ in identifiers */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3925 +#define DOLLARS_IN_IDENTIFIERS 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3926 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3927 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3928 + Target machine storage layout
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3929 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3930 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3931 +/* Define this if most significant bit is lowest numbered
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3932 + in instructions that operate on numbered bit-fields. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3933 +#define BITS_BIG_ENDIAN 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3934 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3935 +/* Define to 1 if most significant byte of a word is the lowest numbered. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3936 +#define BYTES_BIG_ENDIAN 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3937 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3938 +/* Define to 1 if most significant word of a multiword value is the lowest numbered. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3939 +#define WORDS_BIG_ENDIAN 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3940 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3941 +/* Number of bits in an addressible storage unit */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3942 +#define BITS_PER_UNIT 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3943 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3944 +/* Width in bits of a "word", or the contents of a machine register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3945 + * Although the 6809 has a few byte registers, define this to 16-bits
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3946 + * since this is the natural size of most registers. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3947 +#define BITS_PER_WORD 16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3948 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3949 +/* Width of a word, in units (bytes). */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3950 +#define UNITS_PER_WORD (BITS_PER_WORD/8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3951 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3952 +/* Width in bits of a pointer. See also the macro `Pmode' defined below. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3953 +#define POINTER_SIZE 16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3954 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3955 +/* Allocation boundary (bits) for storing pointers in memory. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3956 +#define POINTER_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3957 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3958 +/* Allocation boundary (bits) for storing arguments in argument list. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3959 +/* PARM_BOUNDARY is divided by BITS_PER_WORD in expr.c -- tej */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3960 +#define PARM_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3961 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3962 +/* Boundary (bits) on which stack pointer should be aligned. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3963 +#define STACK_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3964 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3965 +/* Allocation boundary (bits) for the code of a function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3966 +#define FUNCTION_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3967 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3968 +/* Alignment of field after `int : 0' in a structure. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3969 +#define EMPTY_FIELD_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3970 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3971 +/* Every structure's size must be a multiple of this. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3972 +#define STRUCTURE_SIZE_BOUNDARY 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3973 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3974 +/* Largest mode size to use when putting an object, including
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3975 + * a structure, into a register. By limiting this to 16, no
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3976 + * 32-bit objects will ever be allocated to a pair of hard
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3977 + * registers. This is a good thing, since there aren't that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3978 + * many of them. 32-bit objects are only needed for floats
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3979 + * and "long long"s. Larger values have been tried and did not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3980 + * work. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3981 +#define MAX_FIXED_MODE_SIZE 16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3982 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3983 +/* No data type wants to be aligned rounder than this. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3984 +#define BIGGEST_ALIGNMENT 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3985 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3986 +/* Define this if move instructions will actually fail to work
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3987 + when given unaligned data. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3988 +#define STRICT_ALIGNMENT 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3989 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3990 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3991 + Standard register usage.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3992 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3993 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3994 +/* Register values as bitmasks.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3995 + * TODO : merge D_REGBIT and B_REGBIT, and treat this as the same
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3996 + * register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3997 +#define RSVD1_REGBIT (1 << HARD_RSVD1_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3998 +#define D_REGBIT (1 << HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
3999 +#define X_REGBIT (1 << HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4000 +#define Y_REGBIT (1 << HARD_Y_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4001 +#define U_REGBIT (1 << HARD_U_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4002 +#define S_REGBIT (1 << HARD_S_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4003 +#define PC_REGBIT (1 << HARD_PC_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4004 +#define Z_REGBIT (1 << HARD_Z_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4005 +#define A_REGBIT (1 << HARD_A_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4006 +#define B_REGBIT (1 << HARD_B_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4007 +#define CC_REGBIT (1 << HARD_CC_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4008 +#define DP_REGBIT (1 << HARD_DP_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4009 +#define SOFT_FP_REGBIT (1 << SOFT_FP_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4010 +#define SOFT_AP_REGBIT (1 << SOFT_AP_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4011 +#define M_REGBIT(n) (1 << (SOFT_M0_REGNUM + n))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4012 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4013 +/* Macros for dealing with set of registers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4014 + * A register set is just a bitwise-OR of all the register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4015 + * bitmask values. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4016 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4017 +/* Which registers can hold 8-bits */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4018 +#define BYTE_REGSET \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4019 + (Z_REGBIT | A_REGBIT | D_REGBIT | CC_REGBIT | DP_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4020 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4021 +/* Which registers can hold 16-bits.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4022 + * Note: D_REGBIT is defined as both an 8-bit and 16-bit register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4023 +#define WORD_REGSET \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4024 + (D_REGBIT | X_REGBIT | Y_REGBIT | U_REGBIT | S_REGBIT | PC_REGBIT | SOFT_FP_REGBIT | SOFT_AP_REGBIT | RSVD1_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4025 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4026 +/* Returns nonzero if a given REGNO is in the REGSET. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4027 +#define REGSET_CONTAINS_P(regno, regset) (((1 << (regno)) & (regset)) != 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4028 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4029 +/* Defines related to the number of soft registers supported.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4030 + * The actual number used may be less depending on -msoft-reg-count.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4031 + * If you change one of these, you should change them all. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4032 +#define NUM_M_REGS 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4033 +#define M_REGS_FIXED 1, 1, 1, 1, 1, 1, 1, 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4034 +#define M_REGS_CALL_USED 1, 1, 1, 1, 1, 1, 1, 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4035 +#define HARD_M_REGNUMS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4036 + SOFT_M0_REGNUM+0, SOFT_M0_REGNUM+1, SOFT_M0_REGNUM+2, SOFT_M0_REGNUM+3, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4037 + SOFT_M0_REGNUM+4, SOFT_M0_REGNUM+5, SOFT_M0_REGNUM+6, SOFT_M0_REGNUM+7
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4038 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4039 +#define SOFT_M_REGBITS (((1UL << NUM_M_REGS) - 1) << (SOFT_M0_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4040 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4041 +/* Number of actual hardware registers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4042 + The hardware registers are assigned numbers for the compiler
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4043 + from 0 to just below FIRST_PSEUDO_REGISTER.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4044 + All registers that the compiler knows about must be given numbers,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4045 + even those that are not normally considered general registers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4046 + Make sure the constant below matches the value of SOFT_M0_REGNUM;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4047 + for some reason, GCC won't compile if that name is used here directly. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4048 +#ifdef SOFT_M0_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4049 +#if (SOFT_M0_REGNUM != 14)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4050 +#error "bad register numbering"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4051 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4052 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4053 +#define FIRST_PSEUDO_REGISTER (14 + NUM_M_REGS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4054 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4055 +/* 1 for registers that have pervasive standard uses
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4056 + and are not available for the register allocator.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4057 + The psuedoregisters (M_REGS) are declared fixed here, but
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4058 + will be unfixed if -msoft-reg-count is seen later. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4059 +#define FIXED_REGISTERS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4060 + {1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, M_REGS_FIXED, }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4061 + /* -, X, Y, U, S, PC,D, Z, A, B, C, DP,FP,AP,M... */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4062 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4063 +/* 1 for registers not available across function calls.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4064 + These must include the FIXED_REGISTERS and also any
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4065 + registers that can be used without being saved.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4066 + The latter must include the registers where values are returned
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4067 + and the register where structure-value addresses are passed.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4068 + Aside from that, you can include as many other registers as you like. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4069 +#define CALL_USED_REGISTERS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4070 + {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, M_REGS_CALL_USED, }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4071 + /* -, X, Y, U, S, PC,D, Z, A, B, C, DP,FP,AP,M... */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4072 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4073 +/* Return number of consecutive hard regs needed starting at reg REGNO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4074 + to hold something of mode MODE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4075 + For the 6809, we distinguish between word-length and byte-length
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4076 + registers. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4077 +#define HARD_REGNO_NREGS(REGNO, MODE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4078 + (REGSET_CONTAINS_P (REGNO, WORD_REGSET) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4079 + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4080 + (GET_MODE_SIZE (MODE)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4081 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4082 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4083 +/* Value is 1 if hard register REGNO can hold a value
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4084 +of machine-mode MODE. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4085 +#define HARD_REGNO_MODE_OK(REGNO, MODE) m6809_hard_regno_mode_ok (REGNO, MODE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4086 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4087 +/* Value is 1 if it is a good idea to tie two pseudo registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4088 + when one has mode MODE1 and one has mode MODE2.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4089 + If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4090 + for any hard reg, then this must be 0 for correct output. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4091 +#define MODES_TIEABLE_P(MODE1, MODE2) 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4092 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4093 +/* Specify the registers used for certain standard purposes.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4094 + The values of these macros are register numbers. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4095 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4096 +/* program counter if referenced as a register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4097 +#define PC_REGNUM HARD_PC_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4098 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4099 +/* Register to use for pushing function arguments. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4100 +#define STACK_POINTER_REGNUM HARD_S_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4101 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4102 +/* Base register for access to local variables of the function.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4103 + * Before reload, FRAME_POINTER_REGNUM will be used. Later,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4104 + * the elimination pass will convert these to STACK_POINTER_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4105 + * if possible, or else HARD_FRAME_POINTER_REGNUM. The idea is to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4106 + * avoid tying up a hard register (U) for the frame pointer if
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4107 + * it can be eliminated entirely, making it available for use as
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4108 + * a general register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4109 +#define FRAME_POINTER_REGNUM SOFT_FP_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4110 +#define HARD_FRAME_POINTER_REGNUM HARD_U_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4111 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4112 +/* Define a table of possible eliminations.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4113 + * The idea is to try to avoid using hard registers for the argument
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4114 + * and frame pointers if they can be derived from the stack pointer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4115 + * instead, which already has a hard register reserved for it.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4116 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4117 + * The order of entries in this table will try to convert
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4118 + * ARG_POINTER_REGNUM and FRAME_POINTER_REGNUM into stack pointer
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4119 + * references first, but if that fails, they will be converted to use
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4120 + * HARD_FRAME_POINTER_REGNUM.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4121 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4122 +#define ELIMINABLE_REGS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4123 +{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4124 + { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4125 + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4126 + { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4127 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4128 +/* #define CAN_ELIMINATE(FROM, TO) m6809_can_eliminate (FROM, TO) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4129 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4130 +/* Define how to offset the frame or argument pointer to turn it
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4131 + * into a stack pointer reference. This is based on the way that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4132 + * the frame is constructed in the function prologue. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4133 +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4134 + (OFFSET) = m6809_initial_elimination_offset (FROM, TO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4135 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4136 +/* Base register for access to arguments of the function.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4137 + * This is only used prior to reload; no instructions will ever
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4138 + * be output referring to this register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4139 +#define ARG_POINTER_REGNUM SOFT_AP_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4140 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4141 +/* Register in which static-chain is passed to a function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4142 +#define STATIC_CHAIN_REGNUM HARD_Y_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4143 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4144 +/* #define CONDITIONAL_REGISTER_USAGE (m6809_conditional_register_usage ()) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4145 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4146 +/* Order in which hard registers are allocated to pseudos.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4147 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4148 + * Since the D register is the only valid reg for 8-bit values
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4149 + * now, avoid using it for 16-bit values by putting it after all
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4150 + * other 16-bits.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4151 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4152 + * Prefer X first since the first 16-bit function argument goes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4153 + * there. We may be able to pass in to a subroutine without
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4154 + * a copy.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4155 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4156 + * Prefer U over Y since instructions using Y take one extra
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4157 + * byte, and thus one extra cycle to execute.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4158 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4159 +#define REG_ALLOC_ORDER \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4160 + { HARD_X_REGNUM, HARD_U_REGNUM, HARD_Y_REGNUM, HARD_D_REGNUM, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4161 + HARD_M_REGNUMS, HARD_S_REGNUM, HARD_PC_REGNUM, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4162 + HARD_B_REGNUM, HARD_A_REGNUM, HARD_CC_REGNUM, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4163 + HARD_DP_REGNUM, SOFT_FP_REGNUM, SOFT_AP_REGNUM, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4164 + 6, HARD_Z_REGNUM }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4165 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4166 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4167 + classes of registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4168 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4169 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4170 +/* Define the classes of registers for register constraints in the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4171 + machine description. Also define ranges of constants.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4172 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4173 + One of the classes must always be named ALL_REGS and include all hard regs.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4174 + If there is more than one class, another class must be named NO_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4175 + and contain no registers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4176 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4177 + The name GENERAL_REGS must be the name of a class (or an alias for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4178 + another name such as ALL_REGS). This is the class of registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4179 + that is allowed by "g" or "r" in a register constraint.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4180 + Also, registers outside this class are allocated only when
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4181 + instructions express preferences for them.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4182 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4183 + The classes must be numbered in nondecreasing order; that is,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4184 + a larger-numbered class must never be contained completely
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4185 + in a smaller-numbered class.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4186 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4187 + For any two classes, it is very desirable that there be another
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4188 + class that represents their union. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4189 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4190 +enum reg_class {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4191 + NO_REGS, /* The trivial class with no registers in it */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4192 + D_REGS, /* 16-bit (word (HI)) data (D) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4193 + ACC_A_REGS, /* The A register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4194 + ACC_B_REGS, /* The B register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4195 + X_REGS, /* The X register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4196 + Z_REGS, /* The Z (zero-bit) register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4197 + Q_REGS, /* 8-bit (byte (QI)) data (A,B) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4198 + M_REGS, /* 8-bit (byte (QI)) soft registers */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4199 + CC_REGS, /* 8-bit condition code register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4200 + I_REGS, /* An index register (A,B,D) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4201 + T_REGS, /* 16-bit addresses, not including stack or PC (X,Y,U) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4202 + A_REGS, /* 16-bit addresses (X,Y,U,S,PC) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4203 + S_REGS, /* 16-bit soft registers (FP, AP) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4204 + P_REGS, /* 16-bit pushable registers (D,X,Y,U); omit PC and S */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4205 + G_REGS, /* 16-bit data and address (D,X,Y,U,S,PC) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4206 + ALL_REGS, /* All registers */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4207 + LIM_REG_CLASSES
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4208 +};
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4209 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4210 +#define N_REG_CLASSES (int) LIM_REG_CLASSES
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4211 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4212 +/* Since GENERAL_REGS is a smaller class than ALL_REGS,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4213 + it is not an alias to ALL_REGS, but to G_REGS. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4214 +#define GENERAL_REGS G_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4215 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4216 +/* Give names of register classes as strings for dump file. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4217 +#define REG_CLASS_NAMES \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4218 + { "NO_REGS", "D_REGS", "ACC_A_REGS", "ACC_B_REGS", "X_REGS", "Z_REGS", "Q_REGS", "M_REGS", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4219 + "CC_REGS", "I_REGS", "T_REGS", "A_REGS", "S_REGS", "P_REGS", "G_REGS", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4220 + "ALL_REGS" }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4221 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4222 +/* Define which registers fit in which classes.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4223 + This is an initializer for a vector of HARD_REG_SET
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4224 + of length N_REG_CLASSES. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4225 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4226 +#define D_REGSET (D_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4227 +#define ACC_A_REGSET (A_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4228 +#define ACC_B_REGSET (D_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4229 +#define X_REGSET (X_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4230 +#define Z_REGSET (Z_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4231 +#define Q_REGSET (D_REGBIT | A_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4232 +#define M_REGSET (SOFT_M_REGBITS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4233 +#define CC_REGSET (CC_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4234 +#define I_REGSET (A_REGBIT | B_REGBIT | D_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4235 +#define T_REGSET (X_REGBIT | Y_REGBIT | U_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4236 +#define A_REGSET (X_REGBIT | Y_REGBIT | U_REGBIT | S_REGBIT | PC_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4237 +#define S_REGSET (SOFT_FP_REGBIT | SOFT_AP_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4238 +#define P_REGSET (D_REGBIT | X_REGBIT | Y_REGBIT | U_REGBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4239 +#define G_REGSET \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4240 + (D_REGSET | Q_REGSET | I_REGSET | A_REGSET | M_REGSET | S_REGSET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4241 +#define ALL_REGSET (G_REGSET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4242 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4243 +#define REG_CLASS_CONTENTS { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4244 + {0}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4245 + {D_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4246 + {ACC_A_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4247 + {ACC_B_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4248 + {X_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4249 + {Z_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4250 + {Q_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4251 + {M_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4252 + {CC_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4253 + {I_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4254 + {T_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4255 + {A_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4256 + {S_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4257 + {P_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4258 + {G_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4259 + {ALL_REGSET}, \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4260 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4261 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4262 +/* The same information, inverted.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4263 + * This is defined to use the REG_CLASS_CONTENTS defines above, so that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4264 + * these two sets of definitions are always consistent. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4265 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4266 +#define REGNO_REG_CLASS(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4267 + (D_REGNO_P (REGNO) ? D_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4268 + (Z_REGNO_P (REGNO) ? Z_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4269 + (ACC_A_REGNO_P (REGNO) ? ACC_A_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4270 + (ACC_B_REGNO_P (REGNO) ? ACC_B_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4271 + (X_REGNO_P (REGNO) ? X_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4272 + (Q_REGNO_P (REGNO) ? Q_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4273 + (M_REGNO_P (REGNO) ? M_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4274 + (CC_REGNO_P (REGNO) ? CC_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4275 + (I_REGNO_P (REGNO) ? I_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4276 + (T_REGNO_P (REGNO) ? T_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4277 + (A_REGNO_P (REGNO) ? A_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4278 + (S_REGNO_P (REGNO) ? S_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4279 + (P_REGNO_P (REGNO) ? P_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4280 + (G_REGNO_P (REGNO) ? G_REGS : ALL_REGS))))))))))))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4281 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4282 +#define D_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, D_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4283 +#define ACC_A_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, ACC_A_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4284 +#define ACC_B_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, ACC_B_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4285 +#define X_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, X_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4286 +#define Z_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, Z_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4287 +#define Q_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, Q_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4288 +#define M_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, M_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4289 +#define CC_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, CC_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4290 +#define I_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, I_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4291 +#define T_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, T_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4292 +#define A_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, A_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4293 +#define S_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, S_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4294 +#define P_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, P_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4295 +#define G_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, G_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4296 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4297 +/* Macros that test an rtx 'X' to see if it's in a particular
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4298 + * register class. 'X' need not be a REG necessarily. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4299 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4300 +#define D_REG_P(X) (REG_P (X) && D_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4301 +#define ACC_A_REG_P(X) (REG_P (X) && ACC_A_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4302 +#define ACC_B_REG_P(X) (REG_P (X) && ACC_B_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4303 +#define X_REG_P(X) (REG_P (X) && X_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4304 +#define Z_REG_P(X) (REG_P (X) && Z_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4305 +#define I_REG_P(X) (REG_P (X) && I_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4306 +#define T_REG_P(X) (REG_P (X) && T_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4307 +#define A_REG_P(X) (REG_P (X) && A_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4308 +#define S_REG_P(X) (REG_P (X) && S_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4309 +#define P_REG_P(X) (REG_P (X) && P_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4310 +#define Q_REG_P(X) (REG_P (X) && Q_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4311 +#define M_REG_P(X) (REG_P (X) && M_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4312 +#define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4313 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4314 +/* Redefine this in terms of BYTE_REGSET */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4315 +#define BYTE_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, BYTE_REGSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4316 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4317 +/* The class value for index registers, and the one for base regs. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4318 +#define INDEX_REG_CLASS I_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4319 +#define BASE_REG_CLASS A_REGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4320 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4321 +/* Get reg_class from a letter in the machine description. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4322 +#define REG_CLASS_FROM_LETTER(C) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4323 + (((C) == 'a' ? A_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4324 + ((C) == 'd' ? D_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4325 + ((C) == 'x' ? I_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4326 + ((C) == 't' ? M_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4327 + ((C) == 'c' ? CC_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4328 + ((C) == 'A' ? ACC_A_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4329 + ((C) == 'B' ? ACC_B_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4330 + ((C) == 'v' ? X_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4331 + ((C) == 'u' ? S_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4332 + ((C) == 'U' ? P_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4333 + ((C) == 'T' ? T_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4334 + ((C) == 'z' ? Z_REGS : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4335 + ((C) == 'q' ? Q_REGS : NO_REGS))))))))))))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4336 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4337 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4338 + The letters I through O in a register constraint string
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4339 + can be used to stand for particular ranges of immediate operands.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4340 + This macro defines what the ranges are.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4341 + C is the letter, and VALUE is a constant value.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4342 + Return 1 if VALUE is in the range specified by C.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4343 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4344 + For the 6809, J, K, L are used for indexed addressing.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4345 + `I' is used for the constant 1.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4346 + `J' is used for the 5-bit offsets.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4347 + `K' is used for the 8-bit offsets.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4348 + `L' is used for the range of signed numbers that fit in 16 bits.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4349 + `M' is used for the exact value '8'.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4350 + `N' is used for the constant -1.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4351 + `O' is used for the constant 0.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4352 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4353 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4354 +#define CONST_OK_FOR_LETTER_P(VALUE, C) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4355 + ((C) == 'I' ? ((VALUE) == 1) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4356 + (C) == 'J' ? ((VALUE) >= -16 && (VALUE) <= 15) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4357 + (C) == 'K' ? ((VALUE) >= -128 && (VALUE) <= 127) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4358 + (C) == 'L' ? ((VALUE) >= -32768 && (VALUE) <= 32767) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4359 + (C) == 'M' ? ((VALUE) == 8) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4360 + (C) == 'N' ? ((VALUE) == -1) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4361 + (C) == 'O' ? ((VALUE) == 0) : 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4362 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4363 +/* Similar, but for floating constants, and defining letters G and H.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4364 + No floating-point constants are valid on MC6809. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4365 +#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4366 + ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4367 + && VALUE == CONST0_RTX (GET_MODE (VALUE))) : 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4368 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4369 +/* Given an rtx X being reloaded into a reg required to be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4370 + in class CLASS, return the class of reg to actually use.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4371 + In general this is just CLASS; but on some machines
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4372 + in some cases it is preferable to use a more restrictive class. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4373 +#define PREFERRED_RELOAD_CLASS(X,CLASS) m6809_preferred_reload_class(X,CLASS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4374 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4375 +#define SMALL_REGISTER_CLASSES 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4376 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4377 +/* Return the maximum number of consecutive registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4378 + needed to represent mode MODE in a register of class CLASS. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4379 +#define CLASS_MAX_NREGS(CLASS, MODE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4380 + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4381 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4382 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4383 + Stack layout; function entry, exit and calling.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4384 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4385 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4386 +/* Define this if pushing a word on the stack
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4387 + makes the stack pointer a smaller address. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4388 +#define STACK_GROWS_DOWNWARD
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4389 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4390 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4391 +/* Define this if the nominal address of the stack frame
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4392 + is at the high-address end of the local variables;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4393 + that is, each additional local variable allocated
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4394 + goes at a more negative offset in the frame. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4395 +#define FRAME_GROWS_DOWNWARD 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4396 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4397 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4398 +/* Offset within stack frame to start allocating local variables at.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4399 + If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4400 + first local allocated. Otherwise, it is the offset to the BEGINNING
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4401 + of the first local allocated. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4402 +#define STARTING_FRAME_OFFSET 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4403 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4404 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4405 +/* Always push stack arguments for now. Accumulation is not yet working. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4406 +#define PUSH_ROUNDING(BYTES) (BYTES)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4407 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4408 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4409 +/* Offset of first parameter from the argument pointer register value.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4410 + * ARG_POINTER_REGNUM is defined to point to the return address pushed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4411 + * onto the stack, so we must offset by 2 bytes to get to the arguments. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4412 +#define FIRST_PARM_OFFSET(FNDECL) 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4413 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4414 +/* Value is 1 if returning from a function call automatically
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4415 + pops the arguments described by the number-of-args field in the call.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4416 + FUNTYPE is the data type of the function (as a tree),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4417 + or for a library call it is an identifier node for the subroutine name. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4418 +/* #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4419 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4420 +/* Define how to find the value returned by a function.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4421 + VALTYPE is the data type of the value (as a tree).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4422 + If the precise function being called is known, FUNC is its FUNCTION_DECL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4423 + otherwise, FUNC is 0. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4424 +#define FUNCTION_VALUE(VALTYPE, FUNC) m6809_function_value (VALTYPE, FUNC)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4425 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4426 +/* Define how to find the value returned by a library function
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4427 + assuming the value has mode MODE. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4428 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4429 +/* All return values are in the X-register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4430 +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4431 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4432 +/* Define this if using the nonreentrant convention for returning
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4433 + structure and union values. No; it is inefficient and buggy. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4434 +#undef PCC_STATIC_STRUCT_RETURN
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4435 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4436 +/* 1 if N is a possible register number for a function value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4437 +#define FUNCTION_VALUE_REGNO_P(N) m6809_function_value_regno_p (N)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4438 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4439 +/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4440 + more than one register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4441 +#define NEEDS_UNTYPED_CALL 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4442 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4443 +/* 1 if N is a possible register number for function argument passing. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4444 +#define FUNCTION_ARG_REGNO_P(N) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4445 + ((m6809_abi_version != M6809_ABI_VERSION_STACK) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4446 + (((N) == HARD_D_REGNUM) || ((N) == HARD_X_REGNUM)) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4447 + 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4448 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4449 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4450 + Argument Lists
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4451 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4452 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4453 +/* Cumulative arguments are tracked in a single integer,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4454 + * which is the number of bytes of arguments scanned so far,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4455 + * plus which registers have already been used. The register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4456 + * info is kept in some of the upper bits */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4457 +#define CUMULATIVE_ARGS unsigned int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4458 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4459 +#define CUM_STACK_ONLY 0x80000000
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4460 +#define CUM_X_MASK 0x40000000
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4461 +#define CUM_B_MASK 0x20000000
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4462 +#define CUM_STACK_INVALID 0x10000000
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4463 +#define CUM_STACK_MASK 0xFFFFFFF
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4464 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4465 +#define CUM_ADVANCE_8BIT(cum) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4466 + (((cum) & CUM_B_MASK) ? (cum)++ : ((cum) |= CUM_B_MASK))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4467 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4468 +#define CUM_ADVANCE_16BIT(cum) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4469 + (((cum) & CUM_X_MASK) ? (cum) += 2 : ((cum) |= CUM_X_MASK))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4470 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4471 +/* Initialize a variable CUM of type CUMULATIVE_ARGS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4472 + for a call to a function whose data type is FNTYPE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4473 + For a library call, FNTYPE is 0.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4474 + N_NAMED was added in gcc 3.4 and is not used currently. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4475 +#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4476 + ((CUM) = m6809_init_cumulative_args (CUM, FNTYPE, LIBNAME))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4477 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4478 +#define FUNCTION_ARG_SIZE(MODE, TYPE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4479 + ((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4480 + : (unsigned) int_size_in_bytes (TYPE))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4481 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4482 +/* Update the data in CUM to advance over an argument
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4483 + of mode MODE and data type TYPE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4484 + (TYPE is null for libcalls where that information may not be available.) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4485 +#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4486 + (((MODE == QImode) && !((CUM) & CUM_STACK_ONLY)) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4487 + CUM_ADVANCE_8BIT (CUM) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4488 + ((MODE == HImode) && !((CUM) & CUM_STACK_ONLY)) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4489 + CUM_ADVANCE_16BIT (CUM) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4490 + ((CUM) = ((CUM) + (TYPE ? int_size_in_bytes (TYPE) : 2))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4491 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4492 +/* Define where to put the arguments to a function.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4493 + Value is zero to push the argument on the stack,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4494 + or a hard register rtx in which to store the argument.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4495 + This macro is used _before_ FUNCTION_ARG_ADVANCE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4496 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4497 + For the 6809, the first 8-bit function argument can be placed into B,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4498 + and the first 16-bit arg can go into X. All other arguments
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4499 + will be pushed onto the stack.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4500 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4501 + Command-line options can adjust this behavior somewhat.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4502 + */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4503 +#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4504 + ((MODE == VOIDmode) ? NULL_RTX : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4505 + ((MODE == BLKmode) || (GET_MODE_SIZE (MODE) > 2)) ? NULL_RTX : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4506 + ((MODE == QImode) && !((CUM) & (CUM_STACK_ONLY | CUM_B_MASK))) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4507 + gen_rtx_REG (QImode, HARD_D_REGNUM) : \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4508 + ((MODE == HImode) && !((CUM) & (CUM_STACK_ONLY | CUM_X_MASK))) ? \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4509 + gen_rtx_REG (HImode, HARD_X_REGNUM) : m6809_function_arg_on_stack (&CUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4510 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4511 +/* Output assembler code to FILE to increment profiler label # LABELNO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4512 + for profiling a function entry. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4513 +#define FUNCTION_PROFILER(FILE, LABELNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4514 + fprintf (FILE, "\tldd\t#LP%u\n\tjsr\tmcount\n", (LABELNO));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4515 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4516 +/* Stack pointer must be correct on function exit */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4517 +#define EXIT_IGNORE_STACK 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4518 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4519 +/*****************************************************************************
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4520 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4521 +** Trampolines for Nested Functions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4522 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4523 +*****************************************************************************/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4524 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4525 +/* Length in units of the trampoline for entering a nested function. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4526 +#define TRAMPOLINE_SIZE 7
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4527 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4528 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4529 + Addressing modes,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4530 + and classification of registers for them.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4531 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4532 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4533 +/* 6809 has postincrement and predecrement addressing modes */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4534 +#define HAVE_POST_INCREMENT 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4535 +#define HAVE_PRE_DECREMENT 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4536 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4537 +/* Whether or not to use index registers is configurable.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4538 + * Experiments show that things work better when this is off, so
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4539 + * that's the way it is for now. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4540 +#undef USE_INDEX_REGISTERS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4541 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4542 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4543 +/* Macros to check register numbers against specific register classes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4544 +#define REG_VALID_FOR_BASE_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4545 + (((REGNO) < FIRST_PSEUDO_REGISTER) && A_REGNO_P (REGNO))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4546 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4547 +/* MC6809 index registers do not allow scaling, */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4548 +/* but there is "accumulator-offset" mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4549 +#ifdef USE_INDEX_REGISTERS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4550 +#define REG_VALID_FOR_INDEX_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4551 + (((REGNO) < FIRST_PSEUDO_REGISTER) && I_REGNO_P (REGNO))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4552 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4553 +#define REG_VALID_FOR_INDEX_P(REGNO) 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4554 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4555 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4556 +/* Internal macro, the nonstrict definition for REGNO_OK_FOR_BASE_P */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4557 +#define REGNO_OK_FOR_BASE_NONSTRICT_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4558 + ((REGNO) >= FIRST_PSEUDO_REGISTER \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4559 + || REG_VALID_FOR_BASE_P (REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4560 + || (REGNO) == FRAME_POINTER_REGNUM \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4561 + || (REGNO) == HARD_FRAME_POINTER_REGNUM \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4562 + || (REGNO) == ARG_POINTER_REGNUM \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4563 + || (reg_renumber && REG_VALID_FOR_BASE_P (reg_renumber[REGNO])))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4564 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4565 +/* Internal macro, the nonstrict definition for REGNO_OK_FOR_INDEX_P */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4566 +#define REGNO_OK_FOR_INDEX_NONSTRICT_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4567 + ((REGNO) >= FIRST_PSEUDO_REGISTER \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4568 + || REG_VALID_FOR_INDEX_P (REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4569 + || (reg_renumber && REG_VALID_FOR_INDEX_P (reg_renumber[REGNO])))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4570 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4571 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4572 +/* Internal macro, the strict definition for REGNO_OK_FOR_BASE_P */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4573 +#define REGNO_OK_FOR_BASE_STRICT_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4574 + ((REGNO) < FIRST_PSEUDO_REGISTER ? REG_VALID_FOR_BASE_P (REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4575 + : (reg_renumber && REG_VALID_FOR_BASE_P (reg_renumber[REGNO])))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4576 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4577 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4578 +/* Internal macro, the strict definition for REGNO_OK_FOR_INDEX_P */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4579 +#define REGNO_OK_FOR_INDEX_STRICT_P(REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4580 + ((REGNO) < FIRST_PSEUDO_REGISTER ? REG_VALID_FOR_INDEX_P (REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4581 + : (reg_renumber && REG_VALID_FOR_INDEX_P (reg_renumber[REGNO])))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4582 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4583 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4584 +#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_BASE_STRICT_P (REGNO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4585 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4586 +#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_INDEX_STRICT_P (REGNO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4587 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4588 +#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_STRICT_P (REGNO (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4589 +#define REG_OK_FOR_BASE_NONSTRICT_P(X) REGNO_OK_FOR_BASE_NONSTRICT_P (REGNO (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4590 +#define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_STRICT_P (REGNO (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4591 +#define REG_OK_FOR_INDEX_NONSTRICT_P(X) REGNO_OK_FOR_INDEX_NONSTRICT_P (REGNO (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4592 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4593 +#ifndef REG_OK_STRICT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4594 +#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4595 +#ifdef USE_INDEX_REGISTERS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4596 +#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4597 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4598 +#define REG_OK_FOR_INDEX_P(X) 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4599 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4600 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4601 +#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4602 +#ifdef USE_INDEX_REGISTERS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4603 +#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4604 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4605 +#define REG_OK_FOR_INDEX_P(X) 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4606 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4607 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4608 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4609 +/* Maximum number of registers that can appear in a valid memory address */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4610 +#ifdef USE_INDEX_REGISTERS
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4611 +#define MAX_REGS_PER_ADDRESS 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4612 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4613 +#define MAX_REGS_PER_ADDRESS 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4614 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4615 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4616 +/* 1 if X is an rtx for a constant that is a valid address.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4617 + * We allow any constant, plus the sum of any two constants (this allows
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4618 + * offsetting a symbol ref) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4619 +#define CONSTANT_ADDRESS_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4620 + ((CONSTANT_P (X)) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4621 + || ((GET_CODE (X) == PLUS) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4622 + && (CONSTANT_P (XEXP (X, 0))) && (CONSTANT_P (XEXP (X, 1)))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4623 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4624 +/* Nonzero if the constant value X is a legitimate general operand.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4625 + It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4626 +/* Any single-word constant is ok; the only contexts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4627 + allowing general_operand of mode DI or DF are movdi and movdf. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4628 +#define LEGITIMATE_CONSTANT_P(X) (GET_CODE (X) != CONST_DOUBLE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4629 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4630 +/* Nonzero if the X is a legitimate immediate operand in PIC mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4631 +#define LEGITIMATE_PIC_OPERAND_P(X) !symbolic_operand (X, VOIDmode)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4632 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4633 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4634 + Test for valid memory addresses
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4635 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4636 +/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4637 + that is a valid memory address for an instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4638 + The MODE argument is the machine mode for the MEM expression
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4639 + that wants to use this address. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4640 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4641 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4642 + Valid addresses are either direct or indirect (MEM) versions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4643 + of the following forms.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4644 + constant N
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4645 + register ,X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4646 + constant indexed N,X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4647 + accumulator indexed D,X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4648 + auto_increment ,X++
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4649 + auto_decrement ,--X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4650 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4651 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4652 +#define REGISTER_ADDRESS_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4653 + (REG_P (X) && REG_OK_FOR_BASE_P (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4654 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4655 +#define EXTENDED_ADDRESS_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4656 + CONSTANT_ADDRESS_P (X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4657 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4658 +#define LEGITIMATE_BASE_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4659 + ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4660 + || (GET_CODE (X) == SIGN_EXTEND \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4661 + && GET_CODE (XEXP (X, 0)) == REG \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4662 + && GET_MODE (XEXP (X, 0)) == HImode \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4663 + && REG_OK_FOR_BASE_P (XEXP (X, 0))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4664 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4665 +#define LEGITIMATE_OFFSET_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4666 + (CONSTANT_ADDRESS_P (X) || (REG_P (X) && REG_OK_FOR_INDEX_P (X)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4667 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4668 +/* 1 if X is the sum of a base register and an offset. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4669 +#define INDEXED_ADDRESS(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4670 + ((GET_CODE (X) == PLUS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4671 + && LEGITIMATE_BASE_P (XEXP (X, 0)) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4672 + && LEGITIMATE_OFFSET_P (XEXP (X, 1))) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4673 + || (GET_CODE (X) == PLUS \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4674 + && LEGITIMATE_BASE_P (XEXP (X, 1)) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4675 + && LEGITIMATE_OFFSET_P (XEXP (X, 0))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4676 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4677 +#define STACK_REG_P(X) (REG_P(X) && REGNO(X) == HARD_S_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4678 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4679 +#define STACK_PUSH_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4680 + (MEM_P (X) && GET_CODE (XEXP (X, 0)) == PRE_DEC && STACK_REG_P (XEXP (XEXP (X, 0), 0)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4681 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4682 +#define STACK_POP_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4683 + (MEM_P (X) && GET_CODE (XEXP (X, 0)) == POST_INC && STACK_REG_P (XEXP (XEXP (X, 0), 0)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4684 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4685 +#define PUSH_POP_ADDRESS_P(X) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4686 + (((GET_CODE (X) == PRE_DEC) || (GET_CODE (X) == POST_INC)) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4687 + && (LEGITIMATE_BASE_P (XEXP (X, 0))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4688 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4689 +/* Go to ADDR if X is a valid address. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4690 +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4691 +{ \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4692 + if (REGISTER_ADDRESS_P(X)) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4693 + if (PUSH_POP_ADDRESS_P (X)) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4694 + if (EXTENDED_ADDRESS_P (X)) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4695 + if (INDEXED_ADDRESS (X)) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4696 + if (MEM_P (X) && REGISTER_ADDRESS_P(XEXP (X, 0))) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4697 + if (MEM_P (X) && PUSH_POP_ADDRESS_P (XEXP (X, 0))) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4698 + if (MEM_P (X) && EXTENDED_ADDRESS_P (XEXP (X, 0))) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4699 + if (MEM_P (X) && INDEXED_ADDRESS (XEXP (X, 0))) goto ADDR; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4700 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4701 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4702 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4703 + Address Fix-up
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4704 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4705 +/* Go to LABEL if ADDR (a legitimate address expression)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4706 + has an effect that depends on the machine mode it is used for.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4707 + In the latest GCC, this case is already handled by the core code
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4708 + so no action is required here. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4709 +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4710 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4711 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4712 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4713 + Miscellaneous Parameters
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4714 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4715 +/* Specify the machine mode that this machine uses
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4716 + for the index in the tablejump instruction. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4717 +#define CASE_VECTOR_MODE Pmode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4718 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4719 +/* Define this as 1 if `char' should by default be signed; else as 0. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4720 +#define DEFAULT_SIGNED_CHAR 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4721 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4722 +/* This flag, if defined, says the same insns that convert to a signed fixnum
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4723 + also convert validly to an unsigned one. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4724 +#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4725 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4726 +/* Max number of bytes we can move from memory to memory/register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4727 + in one reasonably fast instruction. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4728 +#define MOVE_MAX 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4729 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4730 +/* Int can be 8 or 16 bits (default is 16) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4731 +#define INT_TYPE_SIZE (TARGET_BYTE_INT ? 8 : 16)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4732 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4733 +/* Short is always 16 bits */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4734 +#define SHORT_TYPE_SIZE (TARGET_BYTE_INT ? 8 : 16)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4735 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4736 +/* Size (bits) of the type "long" on target machine */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4737 +#define LONG_TYPE_SIZE (TARGET_BYTE_INT ? 16 : 32)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4738 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4739 +/* Size (bits) of the type "long long" on target machine */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4740 +#define LONG_LONG_TYPE_SIZE 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4741 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4742 +/* Size (bits) of the type "char" on target machine */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4743 +#define CHAR_TYPE_SIZE 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4744 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4745 +/* Size (bits) of the type "float" on target machine */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4746 +#define FLOAT_TYPE_SIZE 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4747 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4748 +/* Size (bits) of the type "double" on target machine.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4749 + * Note that the C standard does not require that doubles
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4750 + * hold any more bits than float. Since the 6809 has so few
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4751 + * registers, we cannot really support more than 32-bits. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4752 +#define DOUBLE_TYPE_SIZE 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4753 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4754 +/* Size (bits) of the type "long double" on target machine */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4755 +#define LONG_DOUBLE_TYPE_SIZE 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4756 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4757 +/* Define the type used for "size_t". With a 64KB address space,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4758 + * only a 16-bit value here makes sense. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4759 +#define SIZE_TYPE (TARGET_BYTE_INT ? "long unsigned int" : "unsigned int")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4760 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4761 +/* Likewise, the difference between two pointers is also a 16-bit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4762 + * signed value. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4763 +#define PTRDIFF_TYPE (TARGET_BYTE_INT ? "long int" : "int")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4764 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4765 +/* Nonzero if access to memory by bytes is slow and undesirable. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4766 +#define SLOW_BYTE_ACCESS 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4767 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4768 +/* Define if shifts truncate the shift count
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4769 + which implies one can omit a sign-extension or zero-extension
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4770 + of a shift count. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4771 +#define SHIFT_COUNT_TRUNCATED 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4772 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4773 +/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4774 + is done just by pretending it is already truncated. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4775 +#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4776 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4777 +/* It is as good to call a constant function address as to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4778 + call an address kept in a register. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4779 +#define NO_FUNCTION_CSE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4780 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4781 +/* Specify the machine mode that pointers have.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4782 + After generation of rtl, the compiler makes no further distinction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4783 + between pointers and any other objects of this machine mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4784 +#define Pmode HImode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4785 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4786 +/* A function address in a call instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4787 + is a byte address (for indexing purposes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4788 + so give the MEM rtx a byte's mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4789 +#define FUNCTION_MODE HImode
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4790 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4791 +/* Define the cost of moving a value from a register in CLASS1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4792 + * to CLASS2, of a given MODE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4793 + *
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4794 + * On the 6809, hard register transfers are all basically equivalent.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4795 + * But soft register moves are treated more like memory moves. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4796 +#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4797 + (((CLASS1 == M_REGS) || (CLASS2 == M_REGS)) ? 4 : 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4798 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4799 +/* Define the cost of moving a value between a register and memory. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4800 +#define MEMORY_MOVE_COST(MODE, CLASS, IN) 5
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4801 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4802 +/* Check a `double' value for validity for a particular machine mode. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4803 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4804 +#define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4805 + ((OVERFLOW) = check_float_value (MODE, &D, OVERFLOW))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4806 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4807 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4808 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4809 + machine-dependent
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4810 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4811 +/* Tell final.c how to eliminate redundant test instructions. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4812 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4813 +/* Here we define machine-dependent flags and fields in cc_status
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4814 + (see `conditions.h'). */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4815 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4816 +/* Store in cc_status the expressions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4817 + that the condition codes will describe
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4818 + after execution of an instruction whose pattern is EXP.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4819 + Do not alter them if the instruction would not alter the cc's. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4820 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4821 +/* On the 6809, most of the insns to store in an address register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4822 + fail to set the cc's. However, in some cases these instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4823 + can make it possibly invalid to use the saved cc's. In those
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4824 + cases we clear out some or all of the saved cc's so they won't be used. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4825 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4826 +#define NOTICE_UPDATE_CC(EXP, INSN) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4827 + notice_update_cc((EXP), (INSN))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4828 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4829 +/*****************************************************************************
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4830 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4831 +** pragma support
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4832 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4833 +*****************************************************************************/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4834 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4835 +#if 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4836 +#define REGISTER_TARGET_PRAGMAS() \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4837 +do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4838 + extern void pragma_section PARAMS ((cpp_reader *)); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4839 + c_register_pragma (0, "section", pragma_section); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4840 +} while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4841 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4842 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4843 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4844 +/*--------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4845 + ASSEMBLER FORMAT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4846 +--------------------------------------------------------------*/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4847 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4848 +#define FMT_HOST_WIDE_INT "%ld"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4849 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4850 +/* Output to assembler file text saying following lines
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4851 + may contain character constants, extra white space, comments, etc. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4852 +#define ASM_APP_ON ";----- asm -----\n"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4853 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4854 +/* Output to assembler file text saying following lines
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4855 + no longer contain unusual constructs. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4856 +#define ASM_APP_OFF ";--- end asm ---\n"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4857 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4858 +/* Use a semicolon to begin a comment. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4859 +#define ASM_COMMENT_START "; "
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4860 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4861 +/* Output assembly directives to switch to section 'name' */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4862 +#undef TARGET_ASM_NAMED_SECTION
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4863 +#define TARGET_ASM_NAMED_SECTION m6809_asm_named_section
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4864 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4865 +#undef TARGET_HAVE_NAMED_SECTION
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4866 +#define TARGET_HAVE_NAMED_SECTION m6809_have_named_section
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4867 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4868 +/* Output before read-only data. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4869 +#define TEXT_SECTION_ASM_OP (code_section_op)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4870 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4871 +/* Output before writable data. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4872 +#define DATA_SECTION_ASM_OP (data_section_op)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4873 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4874 +/* Output before uninitialized data. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4875 +#define BSS_SECTION_ASM_OP (bss_section_op)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4876 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4877 +/* Support the ctors and dtors sections for g++. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4878 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4879 +#undef CTORS_SECTION_ASM_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4880 +#define CTORS_SECTION_ASM_OP "\t.area .ctors"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4881 +#undef DTORS_SECTION_ASM_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4882 +#define DTORS_SECTION_ASM_OP "\t.area .dtors"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4883 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4884 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4885 +#undef DO_GLOBAL_CTORS_BODY
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4886 +#undef DO_GLOBAL_DTORS_BODY
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4887 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4888 +#define HAS_INIT_SECTION
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4889 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4890 +/* This is how to output an assembler line
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4891 + that says to advance the location counter
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4892 + to a multiple of 2**LOG bytes. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4893 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4894 +#define ASM_OUTPUT_ALIGN(FILE,LOG) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4895 + if ((LOG) > 1) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4896 + fprintf (FILE, "\t.bndry %u\n", 1 << (LOG))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4897 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4898 +/* The .set foo,bar construct doesn't work by default */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4899 +#undef SET_ASM_OP
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4900 +#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4901 + do \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4902 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4903 + fputc ('\t', FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4904 + assemble_name (FILE, LABEL1); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4905 + fputs (" = ", FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4906 + assemble_name (FILE, LABEL2); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4907 + fputc ('\n', FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4908 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4909 + while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4910 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4911 +/* How to refer to registers in assembler output.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4912 + This sequence is indexed by compiler's hard-register-number (see above). */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4913 +#define MNAME(x) [SOFT_M0_REGNUM+(x)] = "*m" C_STRING(x) ,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4914 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4915 +#define REGISTER_NAMES { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4916 + [HARD_D_REGNUM]= "d", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4917 + [HARD_X_REGNUM]= "x", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4918 + [HARD_Y_REGNUM]= "y", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4919 + [HARD_U_REGNUM]= "u", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4920 + [HARD_S_REGNUM]= "s", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4921 + [HARD_PC_REGNUM]= "pc", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4922 + [HARD_A_REGNUM]= "a", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4923 + [HARD_B_REGNUM]= "b", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4924 + [HARD_CC_REGNUM]= "cc",\
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4925 + [HARD_DP_REGNUM]= "dp", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4926 + [SOFT_FP_REGNUM]= "soft_fp", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4927 + [SOFT_AP_REGNUM]= "soft_ap", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4928 + MNAME(0) MNAME(1) MNAME(2) MNAME(3) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4929 + MNAME(4) MNAME(5) MNAME(6) MNAME(7) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4930 + [HARD_RSVD1_REGNUM] = "-", \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4931 + [HARD_Z_REGNUM] = "z" /* bit 2 of CC */ }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4932 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4933 +/*****************************************************************************
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4934 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4935 +** Debug Support
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4936 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4937 +*****************************************************************************/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4938 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4939 +/* Default to DBX-style debugging */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4940 +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4941 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4942 +#define DBX_DEBUGGING_INFO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4943 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4944 +#define DEFAULT_GDB_EXTENSIONS 0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4945 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4946 +#define ASM_STABS_OP ";\t.stabs\t"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4947 +#define ASM_STABD_OP ";\t.stabd\t"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4948 +#define ASM_STABN_OP ";\t.stabn\t"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4949 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4950 +#define DBX_CONTIN_LENGTH 54
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4951 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4952 +#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(ASMFILE, FILENAME) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4953 +do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4954 + const char *p = FILENAME; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4955 + while ((p = strchr (p, '/')) != NULL) { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4956 + p = FILENAME = p+1; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4957 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4958 + fprintf (ASMFILE, "%s", ASM_STABS_OP); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4959 + output_quoted_string (ASMFILE, FILENAME); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4960 + fprintf (ASMFILE, ",%d,0,0,", N_SO); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4961 + assemble_name (ASMFILE, ltext_label_name); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4962 + fputc ('\n', ASMFILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4963 + switch_to_section (text_section); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4964 + (*targetm.asm_out.internal_label) (ASMFILE, "Ltext", 0); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4965 +} while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4966 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4967 +/* With -g, GCC sometimes outputs string literals that are longer than
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4968 + * the assembler can handle. Without actual debug support, these are
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4969 + * not really required. Redefine the function to output strings to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4970 + * output as much as possible. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4971 +#define OUTPUT_QUOTED_STRING(FILE, STR) m6809_output_quoted_string (FILE, STR)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4972 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4973 +/*****************************************************************************
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4974 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4975 +** Output and Generation of Labels
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4976 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4977 +*****************************************************************************/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4978 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4979 +/* Prefixes for various assembly-time objects */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4980 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4981 +#define REGISTER_PREFIX ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4982 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4983 +#define LOCAL_LABEL_PREFIX ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4984 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4985 +#define USER_LABEL_PREFIX "_"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4986 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4987 +#define IMMEDIATE_PREFIX "#"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4988 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4989 +/* This is how to output the definition of a user-level label named NAME,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4990 + such as the label on a static function or variable NAME. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4991 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4992 +#define ASM_OUTPUT_LABEL(FILE,NAME) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4993 +do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4994 + if (section_changed) { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4995 + fprintf (FILE, "\n%s\n\n", code_section_op); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4996 + section_changed = 0; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4997 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4998 + assemble_name (FILE, NAME); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
4999 + fputs (":\n", FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5000 +} while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5001 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5002 +/* This is how to output the label for a function definition. It
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5003 + invokes ASM_OUTPUT_LABEL, but may examine the DECL tree node for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5004 + other properties. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5005 +#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5006 + m6809_declare_function_name (FILE,NAME,DECL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5007 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5008 +/* This is how to output a command to make the user-level label
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5009 + named NAME defined for reference from other files. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5010 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5011 +#define GLOBAL_ASM_OP "\t.globl "
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5012 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5013 +/* This is how to output a reference to a user label named NAME. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5014 +#define ASM_OUTPUT_LABELREF(FILE,NAME) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5015 + fprintf (FILE, "_%s", NAME)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5016 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5017 +/* This is how to output a reference to a symbol ref
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5018 + * Check to see if the symbol is in the direct page */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5019 +#define ASM_OUTPUT_SYMBOL_REF(FILE,sym) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5020 +{ \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5021 + print_direct_prefix (FILE, sym); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5022 + assemble_name (FILE, XSTR (sym, 0)); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5023 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5024 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5025 +/* External references aren't necessary, so don't emit anything */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5026 +#define ASM_OUTPUT_EXTERNAL(FILE,DECL,NAME)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5027 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5028 +/* This is how to store into the string LABEL
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5029 + the symbol_ref name of an internal numbered label where
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5030 + PREFIX is the class of label and NUM is the number within the class.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5031 + This is suitable for output with `assemble_name'. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5032 +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5033 + sprintf (LABEL, "*%s%lu", PREFIX, (unsigned long int)NUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5034 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5035 +/* This is how to output an assembler line defining an `int' constant. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5036 +#define ASM_OUTPUT_INT(FILE,VALUE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5037 +( fprintf (FILE, "\t.word "), \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5038 + output_addr_const (FILE, (VALUE)), \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5039 + fprintf (FILE, "\n"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5040 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5041 +/* Likewise for `char' and `short' constants. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5042 +#define ASM_OUTPUT_SHORT(FILE,VALUE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5043 +( fprintf (FILE, "\t.word "), \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5044 + output_addr_const (FILE, (VALUE)), \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5045 + fprintf (FILE, "\n"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5046 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5047 +/* This is how to output a string. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5048 +#define ASM_OUTPUT_ASCII(FILE,STR,SIZE) m6809_output_ascii (FILE, STR, SIZE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5049 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5050 +/* This is how to output an insn to push a register on the stack.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5051 + It need not be very fast code. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5052 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5053 +#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5054 + fprintf (FILE, "\tpshs\t%s\n", reg_names[REGNO])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5055 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5056 +/* This is how to output an insn to pop a register from the stack.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5057 + It need not be very fast code. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5058 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5059 +#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5060 + fprintf (FILE, "\tpuls\t%s\n", reg_names[REGNO])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5061 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5062 +/* This is how to output an element of a case-vector that is absolute. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5063 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5064 +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5065 + fprintf (FILE, "\t.word L%u\n", VALUE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5066 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5067 +/* This is how to output an element of a case-vector that is relative. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5068 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5069 +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5070 + fprintf (FILE, "\t.word L%u-L%u\n", VALUE, REL)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5071 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5072 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5073 +/*****************************************************************************
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5074 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5075 +** Assembler Commands for Alignment
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5076 +**
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5077 +*****************************************************************************/
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5078 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5079 +/* ASM_OUTPUT_SKIP is supposed to zero initialize the data.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5080 + * So use the .byte and .word directives instead of .blkb */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5081 +#define ASM_OUTPUT_SKIP(FILE,SIZE) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5082 + do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5083 + int __size = SIZE; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5084 + while (__size > 0) { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5085 + if (__size >= 2) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5086 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5087 + fprintf (FILE, "\t.word\t0\t;skip space %d\n", __size); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5088 + __size -= 2; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5089 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5090 + else \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5091 + { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5092 + fprintf (FILE, "\t.byte\t0\t;skip space\n"); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5093 + __size--; \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5094 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5095 + } \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5096 + } while (0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5097 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5098 +/* This says how to output an assembler line
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5099 + to define a global common symbol. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5100 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5101 +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5102 + do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5103 + switch_to_section (bss_section); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5104 + fputs ("\t.globl\t", FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5105 + assemble_name ((FILE), (NAME)); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5106 + fputs ("\n", FILE); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5107 + assemble_name ((FILE), (NAME)); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5108 + fprintf ((FILE), ":\t.blkb\t" FMT_HOST_WIDE_INT "\n", (ROUNDED));} while(0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5109 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5110 +/* This says how to output an assembler line
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5111 + to define a local common symbol. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5112 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5113 +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5114 +do { \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5115 + switch_to_section (bss_section); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5116 + assemble_name ((FILE), (NAME)); \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5117 + fprintf ((FILE), ":\t.blkb\t" FMT_HOST_WIDE_INT "\n", (ROUNDED));} while(0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5118 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5119 +/* Store in OUTPUT a string (made with alloca) containing
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5120 + an assembler-name for a local static variable named NAME.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5121 + LABELNO is an integer which is different for each call. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5122 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5123 +#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5124 +( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5125 + sprintf ((OUTPUT), "%s.%lu", (NAME), (unsigned long int)(LABELNO)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5126 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5127 +/* Print an instruction operand X on file FILE.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5128 + CODE is the code from the %-spec for printing this operand.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5129 + If `%z3' was used to print operand 3, then CODE is 'z'. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5130 +#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5131 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5132 +/* Print a memory operand whose address is X, on file FILE. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5133 +#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5134 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5135 +/* Don't let stack pushes build up too much. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5136 +#define MAX_PENDING_STACK 8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5137 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5138 +/* Define values for builtin operations */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5139 +enum m6809_builtins
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5140 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5141 + M6809_SWI,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5142 + M6809_SWI2,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5143 + M6809_SWI3,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5144 + M6809_CWAI,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5145 + M6809_SYNC,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5146 + M6809_ADD_CARRY,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5147 + M6809_SUB_CARRY,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5148 + M6809_ADD_DECIMAL,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5149 + M6809_NOP,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5150 + M6809_BLOCKAGE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5151 +};
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5152 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5153 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.md gcc-4.6.4/gcc/config/m6809/m6809.md
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5154 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.md 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5155 +++ gcc-4.6.4/gcc/config/m6809/m6809.md 2015-07-20 22:05:21.702720231 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5156 @@ -0,0 +1,2359 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5157 +;; GCC machine description for Motorola 6809
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5158 +;; Copyright (C) 1989, 2005, 2006, 2007, 2008,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5159 +;; 2009 Free Software Foundation, Inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5160 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5161 +;; Mostly by Brian Dominy (brian@oddchange.com) with substantial renovations
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5162 +;; by William Astle (lost@l-w.ca).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5163 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5164 +;; Based on earlier work by Tom Jones (jones@sal.wisc.edu) and
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5165 +;; Matthias Doerfel (msdoerfe@informatik.uni-erlangen.de)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5166 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5167 +;; This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5168 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5169 +;; GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5170 +;; it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5171 +;; the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5172 +;; any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5173 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5174 +;; GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5175 +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5176 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5177 +;; GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5178 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5179 +;; You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5180 +;; along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5181 +;; <http://www.gnu.org/licenses/>.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5182 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5183 +;; General information:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5184 +;; --------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5185 +;; * This backend is mostly a rewrite from earlier (3.1.1 and before)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5186 +;; versions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5187 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5188 +;; * The 'A' and 'B' registers are treated as a single register by the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5189 +;; register allocator; hence, the instruction templates assume that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5190 +;; both can be modified if either one is available for use. No
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5191 +;; attempt is made to split instructions to refer to a particular half
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5192 +;; of the register. It is always referred to as the 'D' register, even
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5193 +;; in QImode (when it will be displayed as 'B').
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5194 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5195 +;; * There is full support for proper branch instruction generation,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5196 +;; based on instruction lengths. However, many instruction patterns
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5197 +;; are still overloaded to emit lots of real instructions, which can
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5198 +;; make the length calculation difficult; in those cases, I've tried
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5199 +;; to be pessimistic and assume the worst-case.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5200 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5201 +;; * The instruction type attributes are only defined for branch
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5202 +;; vs. non branch instructions for now, since there is seemingly no
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5203 +;; reason to define these for other types anyway.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5204 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5205 +;; * The limited number of total registers presents the greatest
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5206 +;; challenge. There are 'soft registers' -- memory locations
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5207 +;; used to simulate real regs -- which can be helpful.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5208 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5209 +;; * Position-independent code (PIC) is supported and has been tested
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5210 +;; but not to the extent of absolute code generation.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5211 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5212 +;; * All of the 6809 special opcodes, e.g. SWI and SYNC, are defined
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5213 +;; as UNSPEC instructions, and can be accessed from C code using
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5214 +;; __builtin_xxxx() style functions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5215 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5216 +;; What still needs to be done:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5217 +;; ----------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5218 +;; * Replace remaining instances of (define_peephole) with
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5219 +;; (define_peephole2), or remove them completely if they are not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5220 +;; matching anyway. Add more peepholes for things actually encountered.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5221 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5222 +;; * Indexing addressing can lead to crashes in complex functions when
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5223 +;; register pressure is high. Only the 'D' register can actually be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5224 +;; used as an index register, and its demand by other instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5225 +;; can sometimes mean that it is impossible to satisfy constraints.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5226 +;; Currently, indexing is completely disabled to avoid these types
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5227 +;; of problems, although code is slightly more inefficient in some
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5228 +;; working cases.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5229 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5230 +;; * 32-bit math is terribly inefficient.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5231 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5232 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5233 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5234 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5235 +;;- Constants
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5236 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5237 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5238 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5239 +; Define constants for hard register numbers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5240 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5241 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5242 + (HARD_RSVD1_REGNUM 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5243 + (HARD_X_REGNUM 1) (HARD_Y_REGNUM 2) (HARD_U_REGNUM 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5244 + (HARD_S_REGNUM 4) (HARD_PC_REGNUM 5) (HARD_D_REGNUM 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5245 + (HARD_Z_REGNUM 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5246 + (HARD_A_REGNUM 8) (HARD_B_REGNUM 9)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5247 + (HARD_CC_REGNUM 10) (HARD_DP_REGNUM 11)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5248 + (SOFT_FP_REGNUM 12) (SOFT_AP_REGNUM 13)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5249 + (SOFT_M0_REGNUM 14) (SOFT_M1_REGNUM 15)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5250 + (SOFT_M2_REGNUM 16) (SOFT_M3_REGNUM 17)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5251 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5252 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5253 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5254 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5255 +; The range in which a short branch insn can be used.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5256 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5257 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5258 + (MIN_SHORT_BRANCH_OFFSET -127)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5259 + (MAX_SHORT_BRANCH_OFFSET 128)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5260 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5261 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5262 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5263 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5264 +; The lengths of various types of real 6809 instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5265 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5266 +; By default, ordinary insns are 4 bytes long. This is often not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5267 +; right, and the insn patterns below will redefine this to the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5268 +; correct value.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5269 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5270 +; Branch instruction lengths (conditional and unconditionals) are
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5271 +; well known and declared here. The short insns are used when the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5272 +; offset is within the range declared above (between MIN_SHORT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5273 +; and MAX_SHORT) ; otherwise the long form is used.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5274 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5275 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5276 + (DEFAULT_INSN_LENGTH 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5277 + (SHORT_CBRANCH_LENGTH 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5278 + (LONG_CBRANCH_LENGTH 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5279 + (SHORT_BRANCH_LENGTH 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5280 + (LONG_BRANCH_LENGTH 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5281 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5282 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5283 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5284 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5285 +; Constants for insn cycle counts.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5286 +; Note that these counts all assume 1-byte opcodes. 2-byte
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5287 +; opcodes require 1 extra cycles for fetching the extra byte.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5288 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5289 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5290 + ;; The default insn length, when it cannot be calculated.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5291 + ;; Take a conservative approach and estimate high.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5292 + (DEFAULT_INSN_CYCLES 10)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5293 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5294 + ;; Cycle counts for ALU and load operations.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5295 + (ALU_INHERENT_CYCLES 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5296 + (ALU_IMMED_CYCLES 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5297 + (ALU_DIRECT_CYCLES 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5298 + (ALU_INDEXED_BASE_CYCLES 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5299 + (ALU_EXTENDED_CYCLES 5)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5300 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5301 + ;; If an ALU operation is on a 16-bit register (D), then
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5302 + ;; add this number of cycles to the total count.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5303 + (ALU_16BIT_CYCLES 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5304 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5305 + ;; A load of a 16-bit register incurs this extra amount.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5306 + (LOAD_16BIT_CYCLES 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5307 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5308 + ;; Cycle counts for memory-only operations (bit shifts, clear, test)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5309 + (MEM_DIRECT_CYCLES 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5310 + (MEM_INDEXED_BASE_CYCLES 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5311 + (MEM_EXTENDED_CYCLES 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5312 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5313 + ;; Cycle count for any reg-reg transfer (regardless of size)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5314 + (EXG_CYCLES 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5315 + (TFR_CYCLES 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5316 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5317 + ;; Cycle count for a condition code update (andcc/orcc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5318 + (CC_CYCLES 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5319 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5320 + (JMP_DIRECT_CYCLES 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5321 + (JMP_INDEXED_BASE_CYCLES 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5322 + (JMP_EXTENDED_CYCLES 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5323 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5324 + (JSR_DIRECT_CYCLES 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5325 + (JSR_INDEXED_BASE_CYCLES 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5326 + (JSR_EXTENDED_CYCLES 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5327 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5328 + (LEA_BASE_CYCLES 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5329 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5330 + ;; Cycle count for a psh/pul operations. Add to this the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5331 + ;; total number of bytes moved for the correct count.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5332 + (PSH_PUL_CYCLES 5)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5333 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5334 + ;; Miscellaneous cycle counts
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5335 + (CWAI_CYCLES 20)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5336 + (MUL_CYCLES 11)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5337 + (NOP_CYCLES 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5338 + (RTI_CYCLES 15)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5339 + (RTS_CYCLES 5)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5340 + (SWI_CYCLES 20)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5341 + (SYNC_CYCLES 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5342 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5343 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5344 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5345 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5346 +; An enumeration of values for each "unspec"; i.e. unspecified
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5347 +; instruction. These represent insns that are meaningful on the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5348 +; 6809 but which have no intrinsic meaning to GCC itself.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5349 +; These insns can be generated explicitly using the __builtin_xxx
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5350 +; syntax; they are also implicitly generated by the backend
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5351 +; as needed to implement other insns.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5352 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5353 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5354 + (UNSPEC_BLOCKAGE 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5355 + (UNSPEC_PUSH_RS 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5356 + (UNSPEC_POP_RS 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5357 + (UNSPEC_SWI 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5358 + (UNSPEC_CWAI 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5359 + (UNSPEC_ADD_CARRY 5)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5360 + (UNSPEC_SUB_CARRY 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5361 + (UNSPEC_SYNC 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5362 + (UNSPEC_ADD_DECIMAL 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5363 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5364 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5365 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5366 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5367 +;;- Predicates
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5368 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5369 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5370 +(include "predicates.md")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5371 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5372 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5373 +;;- Attributes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5374 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5375 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5376 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5377 +;; The type attribute is used to distinguish between different
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5378 +;; types of branch instructions, so that their lengths can be
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5379 +;; calculated correctly.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5380 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5381 +(define_attr "type" "branch,cbranch,unknown" (const_string "unknown"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5382 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5383 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5384 +;; The length of a branch instruction is calculated based on how
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5385 +;; far away the branch target is. Lengths of other insns default
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5386 +;; to 4. set_attr is used in instruction templates to specify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5387 +;; the length when it is known exactly. When not sure, err on
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5388 +;; the high side to avoid compile errors.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5389 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5390 +(define_attr "length" ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5391 + (cond [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5392 + (eq_attr "type" "branch")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5393 + (if_then_else (lt (minus (match_dup 0) (pc))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5394 + (const_int MIN_SHORT_BRANCH_OFFSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5395 + (const_int LONG_BRANCH_LENGTH)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5396 + (if_then_else (gt (minus (match_dup 0) (pc))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5397 + (const_int MAX_SHORT_BRANCH_OFFSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5398 + (const_int LONG_BRANCH_LENGTH)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5399 + (const_int SHORT_BRANCH_LENGTH)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5400 + (eq_attr "type" "cbranch")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5401 + (if_then_else (lt (minus (match_dup 0) (pc))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5402 + (const_int MIN_SHORT_BRANCH_OFFSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5403 + (const_int LONG_CBRANCH_LENGTH)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5404 + (if_then_else (gt (minus (match_dup 0) (pc))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5405 + (const_int MAX_SHORT_BRANCH_OFFSET))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5406 + (const_int LONG_CBRANCH_LENGTH)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5407 + (const_int SHORT_CBRANCH_LENGTH)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5408 + ] (const_int DEFAULT_INSN_LENGTH)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5409 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5410 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5411 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5412 +;; The default attributes for 'asm' statements.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5413 +;; The default length is the longest possible single 6809 instruction,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5414 +;; which is 5 bytes. GCC will automatically multiply this by the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5415 +;; number of real insns contained in an asm statement.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5416 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5417 +(define_asm_attributes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5418 + [(set_attr "length" "5")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5419 + (set_attr "type" "unknown")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5420 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5421 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5422 +;; An attribute for the number of cycles that it takes an instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5423 +;; to execute.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5424 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5425 +(define_attr "cycles" "" (const_int DEFAULT_INSN_CYCLES))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5426 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5427 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5428 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5429 +;;- Instruction patterns. When multiple patterns apply,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5430 +;;- the first one in the file is chosen.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5431 +;;-
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5432 +;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5433 +;;-
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5434 +;;- Note: NOTICE_UPDATE_CC in m6809.h handles condition code updates
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5435 +;;- for most instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5436 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5437 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5438 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5439 +;;- Test
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5440 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5441 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5442 +;; cmpx is 3 bytes, not 4
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5443 +(define_insn "*tsthi_x"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5444 + [(set (cc0) (match_operand:HI 0 "register_operand_x" "v"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5445 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5446 + "cmpx\t#0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5447 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5448 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5449 +;; subd #0 is 3 bytes, better than cmpd #0 which is 4 bytes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5450 +(define_insn "*tsthi_d"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5451 + [(set (cc0) (match_operand:HI 0 "register_operand_d" "d"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5452 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5453 + "subd\t#0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5454 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5455 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5456 +(define_insn "*tsthi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5457 + [(set (cc0) (match_operand:HI 0 "register_operand" "a"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5458 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5459 + "cmp%0\t#0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5460 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5461 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5462 +(define_insn "*bitqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5463 + [(set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5464 + (and:QI (match_operand:QI 0 "register_operand" "%q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5465 + (match_operand:QI 1 "general_operand" "mi")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5466 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5467 + "bit%0\t%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5468 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5469 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5470 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5471 +(define_insn "tstqi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5472 + [(set (cc0) (match_operand:QI 0 "nonimmediate_operand" "q,mt"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5473 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5474 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5475 + tst%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5476 + tst\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5477 + [(set_attr "length" "1,3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5478 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5479 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5480 +;;- Compare instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5481 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5482 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5483 +;; - cmphi for register to memory or register compares
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5484 +(define_insn "cmphi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5485 + [(set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5486 + (compare
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5487 + (match_operand:HI 0 "general_operand" "da, mi, ??Ud")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5488 + (match_operand:HI 1 "general_operand" "mi, da, dU")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5489 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5490 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5491 + if ((REG_P (operands[0])) && (REG_P (operands[1]))) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5492 + output_asm_insn ("pshs\t%1\t;cmphi: R:%1 with R:%0", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5493 + return "cmp%0\t,s++\t;cmphi:";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5494 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5495 + if (GET_CODE (operands[0]) == REG)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5496 + return "cmp%0\t%1\t;cmphi:";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5497 + else {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5498 + cc_status.flags |= CC_REVERSED;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5499 + return "cmp%1\t%0\t;cmphi:(R)";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5500 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5501 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5502 + [(set_attr "length" "5,5,7")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5503 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5504 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5505 +(define_insn "cmpqi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5506 + [(set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5507 + (compare (match_operand:QI 0 "whole_general_operand" "q,q, q,O,mt,K")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5508 + (match_operand:QI 1 "whole_general_operand" "O,mt,K,q,q, q")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5509 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5510 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5511 + if (REG_P (operands[0]) && !M_REG_P (operands[0]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5512 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5513 + if (operands[1] == const0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5514 + return "tst%0\t;cmpqi:(ZERO)";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5515 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5516 + return "cmp%0\t%1\t;cmpqi:";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5517 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5518 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5519 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5520 + cc_status.flags |= CC_REVERSED;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5521 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5522 + if (operands[0] == const0_rtx)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5523 + return "tst%1\t;cmpqi:(RZERO)";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5524 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5525 + return "cmp%1\t%0\t;cmpqi:(R)";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5526 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5527 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5528 + [(set_attr "length" "1,3,2,1,3,2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5529 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5530 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5531 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5532 +;;- Compare/branch pattern
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5533 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5534 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5535 +(define_expand "cbranchhi4"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5536 + [(set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5537 + (compare
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5538 + (match_operand:HI 1 "general_operand" "da, mi, ??Ud")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5539 + (match_operand:HI 2 "general_operand" "mi, da, dU")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5540 + (set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5541 + (if_then_else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5542 + (match_operator 0 "ordered_comparison_operator" [(cc0) (const_int 0)])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5543 + (label_ref (match_operand 3 "" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5544 + (pc)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5545 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5546 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5547 +)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5548 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5549 +(define_expand "cbranchqi4"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5550 + [(set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5551 + (compare
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5552 + (match_operand:QI 1 "whole_general_operand" "q,q, q,O,mt,K")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5553 + (match_operand:QI 2 "whole_general_operand" "O,mt,K,q,q, q")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5554 + (set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5555 + (if_then_else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5556 + (match_operator 0 "ordered_comparison_operator" [(cc0) (const_int 0)])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5557 + (label_ref (match_operand 3 "" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5558 + (pc)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5559 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5560 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5561 +)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5562 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5563 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5564 +;;- Move
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5565 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5566 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5567 +; this looks good (obviously not finished) but I still see 'movsi'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5568 +; places in udivsi3 where it's broken
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5569 +; (define_insn "pushsi1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5570 +; [(set (mem:SI (pre_dec (reg:HI HARD_S_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5571 +; (match_operand:SI 0 "general_operand" "o"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5572 +; (set (reg:HI HARD_S_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5573 +; (plus:HI (reg:HI HARD_S_REGNUM) (const_int -4))) ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5574 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5575 +; "; pushsi %0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5576 +; [(set_attr "length" "12")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5577 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5578 +; (define_insn "popsi1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5579 +; [(set (match_operand:SI 0 "general_operand" "=o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5580 +; (mem:SI (post_inc (reg:HI HARD_S_REGNUM))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5581 +; (set (reg:HI HARD_S_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5582 +; (plus:HI (reg:HI HARD_S_REGNUM) (const_int 4))) ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5583 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5584 +; "; popsi %0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5585 +; [(set_attr "length" "12")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5586 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5587 +; (define_insn "movsi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5588 +; [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5589 +; (match_operand:SI 1 "general_operand" " oi"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5590 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5591 +; "; movsi %0 <- %1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5592 +; [(set_attr "length" "1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5593 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5594 +; this doesn't work
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5595 +; (define_expand "movsi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5596 +; [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5597 +; (set (match_operand:SI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5598 +; (match_operand:SI 1 "general_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5599 +; (clobber (match_scratch:HI 2 ""))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5600 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5601 +; {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5602 +; rtx insn;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5603 +; if (STACK_PUSH_P (operands[0]) || STACK_POP_P (operands[1]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5604 +; {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5605 +; REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5606 +; }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5607 +; insn = emit_move_multi_word (SImode, operands[0], operands[1]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5608 +; DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5609 +; })
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5610 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5611 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5612 +(define_expand "movhi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5613 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5614 + (match_operand:HI 1 "general_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5615 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5616 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5617 + /* One of the ops has to be in a register prior to reload */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5618 + if (!register_operand (operand0, HImode) &&
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5619 + !register_operand (operand1, HImode))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5620 + operands[1] = copy_to_mode_reg (HImode, operand1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5621 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5622 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5623 +;;; Try a splitter to handle failure cases where we try to move
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5624 +;;; an immediate constant (zero usually) directly to memory.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5625 +;;; This absolutely requires an intermediate register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5626 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5627 + [(set (match_operand:HI 0 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5628 + (match_operand:HI 1 "immediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5629 + (clobber (match_operand:HI 2 "register_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5630 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5631 + [(set (match_dup 2) (match_dup 1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5632 + (set (match_dup 0) (match_dup 2))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5633 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5634 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5635 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5636 +;;; This would be a nice method for loading from a word array,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5637 +;;; but it is never generated because the combiner cannot merge
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5638 +;;; more than 3 instructions (there are four here). This is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5639 +;;; perhaps better done via a peephole.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5640 +(define_insn "*movhi_array_load"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5641 + [(set (match_operand:HI 0 "nonimmediate_operand" "=da")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5642 + (mem:HI (plus:HI (ashift:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%B")) (const_int 1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5643 + (match_operand:HI 2 "immediate_operand" "i"))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5644 + (clobber (match_scratch:HI 3 "=X"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5645 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5646 + "ldx\t%2\;abx\;abx\;ld%0\t,x"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5647 + [(set_attr "length" "7")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5648 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5649 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5650 +;;; Optimize the move of a byte to the stack using the pshs instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5651 +;;; instead of a store with pre-increment.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5652 +(define_insn "movhi_push"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5653 + [(set (match_operand:HI 0 "push_operand" "=m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5654 + (match_operand:HI 1 "register_operand" "U"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5655 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5656 + "pshs\t%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5657 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5658 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5659 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5660 +(define_insn "*movhi_pic_symbolref"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5661 + [(set (match_operand:HI 0 "register_operand" "=a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5662 + (match_operand:HI 1 "symbolic_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5663 + "flag_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5664 + "lea%0\t%c1,pcr"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5665 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5666 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5667 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5668 +(define_insn "*movhi_1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5669 + [(set (match_operand:HI 0 "nonimmediate_operand" "=a,d,a,ad,mu")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5670 + (match_operand:HI 1 "general_operand" " a,a,d,miu,ad"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5671 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5672 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5673 + lea%0\t,%1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5674 + tfr\t%1,%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5675 + tfr\t%1,%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5676 + ld%0\t%1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5677 + st%1\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5678 + [(set_attr "length" "2,2,2,*,*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5679 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5680 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5681 +;;; Generated by the combiner to merge an address calculation with
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5682 +;;; a byte load. We can use the 'abx' instruction here.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5683 +(define_insn "*movqi_array_load"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5684 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5685 + (mem:QI (plus:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%B"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5686 + (match_operand:HI 2 "immediate_operand" "i"))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5687 + (clobber (match_scratch:HI 3 "=X"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5688 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5689 + "ldx\t%2\;abx\;ld%0\t,x"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5690 + [(set_attr "length" "6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5691 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5692 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5693 +;;; Optimize the move of a byte to the stack using the pshs instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5694 +;;; instead of a store with pre-increment.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5695 +(define_insn "movqi_push"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5696 + [(set (match_operand:QI 0 "push_operand" "=m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5697 + (match_operand:QI 1 "register_operand" " q"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5698 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5699 + "pshs\t%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5700 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5701 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5702 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5703 +;;; Optimize the move of a byte from the stack using the puls instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5704 +;;; instead of a store with post-decrement.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5705 +(define_insn "movqi_pop"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5706 + [(set (match_operand:QI 0 "register_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5707 + (match_operand:QI 1 "pop_operand" "m"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5708 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5709 + "puls\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5710 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5711 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5712 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5713 +;;- load low byte of 16-bit data into 8-bit register/memory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5714 +(define_insn "*mov_lsb"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5715 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,m,!q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5716 + (subreg:QI (match_operand:HI 1 "general_operand" "d,m,a,d, U") 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5717 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5718 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5719 + \t;movlsbqihi: D->B
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5720 + ld%0\t%L1\t;movlsbqihi: msb:%1 -> R:%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5721 + tfr\t%1,d\t;movlsbqihi: R:%1 -> R:%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5722 + stb\t%0\t;movlsbqihi: R:%1 -> %0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5723 + pshs\t%1\t;movlsbqihi: R:%1 -> R:%0\;leas\t1,s\;puls\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5724 + [(set_attr "length" "0,*,2,*,6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5725 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5726 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5727 +;;- load high byte of 16-bit data into 8-bit register/memory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5728 +(define_insn "*mov_msb"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5729 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,q,m,!q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5730 + (subreg:QI (match_operand:HI 1 "general_operand" "d,O,a,m,d, U") 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5731 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5732 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5733 + tfr\ta,b\t;movmsbqihi: D->B
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5734 + clr%0\t\t;movmsbqihi: ZERO -> R:%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5735 + tfr\t%1,d\t;movmsbqihi: R:%1 -> R:%0\;tfr\ta,b
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5736 + ld%0\t%L1\t;movmsbqihi: lsb:%1 -> R:%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5737 + sta\t%0\t;movmsbqihi: R:%1 -> %0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5738 + pshs\t%1\t;movmsbqihi: R:%1 -> R:%0\;puls\t%0\;leas\t1,s"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5739 + [(set_attr "length" "2,1,4,*,*,6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5740 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5741 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5742 +(define_insn "*movqi_boolean"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5743 + [(set (reg:QI HARD_Z_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5744 + (match_operand:QI 0 "general_operand" "q,O,i,m"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5745 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5746 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5747 + tst%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5748 + andcc\t#~4
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5749 + orcc\t#4
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5750 + tst\t%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5751 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5752 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5753 +(define_insn "movqi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5754 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,m,q,m,q,z")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5755 + (match_operand:QI 1 "general_operand" " q,O,O,mi,q,z,q"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5756 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5757 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5758 + tfr\t%1,%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5759 + clr%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5760 + clr\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5761 + ld%0\t%1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5762 + st%1\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5763 + tfr\tcc,%0\;and%0\t#4
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5764 + tst%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5765 + [(set_attr "length" "2,1,3,*,*,4,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5766 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5767 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5768 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5769 +;;- Swap registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5770 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5771 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5772 +; Note: 8-bit swap is never needed so it is not defined.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5773 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5774 +(define_insn "swaphi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5775 + [(set (match_operand:HI 0 "register_operand" "+r")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5776 + (match_operand:HI 1 "register_operand" "+r"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5777 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5778 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5779 + "exg\t%1,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5780 + [(set_attr "length" "2")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5781 + (set (attr "cycles") (const_int EXG_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5782 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5783 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5784 +(define_insn "bswaphi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5785 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5786 + (bswap:HI (match_operand:HI 1 "register_operand" "0")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5787 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5788 + "exg\ta,b"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5789 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5790 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5791 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5792 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5793 +;;- Extension and truncation insns.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5794 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5795 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5796 +(define_insn "extendqihi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5797 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5798 + (sign_extend:HI (match_operand:QI 1 "general_operand" "B")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5799 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5800 + "sex\t\t;extendqihi2: R:%1 -> R:%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5801 + [(set_attr "length" "1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5802 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5803 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5804 +(define_insn "zero_extendqihi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5805 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5806 + (zero_extend:HI (match_operand:QI 1 "general_operand" "B")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5807 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5808 + "clra\t\t;zero_extendqihi: R:%1 -> R:%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5809 + [(set_attr "length" "1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5810 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5811 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5812 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5813 +;;- All kinds of add instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5814 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5815 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5816 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5817 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5818 +;; gcc's automatic version of addsi3 doesn't know about adcb,adca
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5819 +;; so it is MUCH less efficient. Define this one ourselves.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5820 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5821 +;; TODO - can't always get 'd' for the clobber... allow other registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5822 +;; as well and use exg d,R ... exg R,d around the code sequence to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5823 +;; use others, at a price. Also consider libcall for this when
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5824 +;; optimizing for size.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5825 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5826 +(define_insn "addsi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5827 + [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5828 + (plus:SI (match_operand:SI 1 "general_operand" "%o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5829 + (match_operand:SI 2 "general_operand" " oi")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5830 + (clobber (match_scratch:HI 3 "=d"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5831 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5832 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5833 + m6809_output_addsi3 (PLUS, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5834 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5835 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5836 + [(set_attr "length" "21")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5837 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5838 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5839 +; Increment of a 16-bit MEM by 1 can be done without a register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5840 +(define_insn "*addhi_mem_1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5841 + [(set (match_operand:HI 0 "memory_operand" "=m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5842 + (plus:HI (match_operand:HI 1 "memory_operand" "0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5843 + "GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5844 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5845 + rtx xoperands[2];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5846 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5847 + xoperands[0] = operands[0];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5848 + xoperands[1] = adjust_address (operands[0], QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5849 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5850 + output_asm_insn ("inc\t%1", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5851 + output_asm_insn ("bne\t__IL%=", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5852 + output_asm_insn ("inc\t%0\;__IL%=:", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5853 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5854 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5855 + [(set_attr "length" "7")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5856 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5857 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5858 +; Decrement of a 16-bit MEM by 1 can be done without a register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5859 +(define_insn "*addhi_mem_minus1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5860 + [(set (match_operand:HI 0 "memory_operand" "=m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5861 + (plus:HI (match_operand:HI 1 "memory_operand" "0") (const_int -1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5862 + "GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5863 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5864 + rtx xoperands[2];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5865 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5866 + xoperands[0] = operands[0];
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5867 + xoperands[1] = adjust_address (operands[0], QImode, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5868 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5869 + output_asm_insn ("tst\t%1", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5870 + output_asm_insn ("bne\t__IL%=", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5871 + output_asm_insn ("dec\t%0", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5872 + output_asm_insn ("__IL%=:", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5873 + output_asm_insn ("dec\t%1", xoperands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5874 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5875 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5876 + [(set_attr "length" "7")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5877 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5878 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5879 +; Allow the addition of an 8-bit quantity to a 16-bit quantity
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5880 +; using the LEAX B,Y addressing mode, where X and Y are both
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5881 +; index registers. This will only get generated via the peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5882 +; which removes a sign extension.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5883 +(define_insn "*addhi_b"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5884 + [(set (match_operand:HI 0 "index_register_operand" "=a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5885 + (plus:HI(match_operand:HI 1 "index_register_operand" "%a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5886 + (match_operand:QI 2 "register_operand" "q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5887 + ))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5888 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5889 + "lea%0\t%2,%1\t;addhi_b: R:%0 = R:%2 + R:%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5890 + [(set_attr "length" "*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5891 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5892 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5893 +; Splitter for addhi pattern #5 below
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5894 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5895 + [(set (match_operand:HI 0 "index_register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5896 + (plus:HI (match_dup 0) (match_operand:HI 1 "memory_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5897 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5898 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5899 + (parallel [(set (match_dup 0) (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5900 + (set (reg:HI HARD_D_REGNUM) (match_dup 0))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5901 + (set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5902 + (plus:HI (reg:HI HARD_D_REGNUM) (match_dup 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5903 + (parallel [(set (match_dup 0) (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5904 + (set (reg:HI HARD_D_REGNUM) (match_dup 0))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5905 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5906 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5907 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5908 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5909 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5910 +; Splitter for addhi pattern #7 below
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5911 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5912 + [(set (match_operand:HI 0 "index_register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5913 + (plus:HI (match_dup 0) (match_operand:HI 1 "index_register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5914 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5915 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5916 + (parallel [(set (match_dup 1) (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5917 + (set (reg:HI HARD_D_REGNUM) (match_dup 1))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5918 + (set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5919 + (plus:HI (reg:HI HARD_D_REGNUM) (match_dup 0)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5920 + (parallel [(set (match_dup 1) (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5921 + (set (reg:HI HARD_D_REGNUM) (match_dup 1))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5922 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5923 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5924 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5925 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5926 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5927 +; TODO - this is ugly. During RTL generation, we don't know what registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5928 +; are available, so the multiple-insn sequences can only be solved
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5929 +; via 'define_split's during matching. See andhi3 for an example.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5930 +; Keep the constraints with ? modifiers to help reload pick the right
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5931 +; registers.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5932 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5933 +; The forms are:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5934 +; 1. D += D, expand this into a shift instead. (rtx costs should be corrected
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5935 +; to avoid this even happening...)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5936 +; 2. D += U, require U to be pushed to memory. (Lots of patterns do this
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5937 +; now, is this a better way?)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5938 +; 3. Best choice: 'addd'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5939 +; 4. Next best choice: 'lea'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5940 +; 5. Hybrid of 3 and 4
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5941 +; 6. Same as 4, not bad
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5942 +; 7. BAD, no D register at all
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5943 +; 8. 'lea', as good as 4.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5944 +(define_insn "addhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5945 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d, d, d, a,?a, a,???T,a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5946 + (plus:HI(match_operand:HI 1 "add_general_operand" "%0, 0, 0, d, 0, a, 0, a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5947 + (match_operand:HI 2 "general_operand" " 0, !U, mi, a, m, d, T, i")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5948 + ))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5949 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5950 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5951 + lslb\t\t;addhi: R:%0 += R:%2\;rola\t\t;also R:%0 *= 2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5952 + pshs\t%2\t;addhi: R:%0 += R:%2\;add%0\t,s++
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5953 + add%0\t%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5954 + lea%0\t%1,%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5955 + #
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5956 + lea%0\t%2,%1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5957 + #
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5958 + lea%0\t%a2,%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5959 + [(set_attr "length" "2,6,*,*,7,*,7,*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5960 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5961 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5962 +(define_insn "addqi3_carry"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5963 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5964 + (unspec:QI [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5965 + (match_operand:QI 1 "whole_general_operand" "%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5966 + (match_operand:QI 2 "whole_general_operand" "tmi")] UNSPEC_ADD_CARRY))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5967 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5968 + "adc%0\t%2\t;addqi_carry: R:%0 += %2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5969 + [(set_attr "length" "*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5970 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5971 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5972 +; TODO: specifying 'A' for the first constraint, to force into the A register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5973 +; is not working because of the way registers are currently set up. This will
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5974 +; take some work to get right. Thus the second alternative as a backup.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5975 +(define_insn "addqi3_decimal"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5976 + [(set (match_operand:QI 0 "nonimmediate_operand" "=A,?q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5977 + (unspec:QI [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5978 + (match_operand:QI 1 "general_operand" "%0,0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5979 + (match_operand:QI 2 "general_operand" "mi,mi")] UNSPEC_ADD_DECIMAL))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5980 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5981 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5982 + adda\t%2\;daa
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5983 + tfr\t%0,a\;adda\t%2\;daa\;tfr\ta,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5984 + [(set_attr "length" "5,9")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5985 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5986 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5987 +(define_insn "addqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5988 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,m,m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5989 + (plus:QI (match_operand:QI 1 "whole_general_operand" "%0,0,0,0,0,0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5990 + (match_operand:QI 2 "whole_general_operand" " 0,I,N,I,N,mi")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5991 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5992 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5993 + asl%0\t\t;addqi: R:%0 = R:%0 + R:%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5994 + inc%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5995 + dec%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5996 + inc\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5997 + dec\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5998 + add%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
5999 + [(set_attr "length" "1,1,1,3,3,*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6000 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6001 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6002 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6003 +;;- Subtract instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6004 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6005 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6006 +(define_insn "subsi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6007 + [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6008 + (minus:SI (match_operand:SI 1 "general_operand" " o")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6009 + (match_operand:SI 2 "general_operand" " oi")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6010 + (clobber (match_scratch:HI 3 "=d"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6011 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6012 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6013 + m6809_output_addsi3 (MINUS, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6014 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6015 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6016 + [(set_attr "length" "21")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6017 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6018 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6019 +(define_insn "subhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6020 + [(set (match_operand:HI 0 "register_operand" "=d, d, a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6021 + (minus:HI (match_operand:HI 1 "register_operand" "0, 0, 0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6022 + (match_operand:HI 2 "general_operand" "mi, ?U,n")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6023 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6024 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6025 + sub%0\t%2\t;subhi: R:%0 -= %2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6026 + pshs\t%2\t;subhi: R:%0 -= R:%2\;sub%0\t,s++
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6027 + lea%0\t%n2,%1\t;subhi: R:%0 = R:%1 + %n2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6028 + [(set_attr "length" "*,5,3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6029 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6030 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6031 +(define_insn "subqi3_carry"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6032 + [(set (match_operand:QI 0 "register_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6033 + (unspec:QI [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6034 + (match_operand:QI 1 "whole_general_operand" "%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6035 + (match_operand:QI 2 "whole_general_operand" "tmi")] UNSPEC_SUB_CARRY))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6036 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6037 + "sbc%0\t%2\t;subqi_carry: R:%0 += %2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6038 + [(set_attr "length" "*")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6039 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6040 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6041 +(define_insn "subqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6042 + [(set (match_operand:QI 0 "register_operand" "=q, q, !q, !q, q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6043 + (minus:QI (match_operand:QI 1 "whole_register_operand" "0, 0, I, tmn, 0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6044 + (match_operand:QI 2 "whole_general_operand" "I, mi, 0, 0, t")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6045 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6046 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6047 + dec%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6048 + sub%0\t%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6049 + dec%0\;neg%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6050 + sub%0\t%1\;neg%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6051 + sub%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6052 + [(set_attr "length" "1,3,2,4,3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6053 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6054 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6055 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6056 +;;- Multiply instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6057 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6058 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6059 +; TODO - merge these two instructions, using 'extend_operator' to match
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6060 +; either signed or zero extension. Everything else is the same.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6061 +(define_insn "mulqihi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6062 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6063 + (mult:HI (sign_extend:HI (match_operand:QI 1 "general_operand" "%q"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6064 + (match_operand:QI 2 "general_operand" "tmK")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6065 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6066 + "lda\t%2\t;mulqihi3\;mul"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6067 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6068 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6069 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6070 +(define_insn "umulqihi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6071 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6072 + (mult:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "%q"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6073 + (match_operand:QI 2 "general_operand" "tmK")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6074 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6075 + "lda\t%2\t;umulqihi3\;mul"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6076 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6077 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6078 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6079 +; Expand a 16x16 multiplication into either a libcall or a shift.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6080 +; If the second operand is a small constant, use the above form.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6081 +; Otherwise, do a libcall.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6082 +(define_expand "mulhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6083 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6084 + (mult:HI (match_operand:HI 1 "general_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6085 + (match_operand:HI 2 "nonmemory_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6086 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6087 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6088 + emit_libcall_insns (HImode, "mulhi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6089 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6090 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6091 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6092 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6093 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6094 +;;- Divide instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6095 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6096 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6097 +(define_expand "divhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6098 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6099 + (div:HI (match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6100 + (match_operand:HI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6101 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6102 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6103 + emit_libcall_insns (HImode, "divhi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6104 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6105 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6106 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6107 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6108 +(define_expand "divqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6109 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6110 + (div:QI (match_operand:QI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6111 + (match_operand:QI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6112 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6113 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6114 + emit_libcall_insns (QImode, "divqi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6115 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6116 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6117 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6118 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6119 +(define_expand "udivhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6120 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6121 + (udiv:HI (match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6122 + (match_operand:HI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6123 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6124 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6125 + emit_libcall_insns (HImode, "udivhi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6126 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6127 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6128 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6129 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6130 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6131 +;;- mod
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6132 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6133 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6134 +(define_expand "modhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6135 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6136 + (mod:HI (match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6137 + (match_operand:HI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6138 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6139 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6140 + emit_libcall_insns (HImode, "modhi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6141 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6142 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6143 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6144 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6145 +(define_expand "modqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6146 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6147 + (mod:QI (match_operand:QI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6148 + (match_operand:QI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6149 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6150 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6151 + emit_libcall_insns (QImode, "modqi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6152 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6153 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6154 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6155 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6156 +(define_expand "umodhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6157 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6158 + (umod:HI (match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6159 + (match_operand:HI 2 "register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6160 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6161 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6162 + emit_libcall_insns (HImode, "umodhi3", operands, 2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6163 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6164 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6165 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6166 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6167 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6168 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6169 +;;- and, or, xor common patterns
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6170 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6171 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6172 +; Split a bitwise HImode into two QImode instructions, with one of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6173 +; the sources in a pushable register. The register is pushed onto
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6174 +; the stack and memory pop operands (,s+) are used in the QI forms.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6175 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6176 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6177 + (match_operator:HI 3 "logical_bit_operator"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6178 + [(match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6179 + (match_operand:HI 2 "register_operand" "")]))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6180 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6181 + [(set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 2))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6182 + (set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6183 + [(reg:QI HARD_A_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6184 + (mem:QI (post_inc:QI (reg:HI HARD_S_REGNUM)))]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6185 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6186 + [(reg:QI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6187 + (mem:QI (post_inc:QI (reg:HI HARD_S_REGNUM)))]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6188 + (use (reg:QI HARD_A_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6189 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6190 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6191 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6192 +; Split a bitwise HImode into two QImode instructions, with one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6193 +; of the sources being a (MEM (MEM (...)); i.e. an indirect memory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6194 +; reference. This requires dereferencing the pointer into a
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6195 +; temporary register (X), which must be saved/restored around the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6196 +; compute instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6197 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6198 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6199 + (match_operator:HI 3 "logical_bit_operator"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6200 + [(match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6201 + (mem:HI (match_operand:HI 2 "memory_operand" ""))]))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6202 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6203 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6204 + (set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 4))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6205 + (set (match_dup 4) (match_dup 2))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6206 + (set (match_dup 4) (mem:HI (match_dup 4)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6207 + (set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6208 + [(reg:QI HARD_A_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6209 + (mem:QI (post_inc:QI (match_dup 4)))]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6210 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6211 + [(reg:QI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6212 + (mem:QI (post_inc:QI (match_dup 4)))]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6213 + (use (reg:QI HARD_A_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6214 + (set (match_dup 4) (mem:HI (post_inc:HI (reg:HI HARD_S_REGNUM))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6215 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6216 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6217 + /* Use X for a temporary index register */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6218 + operands[4] = gen_rtx_REG (HImode, HARD_X_REGNUM);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6219 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6220 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6221 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6222 +; Split a bitwise HImode into two QImode instructions. This is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6223 +; the common case. This handles splitting when neither of the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6224 +; above two cases applies.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6225 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6226 + [(set (match_operand:HI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6227 + (match_operator:HI 3 "logical_bit_operator"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6228 + [(match_operand:HI 1 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6229 + (match_operand:HI 2 "general_operand" "")]))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6230 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6231 + [(set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6232 + [(reg:QI HARD_A_REGNUM) (match_dup 4)]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6233 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6234 + [(reg:QI HARD_D_REGNUM) (match_dup 5)]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6235 + (use (reg:QI HARD_A_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6236 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6237 + if (GET_CODE (operands[2]) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6238 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6239 + operands[4] = gen_rtx_const_high (operands[2]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6240 + operands[5] = gen_rtx_const_low (operands[2]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6241 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6242 + else if ((GET_CODE (operands[2]) == MEM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6243 + && (GET_CODE (XEXP (operands[2], 0)) == MEM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6244 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6245 + FAIL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6246 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6247 + else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6248 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6249 + operands[4] = gen_highpart (QImode, operands[2]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6250 + operands[5] = gen_lowpart (QImode, operands[2]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6251 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6252 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6253 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6254 +; Below are the specific cases for each of the operators.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6255 +; The QImode versions are the simplest and can be implemented
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6256 +; directly on the hardware. The HImode cases are all output
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6257 +; using one of the above splitting techniques.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6258 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6259 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6260 +;;- and
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6261 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6262 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6263 +(define_insn "andhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6264 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6265 + (and:HI (match_operand:HI 1 "register_operand" "%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6266 + (match_operand:HI 2 "general_operand" "mnU")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6267 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6268 + "#")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6269 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6270 +;; it is not clear that this is correct
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6271 +(define_insn "*andqi_2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6272 + [(set
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6273 + (match_operand:QI 0 "register_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6274 + (and:QI (match_operand:QI 1 "register_operand" "q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6275 + (match_operand 2 "const_int_operand" "i")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6276 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6277 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6278 + if (GET_CODE (operands[2]) == CONST_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6279 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6280 + operands[3] = GEN_INT(INTVAL(operands[2]) & 0xff);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6281 + return "and%0 %3";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6282 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6283 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6284 + return "and%0 %2";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6285 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6286 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6287 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6288 +(define_insn "andqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6289 + [(set (match_operand:QI 0 "register_operand" "=q,q,q,qc")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6290 + (and:QI (match_operand:QI 1 "whole_register_operand" "%0,0,0,0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6291 + (match_operand:QI 2 "whole_general_operand" " O,N,m,i")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6292 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6293 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6294 + clr%0\t;andqi(ZERO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6295 + \t;andqi(-1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6296 + and%0\t%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6297 + and%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6298 + [(set_attr "length" "1,0,3,2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6299 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6300 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6301 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6302 +;;- or
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6303 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6304 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6305 +(define_insn "iorhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6306 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6307 + (ior:HI (match_operand:HI 1 "register_operand" "%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6308 + (match_operand:HI 2 "general_operand" "mnU")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6309 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6310 + "#")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6311 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6312 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6313 +(define_insn "iorqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6314 + [(set (match_operand:QI 0 "register_operand" "=q,q, qc")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6315 + (ior:QI (match_operand:QI 1 "whole_register_operand" "%0,0, 0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6316 + (match_operand:QI 2 "whole_general_operand" " O,m,i")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6317 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6318 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6319 + \t;iorqi(ZERO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6320 + or%0\t%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6321 + or%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6322 + [(set_attr "length" "0,3,2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6323 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6324 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6325 +;;- xor
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6326 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6327 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6328 +(define_insn "xorhi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6329 + [(set (match_operand:HI 0 "register_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6330 + (xor:HI (match_operand:HI 1 "register_operand" "%0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6331 + (match_operand:HI 2 "general_operand" "mnU")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6332 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6333 + "#")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6334 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6335 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6336 +(define_insn "xorqi3"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6337 + [(set (match_operand:QI 0 "register_operand" "=q,q,q,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6338 + (xor:QI (match_operand:QI 1 "whole_register_operand" "%0,0,0,0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6339 + (match_operand:QI 2 "whole_general_operand" " O,N,m,i")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6340 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6341 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6342 + \t;xorqi(ZERO)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6343 + com%0\t;xorqi(-1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6344 + eor%0\t%2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6345 + eor%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6346 + [(set_attr "length" "0,1,3,2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6347 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6348 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6349 +;;- Two's Complements
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6350 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6351 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6352 +(define_insn "neghi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6353 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,!a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6354 + (neg:HI (match_operand:HI 1 "general_operand" "0, 0")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6355 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6356 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6357 + nega\;negb\;sbca\t#0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6358 + exg\td,%0\;nega\;negb\;sbca\t#0\;exg\td,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6359 + [(set_attr "length" "5,9")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6360 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6361 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6362 +(define_insn "negqi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6363 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6364 + (neg:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6365 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6366 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6367 + neg%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6368 + neg\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6369 + [(set_attr "length" "1,3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6370 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6371 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6372 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6373 +;;- One's Complements
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6374 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6375 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6376 +(define_insn "one_cmplhi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6377 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,?tm,???a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6378 + (not:HI (match_operand:HI 1 "general_operand" "0, 0, 0")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6379 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6380 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6381 + coma\;comb
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6382 + com\t%0\;com\t%L0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6383 + exg\td,%0\;coma\;comb\;exg\td,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6384 + [(set_attr "length" "2,6,6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6385 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6386 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6387 +(define_insn "one_cmplqi2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6388 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6389 + (not:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6390 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6391 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6392 + com%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6393 + com\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6394 + [(set_attr "length" "1,3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6395 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6396 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6397 +;;- Shifts/rotates
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6398 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6399 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6400 +(define_code_iterator bit_code [ashift ashiftrt lshiftrt])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6401 +(define_code_attr bit_code_name [(ashift "ashl") (ashiftrt "ashr") (lshiftrt "lshr")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6402 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6403 +(define_mode_iterator bit_mode [QI HI])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6404 +(define_mode_attr bit_mode_name [(QI "qi3") (HI "hi3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6405 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6406 +;; Emit RTL for any shift (handles all 3 opcodes and 2 mode sizes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6407 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6408 +(define_expand "<bit_code:bit_code_name><bit_mode:bit_mode_name>"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6409 + [(set (match_operand:bit_mode 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6410 + (bit_code:bit_mode (match_operand:bit_mode 1 "general_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6411 + (match_operand:bit_mode 2 "nonmemory_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6412 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6413 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6414 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6415 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6416 +; Individual instructions implemented in the CPU.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6417 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6418 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6419 +(define_insn "*ashift1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6420 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6421 + (ashift:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6422 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6423 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6424 + asl\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6425 + asl%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6426 + [(set_attr "length" "3,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6427 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6428 +(define_insn "*lshiftrt1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6429 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6430 + (lshiftrt:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6431 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6432 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6433 + lsr\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6434 + lsr%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6435 + [(set_attr "length" "3,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6436 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6437 +(define_insn "*ashiftrt1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6438 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6439 + (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6440 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6441 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6442 + asr\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6443 + asr%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6444 + [(set_attr "length" "3,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6445 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6446 +(define_insn "*rotate1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6447 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6448 + (rotate:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6449 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6450 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6451 + rol\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6452 + rol%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6453 + [(set_attr "length" "3,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6454 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6455 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6456 +(define_insn "*rotatert1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6457 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6458 + (rotatert:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6459 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6460 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6461 + ror\t%0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6462 + ror%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6463 + [(set_attr "length" "3,1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6464 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6465 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6466 +; A shift by 8 for D reg can be optimized by just moving
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6467 +; between the A/B halves, and then zero/sign extending or
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6468 +; filling in zeroes.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6469 +; Because GCC does not understand that 'A' and 'D' refer to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6470 +; the same storage location, we must use 'USE' throughout
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6471 +; to prevent deletion of 'unnecessary' instructions.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6472 +; Similar optimization for MEM would require a scratch register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6473 +; so is not done here.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6474 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6475 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6476 + [(set (reg:HI HARD_D_REGNUM) (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6477 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6478 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6479 + (use (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6480 + (set (reg:QI HARD_A_REGNUM) (reg:QI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6481 + (use (reg:QI HARD_A_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6482 + (set (reg:QI HARD_D_REGNUM) (const_int 0))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6483 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6484 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6485 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6486 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6487 + [(set (reg:HI HARD_D_REGNUM) (lshiftrt:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6488 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6489 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6490 + (use (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6491 + (set (reg:QI HARD_D_REGNUM) (reg:QI HARD_A_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6492 + (use (reg:QI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6493 + (set (reg:HI HARD_D_REGNUM) (zero_extend:HI (reg:QI HARD_D_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6494 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6495 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6496 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6497 +(define_split
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6498 + [(set (reg:HI HARD_D_REGNUM) (ashiftrt:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6499 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6500 + [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6501 + (use (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6502 + (set (reg:QI HARD_D_REGNUM) (reg:QI HARD_A_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6503 + (use (reg:QI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6504 + (set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6505 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6506 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6507 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6508 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6509 +; On the WPC hardware, there is a shift register that can be used
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6510 +; to compute (1<<n) efficiently in two instructions. Note that this
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6511 +; form only works when using -mint8 though, because C will promote
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6512 +; to 'int' when doing this operation. TODO : we need a 16-bit form too.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6513 +(define_insn "ashlqi3_wpc"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6514 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6515 + (ashift:QI (match_operand:QI 1 "immediate_operand" "I")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6516 + (match_operand:QI 2 "general_operand" "q")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6517 + "TARGET_WPC"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6518 + "st%2\t0x3FF7\;ld%0\t0x3FF7"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6519 + [(set_attr "length" "6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6520 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6521 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6522 +; Internal instructions for shifting by a constant.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6523 +; Two forms are provided, one for QImode, one for HImode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6524 +; These are always split into the above instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6525 +; (except for QImode forms that directly match one of the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6526 +; above instructions, in which the condition will not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6527 +; allow the splitter to match).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6528 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6529 +(define_insn_and_split "<bit_code:bit_code_name>hi3_const"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6530 + [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6531 + (bit_code:HI (match_operand:HI 1 "general_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6532 + (match_operand:HI 2 "immediate_operand" "n")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6533 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6534 + "#"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6535 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6536 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6537 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6538 + m6809_split_shift (<bit_code:CODE>, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6539 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6540 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6541 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6542 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6543 +(define_insn_and_split "<bit_code:bit_code_name>qi3_const"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6544 + [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6545 + (bit_code:QI (match_operand:QI 1 "general_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6546 + (match_operand:QI 2 "immediate_operand" "n")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6547 + "INTVAL (operands[2]) > 1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6548 + "#"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6549 + "&& reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6550 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6551 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6552 + m6809_split_shift (<bit_code:CODE>, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6553 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6554 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6555 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6556 +; Internal instructions for shifting by a nonconstant.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6557 +; These expand into complex assembly.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6558 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6559 +(define_insn "<bit_code:bit_code_name>hi3_reg"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6560 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6561 + (bit_code:HI (match_operand:HI 1 "general_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6562 + (match_operand:HI 2 "nonimmediate_operand" "v")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6563 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6564 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6565 + m6809_output_shift_insn (<bit_code:CODE>, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6566 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6567 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6568 + [(set_attr "length" "20")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6569 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6570 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6571 +(define_insn "<bit_code:bit_code_name>qi3_reg"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6572 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6573 + (bit_code:QI (match_operand:QI 1 "general_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6574 + (match_operand:QI 2 "nonimmediate_operand" "v")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6575 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6576 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6577 + m6809_output_shift_insn (<bit_code:CODE>, operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6578 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6579 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6580 + [(set_attr "length" "16")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6581 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6582 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6583 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6584 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6585 +;;- Jumps and transfers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6586 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6587 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6588 +;;; The casesi pattern is normally *not* defined; see 'tablejump' instead.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6589 +(define_expand "casesi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6590 + [(match_operand:HI 0 "register_operand" "") ; index to jump on
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6591 + (match_operand:HI 1 "immediate_operand" "") ; lower bound
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6592 + (match_operand:HI 2 "immediate_operand" "") ; total range
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6593 + (match_operand 3 "" "") ; table label
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6594 + (match_operand 4 "" "")] ; out of range label
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6595 + "TARGET_BYTE_INT && TARGET_CASESI"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6596 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6597 + m6809_do_casesi (operands[0], operands[1], operands[2],
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6598 + operands[3], operands[4]);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6599 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6600 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6601 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6602 +(define_insn "tablejump_short_offset"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6603 + [(set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6604 + (mem:HI (plus:HI (match_operand:HI 1 "register_operand" "U")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6605 + (zero_extend:HI (match_operand:QI 0 "register_operand" "q")))))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6606 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6607 + "jmp\t[b,x]\t;tablejump_short_offset"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6608 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6609 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6610 +(define_insn "tablejump_long_offset"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6611 + [(set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6612 + (mem:HI (plus:HI (match_operand:HI 1 "register_operand" "U")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6613 + (match_operand:HI 0 "register_operand" "d"))))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6614 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6615 + "jmp\t[d,x]\t;tablejump_long_offset"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6616 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6617 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6618 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6619 + ;; A tablejump operation gives the address in operand 0, with the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6620 + ;; CODE_LABEL for the table in operand 1. The 'define_expand'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6621 + ;; shows the arguments as GCC presents them. For a register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6622 + ;; operand, the assembly code is straightforward. For a MEM,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6623 + ;; assumed to be a SYMBOL_REF, two forms are given, one normal
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6624 + ;; and one for PIC mode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6625 + (define_expand "tablejump"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6626 + [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6627 + (set (pc) (match_operand:HI 0 "" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6628 + (use (label_ref (match_operand 1 "" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6629 + (clobber (match_scratch:HI 2 ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6630 + ])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6631 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6632 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6633 + })
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6634 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6635 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6636 +(define_insn "*tablejump_reg"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6637 + [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6638 + (set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6639 + (match_operand:HI 0 "register_operand" "a"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6640 + (use (label_ref (match_operand 1 "" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6641 + (clobber (match_scratch:HI 2 ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6642 + ])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6643 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6644 + "jmp\t,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6645 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6646 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6647 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6648 +(define_insn "*tablejump_symbol"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6649 + [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6650 + (set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6651 + (mem:HI
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6652 + (plus:HI (match_operand:HI 0 "register_operand" "a")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6653 + (label_ref (match_operand 1 "" "")))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6654 + (use (label_ref (match_dup 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6655 + (clobber (match_scratch:HI 2 ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6656 + ])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6657 + "!flag_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6658 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6659 + output_asm_insn ("jmp\t[%a1,%0]", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6660 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6661 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6662 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6663 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6664 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6665 +(define_insn "*tablejump_symbol_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6666 + [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6667 + (set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6668 + (mem:HI
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6669 + (plus:HI (match_operand:HI 0 "register_operand" "d")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6670 + (label_ref (match_operand 1 "" "")))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6671 + (use (label_ref (match_dup 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6672 + (clobber (match_scratch:HI 2 "=&a"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6673 + ])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6674 + "flag_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6675 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6676 + output_asm_insn ("lea%2\t%a1,pcr", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6677 + output_asm_insn ("ld%0\t%0,%2", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6678 + output_asm_insn ("jmp\t%0,%2", operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6679 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6680 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6681 + [(set_attr "length" "8")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6682 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6683 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6684 +(define_insn "indirect_jump"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6685 + [(set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6686 + (match_operand:HI 0 "register_operand" "a"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6687 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6688 + "jmp\t,%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6689 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6690 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6691 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6692 +(define_insn "jump"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6693 + [(set (pc) (label_ref (match_operand 0 "" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6694 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6695 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6696 + return output_branch_insn ( LABEL_REF, operands, get_attr_length (insn));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6697 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6698 + [(set (attr "type") (const_string "branch"))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6699 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6700 +; Output assembly for a condition branch instruction.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6701 +(define_insn "*cond_branch"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6702 + [(set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6703 + (if_then_else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6704 + (match_operator 1 "comparison_operator" [(cc0) (const_int 0)])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6705 + (label_ref (match_operand 0 "" "")) (pc)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6706 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6707 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6708 + return output_branch_insn ( GET_CODE(operands[1]),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6709 + operands, get_attr_length (insn));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6710 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6711 + [(set (attr "type") (const_string "cbranch"))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6712 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6713 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6714 +; Similar to above, but for a condition branch instruction that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6715 +; had its operands reversed at some point.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6716 +(define_insn "*cond_branch_reverse"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6717 + [(set (pc)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6718 + (if_then_else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6719 + (match_operator 1 "comparison_operator" [(cc0) (const_int 0)])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6720 + (pc) (label_ref (match_operand 0 "" ""))))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6721 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6722 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6723 + return output_branch_insn ( reverse_condition (GET_CODE(operands[1])),
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6724 + operands, get_attr_length (insn));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6725 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6726 + [(set (attr "type") (const_string "cbranch"))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6727 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6728 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6729 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6730 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6731 +;;- Calls
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6732 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6733 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6734 +;; Generate a call instruction for a function that does not
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6735 +;; return a value. The expander is used during RTL generation.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6736 +;; The instructions below are used during matching; only one
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6737 +;; of them will be used, depending on the type of function
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6738 +;; being called. The different conditions are:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6739 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6740 +;; 1) far_functionp - is this a far function? Those need
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6741 +;; to be output as indirect calls through a far-function
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6742 +;; handler.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6743 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6744 +;; 2) noreturn_functionp - if the function does not return,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6745 +;; we can use a 'jmp' instead of a 'jsr' to call it.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6746 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6747 +;; 3) is PIC mode enabled? If so, we'll always use
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6748 +;; relative calls (lbsr or lbra).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6749 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6750 +;; Note: not all combinations are fully supported, especially
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6751 +;; relating to PIC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6752 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6753 +;; The 'bsr' instruction is never generated.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6754 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6755 +(define_expand "call"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6756 + [(call (match_operand:HI 0 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6757 + (match_operand:HI 1 "general_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6758 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6759 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6760 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6761 +(define_insn "*call_nopic_far"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6762 + [(call (match_operand:HI 0 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6763 + (match_operand:HI 1 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6764 + "far_functionp (operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6765 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6766 + output_far_call_insn (operands, 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6767 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6768 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6769 + [(set_attr "length" "6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6770 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6771 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6772 +; PIC forms come first, and should only match
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6773 +; (MEM (SYMBOL_REF)). Other MEM forms are treated as usual.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6774 +(define_insn "*call_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6775 + [(call (mem:HI (match_operand:HI 0 "symbolic_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6776 + (match_operand:HI 1 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6777 + "flag_pic && !noreturn_functionp (operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6778 + "lbsr\t%C0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6779 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6780 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6781 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6782 +(define_insn "*call_nopic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6783 + [(call (match_operand:HI 0 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6784 + (match_operand:HI 1 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6785 + "!noreturn_functionp (operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6786 + "jsr\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6787 + [(set_attr "length" "3")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6788 + (set (attr "cycles") (const_int JSR_EXTENDED_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6789 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6790 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6791 +(define_insn "*call_noreturn_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6792 + [(call (mem:HI (match_operand:HI 0 "symbolic_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6793 + (match_operand:HI 1 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6794 + "flag_pic && noreturn_functionp (operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6795 + "lbra\t%C0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6796 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6797 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6798 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6799 +(define_insn "*call_noreturn_nopic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6800 + [(call (match_operand:HI 0 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6801 + (match_operand:HI 1 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6802 + "noreturn_functionp (operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6803 + "jmp\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6804 + [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6805 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6806 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6807 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6808 +;; Same as above, but for functions that do return a value.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6809 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6810 +(define_expand "call_value"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6811 + [(set (match_operand 0 "" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6812 + (call (match_operand:HI 1 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6813 + (match_operand:HI 2 "general_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6814 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6815 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6816 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6817 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6818 +(define_insn "*call_value_far"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6819 + [(set (match_operand 0 "" "=gz")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6820 + (call (match_operand:HI 1 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6821 + (match_operand:HI 2 "general_operand" "g")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6822 + "far_functionp (operands[1])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6823 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6824 + output_far_call_insn (operands, 1);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6825 + return "";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6826 +}
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6827 + [(set_attr "length" "6")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6828 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6829 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6830 +(define_insn "*call_value_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6831 + [(set (match_operand 0 "" "=gz")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6832 + (call (mem:HI (match_operand:HI 1 "symbolic_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6833 + (match_operand:HI 2 "general_operand" "g")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6834 + "flag_pic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6835 + "lbsr\t%C1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6836 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6837 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6838 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6839 +(define_insn "*call_value_nopic"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6840 + [(set (match_operand 0 "" "=gz")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6841 + (call (match_operand:HI 1 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6842 + (match_operand:HI 2 "general_operand" "g")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6843 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6844 + "jsr\t%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6845 + [(set_attr "length" "3")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6846 + (set (attr "cycles") (const_int JSR_EXTENDED_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6847 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6848 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6849 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6850 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6851 +;; How to generate an untyped call.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6852 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6853 +(define_expand "untyped_call"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6854 + [(parallel [(call (match_operand 0 "" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6855 + (const_int 0))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6856 + (match_operand 1 "" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6857 + (match_operand 2 "" "")])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6858 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6859 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6860 + int i;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6861 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6862 + emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6863 + for (i=0; i < XVECLEN (operands[2], 0); i++)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6864 + {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6865 + rtx set = XVECEXP (operands[2], 0, i);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6866 + emit_move_insn (SET_DEST (set), SET_SRC (set));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6867 + }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6868 + emit_insn (gen_blockage ());
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6869 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6870 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6871 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6872 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6873 +(define_expand "sibcall"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6874 + [(parallel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6875 + [(call (match_operand:HI 0 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6876 + (match_operand:HI 1 "immediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6877 + (use (reg:HI HARD_PC_REGNUM))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6878 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6879 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6880 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6881 +(define_insn "*sibcall_1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6882 + [(parallel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6883 + [(call (match_operand:HI 0 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6884 + (match_operand:HI 1 "immediate_operand" "i"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6885 + (use (reg:HI HARD_PC_REGNUM))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6886 + "SIBLING_CALL_P(insn)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6887 + "jmp\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6888 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6889 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6890 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6891 +(define_expand "sibcall_value"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6892 + [(parallel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6893 + [(set (match_operand 0 "" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6894 + (call (match_operand:HI 1 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6895 + (match_operand:HI 2 "immediate_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6896 + (use (reg:HI HARD_PC_REGNUM))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6897 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6898 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6899 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6900 +(define_insn "*sibcall_value_1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6901 + [(parallel
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6902 + [(set (match_operand 0 "" "=gz")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6903 + (call (match_operand:HI 1 "memory_operand" "m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6904 + (match_operand:HI 2 "immediate_operand" "i")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6905 + (use (reg:HI HARD_PC_REGNUM))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6906 + "SIBLING_CALL_P(insn)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6907 + "jmp\t%1"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6908 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6909 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6910 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6911 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6912 +;;- Function Entry and Exit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6913 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6914 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6915 +;; On entry to a function, the stack frame looks as follows:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6916 +;; - return address (pushed by the caller)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6917 +;; - saved registers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6918 +;; - local variable storage
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6919 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6920 +;; If the function does not modify the stack after that, then
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6921 +;; any of these can be accessed directly as an offset from
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6922 +;; STACK_POINTER_REGNUM. Otherwise, a frame pointer is required.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6923 +;; In that case, the prologue must also initialize HARD_FRAME_POINTER_REGNUM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6924 +;; and all references to the stack frame will use that as a base instead.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6925 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6926 +(define_expand "prologue"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6927 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6928 + "prologue_epilogue_required ()"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6929 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6930 + emit_prologue_insns ();
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6931 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6932 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6933 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6934 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6935 +;; The function epilogue does exactly the reverse of the prologue,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6936 +;; deallocating local variable space, restoring saved registers,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6937 +;; and returning.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6938 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6939 +;; For the 6809, the return may be 'rti' if the function was
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6940 +;; declared as an interrupt function, but is normally 'rts'.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6941 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6942 +;; Also, as an optimization, the register restore and the 'rts'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6943 +;; can be combined into a single instruction, by adding 'PC' to the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6944 +;; list of registers to be restored. This is only done if there are
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6945 +;; any saved registers, as 'rts' is more efficient by itself.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6946 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6947 +(define_expand "epilogue"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6948 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6949 + "prologue_epilogue_required ()"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6950 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6951 + emit_epilogue_insns (false);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6952 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6953 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6954 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6955 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6956 +(define_expand "sibcall_epilogue"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6957 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6958 + "prologue_epilogue_required ()"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6959 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6960 + emit_epilogue_insns (true);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6961 + DONE;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6962 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6963 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6964 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6965 +;; The RTS instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6966 +(define_insn "return_rts"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6967 + [(return)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6968 + (use (reg:HI HARD_PC_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6969 + "!m6809_current_function_has_type_attr_p (\"interrupt\")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6970 + && m6809_get_live_regs () == 0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6971 + "rts"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6972 + [(set_attr "length" "1")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6973 + (set (attr "cycles") (const_int RTS_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6974 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6975 +(define_insn "return_puls_pc"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6976 + [(return)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6977 + (use (reg:HI HARD_PC_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6978 + "!m6809_current_function_has_type_attr_p (\"interrupt\")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6979 + && m6809_get_live_regs () != 0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6980 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6981 + [(set_attr "length" "1")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6982 + (set (attr "cycles") (const_int RTS_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6983 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6984 +;; The RTI instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6985 +(define_insn "return_rti"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6986 + [(return)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6987 + (use (reg:HI HARD_PC_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6988 + "m6809_current_function_has_type_attr_p (\"interrupt\")"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6989 + "rti"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6990 + [(set_attr "length" "1")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6991 + (set (attr "cycles") (const_int RTI_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6992 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6993 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6994 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6995 +;;- Unspecified instructions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6996 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6997 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6998 +;; An instruction that has the effect of an unspec_volatile, but
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
6999 +;; which doesn't require emitting any assembly code.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7000 +(define_insn "blockage"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7001 + [(unspec_volatile [(const_int 0)] UNSPEC_BLOCKAGE)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7002 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7003 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7004 + [(set_attr "length" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7005 + (set (attr "cycles") (const_int 0))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7006 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7007 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7008 +;; Say how to push multiple registers onto the stack, using
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7009 +;; the 6809 'pshs' instruction. The operand is a regset
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7010 +;; specifying which registers to push.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7011 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7012 +;; The operand mode is not given intentionally, so as to allow
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7013 +;; any possible integer mode for the regset.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7014 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7015 +;; See below for a peephole that can combine consecutive push
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7016 +;; instructions that qualify for merging.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7017 +(define_insn "register_push"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7018 + [(use (reg:HI HARD_S_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7019 + (unspec_volatile
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7020 + [(match_operand 0 "immediate_operand" "")] UNSPEC_PUSH_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7021 + (clobber (reg:HI HARD_S_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7022 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7023 + "pshs\t%R0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7024 + [(set_attr "length" "2")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7025 + (set (attr "cycles") (const_int PSH_PUL_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7026 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7027 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7028 +;; Say how to pop multiple registers from the stack, using
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7029 +;; the 6809 'puls' instruction. The operand is the register
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7030 +;; bitset value.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7031 +(define_insn "register_pop"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7032 + [(use (reg:HI HARD_S_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7033 + (unspec_volatile
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7034 + [(match_operand 0 "immediate_operand" "")] UNSPEC_POP_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7035 + (clobber (reg:HI HARD_S_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7036 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7037 + "puls\t%R0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7038 + [(set_attr "length" "2")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7039 + (set (attr "cycles") (const_int PSH_PUL_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7040 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7041 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7042 +(define_insn "m6809_swi"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7043 + [(unspec_volatile
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7044 + [(match_operand:QI 0 "immediate_operand" "I,n")] UNSPEC_SWI)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7045 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7046 + "@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7047 + swi
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7048 + swi%c0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7049 + [(set_attr "length" "1,2")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7050 + (set (attr "cycles") (const_int SWI_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7051 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7052 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7053 +;; Generate the CWAI instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7054 +(define_insn "m6809_cwai"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7055 + [(unspec_volatile
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7056 + [(match_operand:QI 0 "immediate_operand" "")] UNSPEC_CWAI)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7057 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7058 + "cwai\t%0"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7059 + [(set_attr "length" "2")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7060 + (set (attr "cycles") (const_int CWAI_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7061 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7062 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7063 +;; Generate the SYNC instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7064 +(define_insn "m6809_sync"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7065 + [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7066 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7067 + "sync"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7068 + [(set_attr "length" "1")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7069 + (set (attr "cycles") (const_int SYNC_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7070 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7071 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7072 +;; Generate the NOP instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7073 +(define_insn "nop"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7074 + [(const_int 0)]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7075 + ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7076 + "nop"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7077 + [(set_attr "length" "1")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7078 + (set (attr "cycles") (const_int NOP_CYCLES))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7079 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7080 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7081 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7082 +;;- Peepholes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7083 +;;--------------------------------------------------------------------
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7084 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7085 +;;; Each peephole has an ID that is used for debugging.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7086 +;;; Each peephole condition is bracketed by calls to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7087 +;;; m6809_match_peephole2() also for debugging.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7088 +(define_constants [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7089 + (PEEP_END 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7090 + (PEEP_COND 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7091 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7092 + (PEEP_STACK_STORE_INC 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7093 + (PEEP_STACK_CLEAR_INC 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7094 + (PEEP_LSRB_ADCB 2)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7095 + (PEEP_ABX 3)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7096 + (PEEP_ABX2 4)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7097 + (PEEP_INDEXED_INC 5)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7098 + (PEEP_MEM_DEC 6)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7099 + (PEEP_MEM_INC 7)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7100 + (PEEP_MEM_DEC_CMP 8)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7101 + (PEEP_PUSH2 9)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7102 + (PEEP_STORE_IMPLIES_CC 10)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7103 + (PEEP_DEC_IMPLIES_CC 11)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7104 + (PEEP_LEAB 12)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7105 + (PEEP_LDX_INDIRECT 13)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7106 + (PEEP_POP_JUNK 14)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7107 +])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7108 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7109 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7110 +;;; Optimize 'leas -1,s' followed by 'stb ,s'. This can happen if the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7111 +;;; function prologue needs to allocate stack space and 'b' is placed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7112 +;;; into that local right away. Combine the stack allocation with the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7113 +;;; store using preincrement mode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7114 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7115 + [(set (reg:HI HARD_S_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7116 + (plus:HI (reg:HI HARD_S_REGNUM) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7117 + (set (mem:QI (reg:HI HARD_S_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7118 + (match_operand:QI 0 "register_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7119 + "m6809_match_peephole2 (PEEP_STACK_STORE_INC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7120 + [(set (mem:QI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7121 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7122 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7123 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7124 +;;; Same as above, but for a 'clr ,s' that follows the prologue.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7125 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7126 + [(set (reg:HI HARD_S_REGNUM) (plus:HI (reg:HI HARD_S_REGNUM) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7127 + (set (mem:QI (reg:HI HARD_S_REGNUM)) (const_int 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7128 + "m6809_match_peephole2 (PEEP_STACK_CLEAR_INC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7129 + [(set (mem:QI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (const_int 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7130 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7131 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7132 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7133 +;;; Merge two consecutive push instructions into a single register_push.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7134 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7135 + [(set (match_operand 0 "push_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7136 + (match_operand 1 "register_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7137 + (set (match_operand 2 "push_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7138 + (match_operand 3 "register_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7139 + "m6809_match_peephole2 (PEEP_PUSH2, PEEP_COND)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7140 + && reload_completed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7141 + && GET_MODE (operands[1]) == GET_MODE (operands[3])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7142 + && m6809_can_merge_pushpop_p (UNSPEC_PUSH_RS, 1 << REGNO (operands[1]), 1 << REGNO (operands[3]))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7143 + && m6809_match_peephole2 (PEEP_PUSH2, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7144 + [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7145 + (use (reg:HI HARD_S_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7146 + (unspec_volatile [(match_dup 4)] UNSPEC_PUSH_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7147 + (clobber (reg:HI HARD_S_REGNUM))])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7148 + (use (match_dup 1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7149 + (use (match_dup 3))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7150 +{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7151 + operands[4] = gen_rtx_CONST_INT (QImode,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7152 + (1 << REGNO (operands[1])) | (1 << REGNO (operands[3])));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7153 +})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7154 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7155 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7156 +;;; Convert 'stX ,--s' into a push instruction. Use the regset
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7157 +;;; notation, so that it may be combined with an adjacent regset.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7158 +;;; TBD - this doesn't compile some code cleanly.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7159 +;(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7160 +; [(set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7161 +; (reg:HI HARD_X_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7162 +; "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7163 +; [(parallel [
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7164 +; (use (reg:HI HARD_S_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7165 +; (unspec_volatile [(match_dup 0)] UNSPEC_PUSH_RS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7166 +; (clobber (reg:HI HARD_S_REGNUM))])]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7167 +;{
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7168 +; operands[0] = gen_rtx_CONST_INT (HImode, X_REGBIT);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7169 +;})
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7170 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7171 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7172 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7173 +;;; q = (q+1)/2 can be optimized as "lsrb; adcb". This also
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7174 +;;; won't overflow when q=0xFF.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7175 +;;; TODO : this form isn't accounting for promotion when
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7176 +;;; using 16-bit ints.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7177 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7178 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7179 + [(set (reg:QI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7180 + (lshiftrt:QI (plus:HI (match_dup 0) (const_int 1)) (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7181 + "m6809_match_peephole2 (PEEP_LSRB_ADCB, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7182 + "lsrb\;adcb\t#0; peephole"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7183 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7184 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7185 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7186 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7187 +;; Optimize the case of following a register store with a test
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7188 +;; of reg or mem just moved.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7189 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7190 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7191 + [(set (match_operand:HI 0 "memory_operand" "=m")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7192 + (match_operand:HI 1 "register_operand" "r"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7193 + (set (cc0) (match_operand:HI 2 "general_operand" "g"))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7194 + "m6809_match_peephole2 (PEEP_STORE_IMPLIES_CC, PEEP_COND)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7195 + && (operands[2] == operands[0] || operands[2] == operands[1])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7196 + && m6809_match_peephole2 (PEEP_STORE_IMPLIES_CC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7197 + "st%1\t%0\t;movhi: R:%1 -> %0 w/ implied test of %2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7198 + [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7199 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7200 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7201 +;; Optimize a pair of SET instructions in which the second insn
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7202 +;; is the reverse of the first one. I.e.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7203 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7204 +;; A = B
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7205 +;; ----> A = B
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7206 +;; B = A
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7207 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7208 +;; The second insn is redundant. Define two patterns, one for QI, one for HI.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7209 +;; But don't do this if either is a VOLATILE MEM.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7210 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7211 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7212 + (match_operand:HI 1 "nonimmediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7213 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7214 + "!MEM_P (operands[0]) || !MEM_P (operands[1]) || (!MEM_VOLATILE_P (operands[0]) && !MEM_VOLATILE_P (operands[1]))"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7215 + [(set (match_dup 0) (match_dup 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7216 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7217 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7218 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7219 + [(set (match_operand:QI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7220 + (match_operand:QI 1 "nonimmediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7221 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7222 + "!MEM_P (operands[0]) || !MEM_P (operands[1]) || (!MEM_VOLATILE_P (operands[0]) && !MEM_VOLATILE_P (operands[1]))"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7223 + [(set (match_dup 0) (match_dup 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7224 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7225 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7226 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7227 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7228 +;; Optimize the sum of an 8-bit and 16-bit using the 'abx' instruction
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7229 +;; if B and X can be used. Two patterns are provided to catch both
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7230 +;; X=X+D and X=D+X.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7231 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7232 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7233 + [(set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7234 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7235 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7236 + (plus:HI (reg:HI HARD_D_REGNUM) (reg:HI HARD_X_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7237 + "m6809_match_peephole2 (PEEP_ABX, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7238 + "abx"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7239 + [(set_attr "length" "1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7240 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7241 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7242 + [(set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7243 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7244 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7245 + (plus:HI (reg:HI HARD_X_REGNUM) (reg:HI HARD_D_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7246 + "m6809_match_peephole2 (PEEP_ABX, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7247 + "abx"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7248 + [(set_attr "length" "1")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7249 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7250 +;;; Likewise, handle when B is scaled by 2 prior to the add.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7251 +;;; Instead of shifting B in 4 cycles, just do the ABX a second
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7252 +;;; time, in only 3 cycles.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7253 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7254 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7255 + [(set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7256 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7257 + (set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7258 + (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7259 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7260 + (plus:HI (reg:HI HARD_D_REGNUM) (reg:HI HARD_X_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7261 + "m6809_match_peephole2 (PEEP_ABX2, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7262 + "abx\;abx"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7263 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7264 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7265 +(define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7266 + [(set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7267 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7268 + (set (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7269 + (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7270 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7271 + (plus:HI (reg:HI HARD_X_REGNUM) (reg:HI HARD_D_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7272 + "m6809_match_peephole2 (PEEP_ABX2, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7273 + "abx\;abx"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7274 + [(set_attr "length" "2")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7275 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7276 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7277 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7278 +;; Work around a compiler bug that generates bad code when copying
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7279 +;; between 32-bit memory addresses after a libcall. The problem seen is
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7280 +;; that the source is MEM (REG X), but X is used as the reload register.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7281 +;; The second half of the copy therefore fails.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7282 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7283 +;; The solution is to switch the reload register to D, since that is guaranteed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7284 +;; not to be in use right after a libcall.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7285 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7286 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7287 + [(set (reg:HI HARD_X_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7288 + (set (match_operand:HI 0 "nonimmediate_operand" "") (reg:HI HARD_X_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7289 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7290 + (mem:HI (plus:HI (reg:HI HARD_X_REGNUM) (const_int 2))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7291 + (set (match_operand:HI 1 "nonimmediate_operand" "") (reg:HI HARD_X_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7292 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7293 + [(set (reg:HI HARD_D_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7294 + (set (match_dup 0) (reg:HI HARD_D_REGNUM))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7295 + (set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7296 + (mem:HI (plus:HI (reg:HI HARD_X_REGNUM) (const_int 2))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7297 + (set (match_dup 1) (reg:HI HARD_X_REGNUM))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7298 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7299 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7300 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7301 +;; Turn "and then test" into a "bit test" operation.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7302 +;; Provide variants for immediate and memory sources
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7303 +;; This is the most used peephople.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7304 +; (define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7305 +; [(set (match_operand:QI 0 "register_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7306 +; (and:QI (match_operand:QI 1 "register_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7307 +; (match_operand:QI 2 "immediate_operand" "i")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7308 +; (set (cc0) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7309 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7310 +; "bit%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7311 +; [(set_attr "length" "3")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7312 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7313 +; (define_peephole
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7314 +; [(set (match_operand:QI 0 "register_operand" "=q")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7315 +; (and:QI (match_operand:QI 1 "register_operand" "0")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7316 +; (match_operand:QI 2 "memory_operand" "m")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7317 +; (set (cc0) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7318 +; ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7319 +; "bit%0\t%2"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7320 +; [(set_attr "length" "4")])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7321 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7322 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7323 +;; Turn a "decrement, then test" sequence into just a "decrement".
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7324 +;; The test can be omitted, since it is implicitly done.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7325 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7326 + [(set (match_operand:QI 0 "nonimmediate_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7327 + (plus:QI (match_operand:QI 1 "whole_general_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7328 + (match_operand:QI 2 "immediate_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7329 + (set (cc0) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7330 + "m6809_match_peephole2 (PEEP_DEC_IMPLIES_CC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7331 + [(set (match_dup 0) (plus:QI (match_dup 1) (match_dup 2)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7332 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7333 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7334 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7335 +;; Merge an indexed register increment with a previous usage.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7336 +;; This is usually done automatically, but not always
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7337 +;; The 'use' should be optional; in all cases where this has been
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7338 +;; seen, it is required though.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7339 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7340 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7341 + (mem:QI (match_operand:HI 1 "index_register_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7342 + (use (match_dup 0))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7343 + (set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7344 + "m6809_match_peephole2 (PEEP_INDEXED_INC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7345 + [(set (match_dup 0) (mem:QI (post_inc:HI (match_dup 1))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7346 + (use (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7347 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7348 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7349 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7350 +;;; Merge "ldX MEM; ldX ,X" into a single instruction using
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7351 +;;; the indirect mode.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7352 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7353 + [(set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7354 + (mem:HI (match_operand:HI 0 "general_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7355 + (set (reg:HI HARD_X_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7356 + "reload_completed && m6809_match_peephole2 (PEEP_LDX_INDIRECT, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7357 + [(set (reg:HI HARD_X_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7358 + (mem:HI (mem:HI (match_dup 0))))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7359 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7360 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7361 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7362 +;;; Reorder a store followed by a unary operation on that memory
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7363 +;;; so that the unary is performed and then the store. Consider
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7364 +;;; a binary shift operation, which will be decomposed into
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7365 +;;; identical single shifts, also.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7366 +;;; TODO - recognize more than just 'ashift' here.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7367 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7368 + [(set (match_operand:QI 0 "memory_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7369 + (match_operand:QI 1 "register_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7370 + (set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7371 + (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7372 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7373 + [(set (match_dup 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7374 + (ashift:QI (match_dup 1) (match_operand:QI 2 "immediate_operand")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7375 + (set (match_dup 0) (match_dup 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7376 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7377 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7378 +;;; Likewise, reorder a unary MEM followed by a load, so that the load
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7379 +;;; is done first, then use the REG instead of the MEM.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7380 +;;;(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7381 +;;; [(set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7382 +;;; (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7383 +;;; (set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7384 +;;; (match_operand:QI 1 "memory_operand" ""))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7385 +;;; "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7386 +;;; [(set (match_dup 0) (match_dup 1))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7387 +;;; (set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7388 +;;; (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7389 +;;; "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7390 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7391 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7392 +;;; Replace sex; leaX d,Y with leaX b,Y.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7393 +;;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7394 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7395 + [(set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7396 + (set (match_operand:HI 0 "index_register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7397 + (plus:HI (match_operand:HI 1 "index_register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7398 + (reg:HI HARD_D_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7399 + "reload_completed && m6809_match_peephole2 (PEEP_LEAB, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7400 + [(set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7401 + (plus:HI (match_dup 1) (reg:QI HARD_D_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7402 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7403 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7404 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7405 + [(set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7406 + (set (match_operand:HI 0 "index_register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7407 + (plus:HI (reg:HI HARD_D_REGNUM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7408 + (match_operand:HI 1 "index_register_operand" "")))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7409 + "reload_completed && m6809_match_peephole2 (PEEP_LEAB, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7410 + [(set (match_dup 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7411 + (plus:HI (match_dup 1) (reg:QI HARD_D_REGNUM)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7412 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7413 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7414 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7415 +;;; Replace ldb; decb; stb; tstb with dec(mem). If the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7416 +;;; register is not needed, then the load will get deleted
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7417 +;;; automatically, but it may be needed for comparisons.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7418 +;;; Same for incb/inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7419 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7420 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7421 + (match_operand:QI 1 "nonimmediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7422 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7423 + (set (match_dup 1) (match_dup 0))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7424 + (set (cc0) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7425 + "m6809_match_peephole2 (PEEP_MEM_DEC_CMP, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7426 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int -1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7427 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7428 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7429 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7430 +;;; Replace ldb; decb; stb with dec(mem); ldb. If the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7431 +;;; register is not needed, then the load will get deleted
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7432 +;;; automatically, but it may be needed for comparisons.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7433 +;;; Same for incb/inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7434 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7435 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7436 + (match_operand:QI 1 "nonimmediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7437 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7438 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7439 + "m6809_match_peephole2 (PEEP_MEM_DEC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7440 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7441 + (set (match_dup 0) (match_dup 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7442 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7443 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7444 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7445 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7446 + (match_operand:QI 1 "nonimmediate_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7447 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7448 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7449 + "m6809_match_peephole2 (PEEP_MEM_INC, PEEP_END)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7450 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7451 + (set (match_dup 0) (match_dup 1))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7452 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7453 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7454 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7455 +;;; Replace "andb #N; cmpb #N; bhi" with "andb #N", if it can be proven
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7456 +;;; that the branch can never occur because of the limited range of B.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7457 +;;; N must be a power of two for this to make sense. This helps with
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7458 +;;; the default cases of switch statements on a value (x & N).
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7459 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7460 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7461 + (and:QI (match_dup 0) (match_operand:QI 1 "immediate_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7462 + (set (cc0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7463 + (compare (match_dup 0) (match_dup 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7464 + (set (pc) (if_then_else (gtu (cc0) (const_int 0)) (match_operand 2 "" "") (match_operand 3 "" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7465 + ]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7466 + "reload_completed && power_of_two_p (INTVAL (operands[1]) + 1)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7467 + [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7468 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7469 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7470 +;;; Replace ldd <mem>; addd #1; std <mem> with 16-bit increment
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7471 +;;; of the mem, but only if D is dead. Same for 16-bit decrement.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7472 +;;; <mem> must be offsettable for the instruction to match.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7473 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7474 + [(set (match_operand:HI 0 "register_operand" "") (match_operand:HI 1 "memory_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7475 + (set (match_dup 0) (plus:HI (match_dup 0) (const_int 1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7476 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7477 + "reload_completed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7478 + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7479 + && peep2_reg_dead_p (3, operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7480 + [(set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7481 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7482 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7483 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7484 + [(set (match_operand:HI 0 "register_operand" "") (match_operand:HI 1 "memory_operand" ""))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7485 + (set (match_dup 0) (plus:HI (match_dup 0) (const_int -1)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7486 + (set (match_dup 1) (match_dup 0))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7487 + "reload_completed
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7488 + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7489 + && peep2_reg_dead_p (3, operands[0])"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7490 + [(set (match_dup 1) (plus:HI (match_dup 1) (const_int -1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7491 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7492 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7493 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7494 +;;; Replace a load or store using an indexed register, followed by an increment of that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7495 +;;; register, with the combined form using autoincrement.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7496 +(define_peephole2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7497 + [(set (match_operand:QI 0 "register_operand" "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7498 + (mem:QI (match_operand:HI 1 "index_register_operand" "")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7499 + (set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7500 + "reload_completed"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7501 + [(set (match_dup 0) (mem:QI (post_inc (match_dup 1))))]
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7502 + "")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7503 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7504 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7505 +;;- mode:emacs-lisp
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7506 +;;- comment-start: ";;- "
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7507 +;;- eval: (set-syntax-table (copy-sequence (syntax-table)))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7508 +;;- eval: (modify-syntax-entry ?[ "(]")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7509 +;;- eval: (modify-syntax-entry ?] ")[")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7510 +;;- eval: (modify-syntax-entry ?{ "(}")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7511 +;;- eval: (modify-syntax-entry ?} "){")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7512 +;-; vim: set ts=2:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7513 +;-; vim: set expandtab:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7514 +;-; vim: set filetype=lisp:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7515 +;;- End:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7516 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.opt gcc-4.6.4/gcc/config/m6809/m6809.opt
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7517 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.opt 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7518 +++ gcc-4.6.4/gcc/config/m6809/m6809.opt 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7519 @@ -0,0 +1,98 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7520 +; Options for the M6809 port of the compiler
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7521 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7522 +; Copyright (C) 2005 Free Software Foundation, Inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7523 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7524 +; This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7525 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7526 +; GCC is free software; you can redistribute it and/or modify it under
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7527 +; the terms of the GNU General Public License as published by the Free
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7528 +; Software Foundation; either version 2, or (at your option) any later
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7529 +; version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7530 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7531 +; GCC is distributed in the hope that it will be useful, but WITHOUT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7532 +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7533 +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7534 +; License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7535 +;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7536 +; You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7537 +; along with GCC; see the file COPYING. If not, write to the Free
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7538 +; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7539 +; 02110-1301, USA.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7540 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7541 +margcount
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7542 +Target Mask(ARGCOUNT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7543 +Push argument count
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7544 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7545 +mint8
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7546 +Target RejectNegative Mask(BYTE_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7547 +Use 8-bit integers
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7548 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7549 +mint16
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7550 +Target RejectNegative
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7551 +Use 16-bit integers InverseMask(BYTE_INT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7552 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7553 +mreg-args
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7554 +Target Mask(REG_ARGS)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7555 +Use registers for function arguments
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7556 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7557 +mshort_size
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7558 +Target RejectNegative Mask(SMALL_SIZE_T)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7559 +Use 8-bit size_t
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7560 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7561 +mlong_size
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7562 +Target RejectNegative InverseMask(SMALL_SIZE_T)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7563 +Use 16-bit size_t
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7564 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7565 +mdirect
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7566 +Target Mask(DIRECT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7567 +Enable direct addressing
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7568 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7569 +mwpc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7570 +Target RejectNegative Mask(WPC)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7571 +Enable WPC platform extensions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7572 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7573 +mexperiment
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7574 +Target RejectNegative Mask(EXPERIMENT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7575 +Enable current experimental feature
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7576 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7577 +m6309
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7578 +Target RejectNegative Mask(6309)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7579 +Enable Hitachi 6309 extensions
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7580 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7581 +mcasesi
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7582 +Target RejectNegative Mask(CASESI)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7583 +Enable the casesi pattern
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7584 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7585 +mfar-code-page=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7586 +Target RejectNegative Joined Var(far_code_page_option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7587 +Sets the far code page value for this compilation unit
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7588 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7589 +mcode-section=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7590 +Target RejectNegative Joined Var(code_section_ptr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7591 +Sets the name of the section for code
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7592 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7593 +mdata-section=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7594 +Target RejectNegative Joined Var(data_section_ptr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7595 +Sets the name of the section for initialized data
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7596 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7597 +mbss-section=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7598 +Target RejectNegative Joined Var(bss_section_ptr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7599 +Sets the name of the section for uninitialized data
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7600 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7601 +mabi_version=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7602 +Target RejectNegative Joined Var(m6809_abi_version_ptr)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7603 +Sets the calling convention
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7604 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7605 +msoft-reg-count=
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7606 +Target RejectNegative Joined Var(m6809_soft_reg_count)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7607 +Sets the number of soft registers that can be used
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7608 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7609 +mdret
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7610 +Target RejectNegative Mask(DRET)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7611 +Put function call results in D, not X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7612 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7613 +mfar-stack-param
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7614 +Target Mask(FAR_STACK_PARAM)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7615 +Enable stack parameters to a farcall
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7616 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7617 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7618 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h gcc-4.6.4/gcc/config/m6809/m6809-protos.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7619 --- gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7620 +++ gcc-4.6.4/gcc/config/m6809/m6809-protos.h 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7621 @@ -0,0 +1,94 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7622 +/* GCC for 6809 : machine-specific function prototypes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7623 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7624 +This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7625 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7626 +GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7627 +it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7628 +the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7629 +any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7630 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7631 +GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7632 +but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7633 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7634 +GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7635 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7636 +You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7637 +along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7638 +<http://www.gnu.org/licenses/>. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7639 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7640 +#ifndef __M6809_PROTOS_H__
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7641 +#define __M6809_PROTOS_H__
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7642 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7643 +void print_options (FILE *file);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7644 +void m6809_cpu_cpp_builtins (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7645 +void m6809_override_options (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7646 +void m6809_init_builtins (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7647 +unsigned int m6809_get_live_regs (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7648 +const char * m6809_get_regs_printable (unsigned int regs);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7649 +unsigned int m6809_get_regs_size (unsigned int regs);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7650 +int m6809_function_has_type_attr_p (tree decl, const char *);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7651 +int m6809_current_function_has_type_attr_p (const char *);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7652 +int prologue_epilogue_required (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7653 +int noreturn_functionp (rtx x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7654 +void output_function_prologue (FILE *file, int size);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7655 +void output_function_epilogue (FILE *file, int size);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7656 +int check_float_value (enum machine_mode mode, double *d, int overflow);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7657 +void m6809_asm_named_section (const char *name, unsigned int flags, tree decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7658 +void m6809_asm_file_start (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7659 +void m6809_output_ascii (FILE *fp, const char *str, unsigned long size);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7660 +void m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7661 +void m6809_reorg (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7662 +int m6809_current_function_is_void (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7663 +int m6809_can_merge_pushpop_p (int op, int regs1, int regs2);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7664 +int m6809_function_value_regno_p (unsigned int regno);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7665 +void emit_prologue_insns (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7666 +void emit_epilogue_insns (bool);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7667 +void m6809_conditional_register_usage (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7668 +void m6809_output_quoted_string (FILE *asm_file, const char *string);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7669 +int m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7670 +int m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7671 +int power_of_two_p (unsigned int n);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7672 +void m6809_do_casesi (rtx index, rtx lower_bound, rtx range, rtx table_label, rtx default_label);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7673 +void m6809_output_addsi3 (int rtx_code, rtx *operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7674 +rtx m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7675 +void expand_constant_shift (int code, rtx dst, rtx src, rtx count);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7676 +int m6809_single_operand_operator (rtx exp);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7677 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7678 +#ifdef TREE_CODE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7679 +int m6809_init_cumulative_args (CUMULATIVE_ARGS cum, tree fntype, rtx libname);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7680 +#endif /* TREE_CODE */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7681 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7682 +#ifdef RTX_CODE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7683 +void print_direct_prefix (FILE *file, rtx addr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7684 +void print_operand (FILE *file, rtx x, int code);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7685 +void print_operand_address (FILE *file, rtx addr);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7686 +void notice_update_cc (rtx exp, rtx insn);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7687 +enum reg_class m6809_preferred_reload_class (rtx x, enum reg_class regclass);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7688 +rtx gen_rtx_const_high (rtx r);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7689 +rtx gen_rtx_const_low (rtx r);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7690 +rtx gen_rtx_register_pushpop (int pop_flag, int regs);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7691 +void emit_libcall_insns (enum machine_mode mode, const char *name, rtx *operands, int count);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7692 +const char * output_branch_insn (enum rtx_code code, rtx *operands, int length);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7693 +void output_far_call_insn (rtx *operands, int has_return);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7694 +void m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7695 +rtx m6809_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7696 +const char * far_functionp (rtx x);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7697 +rtx m6809_function_value (const tree valtype, const tree func);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7698 +void m6809_output_shift_insn (int rtx_code, rtx *operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7699 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7700 +const char * m6809_get_decl_bank (tree decl);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7701 +void output_branch_insn1 (const char *opcode, rtx *operands, int long_p);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7702 +rtx m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7703 +const char * far_function_type_p (tree type);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7704 +void m6809_asm_trampoline_template(FILE *f);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7705 +bool m6809_frame_pointer_required (void);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7706 +int m6809_can_eliminate (int from, int to);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7707 +int m6809_initial_elimination_offset (int from, int to);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7708 +void m6809_emit_move_insn (rtx dst, rtx src);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7709 +void m6809_split_shift (enum rtx_code code, rtx *operands);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7710 +bool m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7711 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7712 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7713 +#endif /* RTX_CODE */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7714 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7715 +#endif /* __M6809_PROTOS_H__ */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7716 diff -urN gcc-4.6.4-clean/gcc/config/m6809/predicates.md gcc-4.6.4/gcc/config/m6809/predicates.md
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7717 --- gcc-4.6.4-clean/gcc/config/m6809/predicates.md 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7718 +++ gcc-4.6.4/gcc/config/m6809/predicates.md 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7719 @@ -0,0 +1,78 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7720 +;; Predicate definitions for Motorola 6809
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7721 +;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7722 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7723 +;; This file is part of GCC.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7724 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7725 +;; GCC is free software; you can redistribute it and/or modify
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7726 +;; it under the terms of the GNU General Public License as published by
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7727 +;; the Free Software Foundation; either version 3, or (at your option)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7728 +;; any later version.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7729 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7730 +;; GCC is distributed in the hope that it will be useful,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7731 +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7732 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7733 +;; GNU General Public License for more details.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7734 +;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7735 +;; You should have received a copy of the GNU General Public License
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7736 +;; along with GCC; see the file COPYING3. If not see
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7737 +;; <http://www.gnu.org/licenses/>.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7738 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7739 +;; whole_register_operand is like register_operand, but it
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7740 +;; does not allow SUBREGs.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7741 +(define_predicate "whole_register_operand"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7742 + (and (match_code "reg")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7743 + (match_operand 0 "register_operand")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7744 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7745 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7746 +;; A predicate that matches any index register. This can be used in nameless
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7747 +;; patterns and peepholes which need a 16-bit reg, but not D.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7748 +(define_predicate "index_register_operand"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7749 + (and (match_code "reg")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7750 + (match_test "REGNO (op) == HARD_X_REGNUM || REGNO (op) == HARD_Y_REGNUM || REGNO (op) == HARD_U_REGNUM")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7751 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7752 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7753 +;; match only X
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7754 +(define_predicate "register_operand_x"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7755 + (and (match_code "reg")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7756 + (match_test "REGNO (op) == HARD_X_REGNUM")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7757 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7758 +;; match only D
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7759 +(define_predicate "register_operand_d"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7760 + (and (match_code "reg")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7761 + (match_test "REGNO (op) == HARD_D_REGNUM")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7762 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7763 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7764 +;; Likwise, a replacement for general_operand which excludes
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7765 +;; SUBREGs.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7766 +(define_predicate "whole_general_operand"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7767 + (and (match_code "const_int,const_double,const,symbol_ref,label_ref,reg,mem")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7768 + (match_operand 0 "general_operand")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7769 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7770 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7771 +(define_predicate "add_general_operand"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7772 + (and (match_code "const_int,const_double,const,symbol_ref,label_ref,reg,mem")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7773 + (match_operand 0 "general_operand")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7774 + (match_test "REGNO (op) != SOFT_AP_REGNUM")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7775 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7776 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7777 +(define_predicate "shift_count_operand"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7778 + (and (match_code "const_int")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7779 + (and (match_operand 0 "const_int_operand")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7780 + (match_test "INTVAL (op) == 1 || INTVAL (op) == 8"))))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7781 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7782 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7783 +;; A predicate that matches any bitwise logical operator. This
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7784 +;; allows for a single RTL pattern to be used for multiple operations.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7785 +(define_predicate "logical_bit_operator"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7786 + (ior (match_code "and") (match_code "ior") (match_code "xor")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7787 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7788 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7789 +;; A predicate that matches any shift or rotate operator. This
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7790 +;; allows for a single RTL pattern to be used for multiple operations.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7791 +(define_predicate "shift_rotate_operator"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7792 + (ior (match_code "ashift") (match_code "ashiftrt") (match_code "lshiftrt")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7793 + (match_code "rotate") (match_code "rotatert")))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7794 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7795 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7796 +(define_predicate "symbolic_operand" (match_code "symbol_ref"))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7797 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7798 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-coco gcc-4.6.4/gcc/config/m6809/t-coco
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7799 --- gcc-4.6.4-clean/gcc/config/m6809/t-coco 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7800 +++ gcc-4.6.4/gcc/config/m6809/t-coco 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7801 @@ -0,0 +1,6 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7802 +# For a few minor differences in code generation on the CoCo...
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7803 +T_CFLAGS = -DTARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7804 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7805 +# For doing the startup differently on the CoCo...
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7806 +CRT0STUFF_T_CFLAGS += -Wa,--globalize-symbols -DTARGET_COCO
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7807 +# vim: set filetype=make:
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7808 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-m6809 gcc-4.6.4/gcc/config/m6809/t-m6809
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7809 --- gcc-4.6.4-clean/gcc/config/m6809/t-m6809 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7810 +++ gcc-4.6.4/gcc/config/m6809/t-m6809 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7811 @@ -0,0 +1,64 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7812 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7813 +# ranlib doesn't exist, so define it to 'true' to make it a no-op
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7814 +RANLIB_FOR_TARGET = true
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7815 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7816 +# Stubs for libgcc defined by m6809 are here
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7817 +LIB1ASMSRC = m6809/libgcc1.s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7818 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7819 +# Here are the functions that are implemented within libgcc1.s
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7820 +LIB1ASMFUNCS = _mulhi3 _divhi3 _modhi3 _udivhi3 _umodhi3 \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7821 + _euclid _seuclid _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _softregs \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7822 + _ashlhi3 _ashrhi3 _lshrhi3
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7823 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7824 +# Flags to use when building libgcc. IN_GCC does not seem necessary,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7825 +# although the compile breaks without it. -DDF=SF is required to set
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7826 +# the size of "double" to the same as the size of a "float".
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7827 +TARGET_LIBGCC2_CFLAGS =-DIN_GCC -Dinhibit_libc -DDF=SF -DLIBGCC2_HAS_SF_MODE=0 -DLIBGCC2_HAS_DF_MODE=0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7828 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7829 +LIB2ADDEH =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7830 +LIB2ADDEHSTATIC =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7831 +LIB2ADDEHSHARED =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7832 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7833 +LIBGCC2_DEBUG_CFLAGS =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7834 +LIBGCC2_CFLAGS = -Os $(LIBGCC2_INCLUDES) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7835 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7836 +# Multilib information
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7837 +# This creates multiple versions of libgcc.a for each set of incompatible
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7838 +# -mxxx options.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7839 +MULTILIB_OPTIONS = fpic mdret
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7840 +MULTILIB_DIRNAMES =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7841 +MULTILIB_MATCHES =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7842 +MULTILIB_EXCEPTIONS =
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7843 +EXTRA_MULTILIB_PARTS = crt0.o
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7844 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7845 +LIBGCC = stmp-multilib
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7846 +INSTALL_LIBGCC = install-multilib
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7847 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7848 +# We want fine grained libraries, so use the new code to build the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7849 +# floating point emulation libraries.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7850 +FPBIT = fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7851 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7852 +fp-bit.c: $(srcdir)/config/fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7853 + echo '#define FLOAT' > fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7854 + echo '#define FLOAT_ONLY' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7855 + echo '#define CMPtype HItype' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7856 + echo '#define SMALL_MACHINE' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7857 + echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7858 + echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7859 + echo '#endif' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7860 + echo '#define DI SI' >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7861 + cat $(srcdir)/config/fp-bit.c >> fp-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7862 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7863 +# crt0.o is built from the following source file
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7864 +CRT0_S = $(srcdir)/config/m6809/crt0.S
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7865 +MCRT0_S = $(srcdir)/config/m6809/crt0.S
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7866 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7867 +# Flags to use when building crt0.o
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7868 +CRT0STUFF_T_CFLAGS += -fno-builtin -nostartfiles -nostdlib
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7869 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7870 +# Assemble startup files.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7871 +$(T)crt0.o: $(CRT0_S) $(GCC_PASSES)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7872 + $(GCC_FOR_TARGET) $(CRT0STUFF_T_CFLAGS) $(MULTILIB_CFLAGS) -c -o $(T)crt0.o -x assembler-with-cpp $(CRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7873 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7874 +$(T)mcrt0.o: $(MCRT0_S) $(GCC_PASSES)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7875 + $(GCC_FOR_TARGET) $(CRT0STUFF_T_CFLAGS) $(MULTILIB_CFLAGS) -c -o $(T)mcrt0.o -x assembler-with-cpp $(MCRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7876 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-sim gcc-4.6.4/gcc/config/m6809/t-sim
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7877 --- gcc-4.6.4-clean/gcc/config/m6809/t-sim 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7878 +++ gcc-4.6.4/gcc/config/m6809/t-sim 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7879 @@ -0,0 +1 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7880 +CRT0STUFF_T_CFLAGS += -DTARGET_SIM
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7881 diff -urN gcc-4.6.4-clean/gcc/config.gcc gcc-4.6.4/gcc/config.gcc
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7882 --- gcc-4.6.4-clean/gcc/config.gcc 2013-03-06 10:40:07.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7883 +++ gcc-4.6.4/gcc/config.gcc 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7884 @@ -375,6 +375,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7885 cpu_type=m32r
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7886 extra_options="${extra_options} g.opt"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7887 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7888 +m6809-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7889 + cpu_type=m6809
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7890 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7891 m68k-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7892 extra_headers=math-68881.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7893 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7894 @@ -1706,6 +1709,12 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7895 thread_file='posix'
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7896 fi
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7897 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7898 +m6809-coco-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7899 + tmake_file="${tmake_file} m6809/t-m6809 m6809/t-coco"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7900 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7901 +m6809-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7902 + tmake_file="${tmake_file} m6809/t-m6809 m6809/t-sim"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7903 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7904 # m68hc11 and m68hc12 share the same machine description.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7905 m68hc11-*-*|m6811-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7906 tm_file="dbxelf.h elfos.h usegas.h newlib-stdint.h m68hc11/m68hc11.h"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7907 diff -urN gcc-4.6.4-clean/gcc/gcse.c gcc-4.6.4/gcc/gcse.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7908 --- gcc-4.6.4-clean/gcc/gcse.c 2011-02-02 23:04:04.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7909 +++ gcc-4.6.4/gcc/gcse.c 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7910 @@ -833,7 +833,6 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7911 max_distance = (GCSE_COST_DISTANCE_RATIO * cost) / 10;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7912 if (max_distance == 0)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7913 return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7914 -
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7915 gcc_assert (max_distance > 0);
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7916 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7917 else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7918 diff -urN gcc-4.6.4-clean/gcc/libgcc2.c gcc-4.6.4/gcc/libgcc2.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7919 --- gcc-4.6.4-clean/gcc/libgcc2.c 2011-01-03 13:52:22.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7920 +++ gcc-4.6.4/gcc/libgcc2.c 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7921 @@ -485,6 +485,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7922 #endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7923
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7924 #ifdef L_bswapsi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7925 +#if MIN_UNITS_PER_WORD > 1
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7926 SItype
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7927 __bswapsi2 (SItype u)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7928 {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7929 @@ -494,7 +495,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7930 | (((u) & 0x000000ff) << 24));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7931 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7932 #endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7933 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7934 #ifdef L_bswapdi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7935 +#if LONG_LONG_TYPE_SIZE > 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7936 DItype
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7937 __bswapdi2 (DItype u)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7938 {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7939 @@ -508,6 +511,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7940 | (((u) & 0x00000000000000ffull) << 56));
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7941 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7942 #endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7943 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7944 #ifdef L_ffssi2
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7945 #undef int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7946 int
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7947 @@ -1280,7 +1284,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7948 UDWtype
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7949 __fixunssfDI (SFtype a)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7950 {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7951 -#if LIBGCC2_HAS_DF_MODE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7952 +#if LIBGCC2_HAS_DF_MODE || (FLT_MANT_DIG >= W_TYPE_SIZE)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7953 /* Convert the SFtype to a DFtype, because that is surely not going
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7954 to lose any bits. Some day someone else can write a faster version
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7955 that avoids converting to DFtype, and verify it really works right. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7956 @@ -1298,7 +1302,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7957
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7958 /* Assemble result from the two parts. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7959 return ((UDWtype) hi << W_TYPE_SIZE) | lo;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7960 -#elif FLT_MANT_DIG < W_TYPE_SIZE
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7961 +#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7962 if (a < 1)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7963 return 0;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7964 if (a < Wtype_MAXp1_F)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7965 @@ -1334,8 +1338,6 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7966 return (DWtype)counter << shift;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7967 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7968 return -1;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7969 -#else
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7970 -# error
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7971 #endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7972 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7973 #endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7974 diff -urN gcc-4.6.4-clean/gcc/longlong.h gcc-4.6.4/gcc/longlong.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7975 --- gcc-4.6.4-clean/gcc/longlong.h 2011-10-04 01:28:50.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7976 +++ gcc-4.6.4/gcc/longlong.h 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7977 @@ -528,6 +528,11 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7978 : "cbit")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7979 #endif /* __M32R__ */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7980
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7981 +#if defined (__m6309__) || defined (__m6809__)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7982 +#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7983 +#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctz (X))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7984 +#endif
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7985 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7986 #if defined (__mc68000__) && W_TYPE_SIZE == 32
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7987 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7988 __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7989 diff -urN gcc-4.6.4-clean/gcc/Makefile.in gcc-4.6.4/gcc/Makefile.in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7990 --- gcc-4.6.4-clean/gcc/Makefile.in 2013-04-01 02:32:34.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7991 +++ gcc-4.6.4/gcc/Makefile.in 2015-07-20 19:44:52.770843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7992 @@ -2003,14 +2003,14 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7993
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7994 # Compile the start modules crt0.o and mcrt0.o that are linked with
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7995 # every program
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7996 -$(T)crt0.o: s-crt0 ; @true
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7997 -$(T)mcrt0.o: s-crt0; @true
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7998 +crt0.o: s-crt0 ; @true
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
7999 +mcrt0.o: s-crt0; @true
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8000
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8001 s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8002 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8003 - -o $(T)crt0.o -c $(CRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8004 + -o crt0.o -c $(CRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8005 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8006 - -o $(T)mcrt0.o -c $(MCRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8007 + -o mcrt0.o -c $(MCRT0_S)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8008 $(STAMP) s-crt0
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8009 #
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8010 # Compiling object files from source files.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8011 diff -urN gcc-4.6.4-clean/gcc/opth-gen.awk gcc-4.6.4/gcc/opth-gen.awk
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8012 --- gcc-4.6.4-clean/gcc/opth-gen.awk 2011-02-08 10:41:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8013 +++ gcc-4.6.4/gcc/opth-gen.awk 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8014 @@ -121,7 +121,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8015 END {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8016 print "/* This file is auto-generated by opth-gen.awk. */"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8017 print ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8018 -print "#ifndef OPTIONS_H"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8019 +print "#if !defined(OPTIONS_H) && !defined(IN_LIBGCC2)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8020 print "#define OPTIONS_H"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8021 print ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8022 print "#include \"flag-types.h\""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8023 @@ -432,18 +432,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8024
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8025 for (i = 0; i < n_opts; i++) {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8026 opt = opt_args("InverseMask", flags[i])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8027 - if (opt ~ ",") {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8028 - vname = var_name(flags[i])
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8029 - macro = "OPTION_"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8030 - mask = "OPTION_MASK_"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8031 - if (vname == "") {
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8032 - vname = "target_flags"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8033 - macro = "TARGET_"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8034 - mask = "MASK_"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8035 - }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8036 - print "#define " macro nth_arg(1, opt) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8037 - " ((" vname " & " mask nth_arg(0, opt) ") == 0)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8038 - }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8039 + if (opt ~ ",")
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8040 + print "#define TARGET_" nth_arg(1, opt) \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8041 + " ((target_flags & MASK_" nth_arg(0, opt) ") == 0)"
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8042 }
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8043 print ""
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8044
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8045 diff -urN gcc-4.6.4-clean/gcc/tree.h gcc-4.6.4/gcc/tree.h
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8046 --- gcc-4.6.4-clean/gcc/tree.h 2011-10-06 13:57:52.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8047 +++ gcc-4.6.4/gcc/tree.h 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8048 @@ -3563,6 +3563,8 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8049 TI_UINTDI_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8050 TI_UINTTI_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8051
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8052 + TI_UINT8_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8053 + TI_UINT16_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8054 TI_UINT32_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8055 TI_UINT64_TYPE,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8056
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8057 diff -urN gcc-4.6.4-clean/gcc/version.c gcc-4.6.4/gcc/version.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8058 --- gcc-4.6.4-clean/gcc/version.c 2009-04-21 13:03:23.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8059 +++ gcc-4.6.4/gcc/version.c 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8060 @@ -21,16 +21,16 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8061
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8062 /* This is the location of the online document giving instructions for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8063 reporting bugs. If you distribute a modified version of GCC,
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8064 - please configure with --with-bugurl pointing to a document giving
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8065 - instructions for reporting bugs to you, not us. (You are of course
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8066 - welcome to forward us bugs reported to you, if you determine that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8067 - they are not bugs in your modifications.) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8068 + please change this to refer to a document giving instructions for
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8069 + reporting bugs to you, not us. (You are of course welcome to
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8070 + forward us bugs reported to you, if you determine that they are
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8071 + not bugs in your modifications.) */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8072
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8073 -const char bug_report_url[] = BUGURL;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8074 +const char bug_report_url[] = "<URL:http://lost.l-w.ca/coco/lwtools/>";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8075
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8076 /* The complete version string, assembled from several pieces.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8077 BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8078 Makefile. */
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8079
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8080 -const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8081 +const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION " (gcc6809lw)";
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8082 const char pkgversion_string[] = PKGVERSION;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8083 diff -urN gcc-4.6.4-clean/libgcc/config.host gcc-4.6.4/libgcc/config.host
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8084 --- gcc-4.6.4-clean/libgcc/config.host 2011-11-23 15:15:54.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8085 +++ gcc-4.6.4/libgcc/config.host 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8086 @@ -371,6 +371,8 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8087 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8088 m32rle-*-linux*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8089 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8090 +m6809*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8091 + ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8092 m68hc11-*-*|m6811-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8093 ;;
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8094 m68hc12-*-*|m6812-*-*)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8095 diff -urN gcc-4.6.4-clean/libgcc/fixed-obj.mk gcc-4.6.4/libgcc/fixed-obj.mk
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8096 --- gcc-4.6.4-clean/libgcc/fixed-obj.mk 2007-09-17 16:18:13.000000000 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8097 +++ gcc-4.6.4/libgcc/fixed-obj.mk 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8098 @@ -23,7 +23,7 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8099 #$(info $o$(objext): -DL$($o-label) $($o-opt))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8100
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8101 $o$(objext): %$(objext): $(gcc_srcdir)/config/fixed-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8102 - $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8103 + $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) -save-temps
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8104
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8105 ifeq ($(enable_shared),yes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8106 $(o)_s$(objext): %_s$(objext): $(gcc_srcdir)/config/fixed-bit.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8107 diff -urN gcc-4.6.4-clean/libgcc/Makefile.in gcc-4.6.4/libgcc/Makefile.in
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8108 --- gcc-4.6.4-clean/libgcc/Makefile.in 2012-12-04 12:11:33.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8109 +++ gcc-4.6.4/libgcc/Makefile.in 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8110 @@ -374,8 +374,8 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8111 # Build lib2funcs. For the static library also include LIB2FUNCS_ST.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8112 lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8113 $(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8114 - $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8115 - $(vis_hide)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8116 + ln -sf $(gcc_srcdir)/libgcc2.c $*.c && \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8117 + $(gcc_compile) -DL$* -c $*.c $(vis_hide) -save-temps
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8118 libgcc-objects += $(lib2funcs-o)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8119
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8120 ifeq ($(enable_shared),yes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8121 @@ -410,8 +410,9 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8122 # Build LIB2_DIVMOD_FUNCS.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8123 lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8124 $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8125 - $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8126 - -fexceptions -fnon-call-exceptions $(vis_hide)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8127 + ln -sf $(gcc_srcdir)/libgcc2.c $*.c && \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8128 + $(gcc_compile) -DL$* -c $*.c \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8129 + -fexceptions -fnon-call-exceptions $(vis_hide) -save-temps
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8130 libgcc-objects += $(lib2-divmod-o)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8131
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8132 ifeq ($(enable_shared),yes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8133 @@ -443,7 +444,8 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8134 ifneq ($(FPBIT),)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8135 fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8136 $(fpbit-o): %$(objext): $(FPBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8137 - $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) $(vis_hide)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8138 + ln -sf $(FPBIT) $*.c && \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8139 + $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $*.c $(vis_hide) -save-temps
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8140 libgcc-objects += $(fpbit-o)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8141
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8142 ifeq ($(enable_shared),yes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8143 @@ -458,7 +460,8 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8144 ifneq ($(DPBIT),)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8145 dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8146 $(dpbit-o): %$(objext): $(DPBIT)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8147 - $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) $(vis_hide)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8148 + ln -sf $(DPBIT) $*.c && \
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8149 + $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $*.c $(vis_hide) -save-temps
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8150 libgcc-objects += $(dpbit-o)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8151
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8152 ifeq ($(enable_shared),yes)
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8153 diff -urN gcc-4.6.4-clean/README.LW gcc-4.6.4/README.LW
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8154 --- gcc-4.6.4-clean/README.LW 1969-12-31 17:00:00.000000000 -0700
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8155 +++ gcc-4.6.4/README.LW 2015-07-20 19:44:52.774843181 -0600
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8156 @@ -0,0 +1,14 @@
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8157 +This is a port of gcc6809 which is designed to work with the lwtools
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8158 +cross-assembler and linker package. You will need several scripts from that
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8159 +package, available at http://lost.l-w.ca/coco/lwtools/, in order to use
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8160 +this. Instructions for building are present in the lwtools package.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8161 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8162 +This work is based extensively on the gcc6809 4.3.4-3 release by Brian
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8163 +Dominy (brian@oddchange.com) with some significant renovations to make it
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8164 +work with gcc 4.6.1.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8165 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8166 +There is no guarantee that it will work for any particular purpose you
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8167 +choose to put it to.
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8168 +
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8169 +If you run into any problems, contact William Astle (lost@l-w.ca). DO NOT
d0c0fede5021 Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
diff changeset
8170 +contact the main GCC developers!