annotate extra/gcc6809lw-4.6.4-7.patch @ 545:1fa6eca684e5

Silence spurious warning in lwcpp build GCC has a stupid-ass warning about snprintf() truncating its output if its return value isn't tested. But that's the bleeping point of snprintf() in the first place - that it will truncate its output. Why should I need to add completely pointless extra code to check a return value *that doesn't matter* in my specific use case just to shut up an overwrought warning. So disable the stupid-ass warning. Why, yes, I do have a strong opinion. Why do you ask?
author William Astle <lost@l-w.ca>
date Thu, 16 Mar 2023 16:02:01 -0600
parents ff4b6095ee72
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
418
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3 +++ gcc-4.6.4/config.sub 2015-07-20 19:44:52.766843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4 @@ -313,7 +313,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5 c6x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6 basic_machine=tic6x-unknown
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8 - m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
9 + m6809 | m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
10 # Motorola 68HC11/12.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
11 basic_machine=$basic_machine-unknown
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
12 os=-none
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
13 @@ -354,7 +354,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
14 | i*86-* | i860-* | i960-* | ia64-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
15 | ip2k-* | iq2000-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
16 | lm32-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
17 - | m32c-* | m32r-* | m32rle-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
18 + | m32c-* | m32r-* | m32rle-* | m6809-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
19 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
20 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
21 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
22 @@ -509,6 +509,10 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
23 basic_machine=arm-unknown
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
24 os=-cegcc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
25 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
26 + coco)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
27 + basic_machine=coco
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
28 + os=-none
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
29 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
30 convex-c1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
31 basic_machine=c1-convex
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
32 os=-bsd
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
33 diff -urN gcc-4.6.4-clean/configure gcc-4.6.4/configure
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
34 --- gcc-4.6.4-clean/configure 2011-12-18 03:03:44.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
35 +++ gcc-4.6.4/configure 2015-07-20 19:44:52.766843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
36 @@ -3439,6 +3439,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
37 m32r-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
38 noconfigdirs="$noconfigdirs ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
39 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
40 + m6809*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
41 + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 target-libgloss ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
42 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
43 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
44 noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
45 libgloss_dir=m68hc11
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
48 +++ gcc-4.6.4/configure.ac 2015-07-20 19:44:52.766843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
49 @@ -885,6 +885,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
50 m32r-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
51 noconfigdirs="$noconfigdirs ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
52 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
53 + m6809*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
54 + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 target-libgloss ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
55 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
56 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
57 noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
58 libgloss_dir=m68hc11
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
62 @@ -2561,7 +2561,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
63 call sequence.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
64 Also do the adjustments before a throwing call, otherwise
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
65 exception handling can fail; PR 19225. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
66 - if (pending_stack_adjust >= 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
67 + if (pending_stack_adjust >= 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
68 || (pending_stack_adjust > 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
69 && (flags & ECF_MAY_BE_ALLOCA))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
70 || (pending_stack_adjust > 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
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
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
74 @@ -0,0 +1,173 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
75 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
76 +;;; Copyright 2006, 2007, 2008, 2009 by Brian Dominy <brian@oddchange.com>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
77 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
78 +;;; This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
79 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
80 +;;; GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
81 +;;; it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
82 +;;; the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
83 +;;; any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
84 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
85 +;;; GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
86 +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
87 +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
88 +;;; GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
89 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
90 +;;; You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
91 +;;; along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
92 +;;; <http://www.gnu.org/licenses/>.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
93 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
94 + /* Declare external for main() */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
95 + .globl _main
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
96 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
97 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
98 +/* The startup is heavily dependent on the type of machine and
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
99 +OS environment that is available at the start point.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
100 +For the most part, the general idea is the same across machines,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
101 +but the implementation is vastly different. This is managed via
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
102 +conditional compiles throughout the startup code for each of the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
103 +supported machines. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
104 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
105 +#ifdef TARGET_COCO /* CoCo memory map */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
106 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
107 +#define COCO_RAMROM_MODE 0xFFDE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
108 +#define COCO_ALLRAM_MODE 0xFFDF
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
109 +#define COCO_PAGE1 0xFFD5
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
110 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
111 +/* SAM M1 and M0 adjusts the memory size */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
112 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
113 +#define BASIC_WARMSTART_FLAG 0x0071
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
114 +#define BASIC_START 0xA027
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
115 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
116 +#define __STACK_TOP 0x6800
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
117 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
118 +#else /* Simulator (default) memory map */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
119 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
120 +#define SIM_EXIT_REG 0xFF01
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
121 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
122 +#define __STACK_TOP 0xFE00
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
123 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
124 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
125 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
126 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
127 + .area .data
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
128 + .area .ctors
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
129 + .area .dtors
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
130 + .area .bss
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
131 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
132 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
133 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
134 + ;;; __exit : Exit point from the program
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
135 + ;;; For simulation, this writes to a special I/O register that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
136 + ;;; the simulator interprets as end-of-program.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
137 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
138 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
139 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
140 + .globl __exit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
141 +__exit:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
142 +#ifdef TARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
143 + ;; Go back to ROM/RAM mode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
144 + sta COCO_RAMROM_MODE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
145 + clr BASIC_WARMSTART_FLAG
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
146 + jmp BASIC_START
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
147 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
148 + tfr x,d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
149 + stb SIM_EXIT_REG
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
150 + bra __exit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
151 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
152 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
153 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
154 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
155 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
156 + ;;; __start : Entry point to the program
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
157 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
158 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
159 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
160 + .globl __start
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
161 +__start:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
162 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
163 +#ifdef HAVE_DIRECT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
164 + ;; Initialize the direct page pointer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
165 + lda #<s_.direct
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
166 + tfr a,dp
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
167 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
168 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
169 +#ifdef TARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
170 + ;; Turn off interrupts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
171 + orcc #(0x10|0x40)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
172 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
173 + ;; Setup All RAM Mode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
174 + sta COCO_ALLRAM_MODE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
175 +#endif /* TARGET_COCO */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
176 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
177 + ;; Initialize the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
178 + lds #__STACK_TOP - 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
179 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
180 + ;; Call any "initializer" functions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
181 + ldu #s_.ctors
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
182 +__ctors_loop:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
183 + ldy ,u++
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
184 + cmpy #0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
185 + beq __ctors_done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
186 + jsr ,y
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
187 + bra __ctors_loop
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
188 +__ctors_done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
189 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
190 + ;; Enable interrupts on the simulator
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
191 +#ifndef TARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
192 + andcc #~(0x10|0x40)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
193 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
194 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
195 + ;; Set up the environment
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
196 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
197 + ;; Set up argc/argv arrays
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
198 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
199 + ;; Call the main function. The exit code will
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
200 + ;; be returned in the X register, unless compiled
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
201 + ;; with -mdret, in which case it comes back in D.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
202 + jsr _main
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
203 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
204 + ;; Call any finalizer functions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
205 + ldu #s_.dtors
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
206 +__dtors_loop:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
207 + ldy ,u++
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
208 + cmpy #0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
209 + beq __dtors_done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
210 + jsr ,y
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
211 + bra __dtors_loop
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
212 +__dtors_done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
213 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
214 + ;; If main returns, then invoke _exit() to stop the program
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
215 + ;; The C library doesn't support -mdret yet, so move the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
216 + ;; argument first.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
217 +#ifdef __DRET__
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
218 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
219 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
220 + jmp _exit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
221 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
222 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
223 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
224 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
225 + ;;; __crt0_vector : Default handler for interrupts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
226 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
227 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
228 +___crt0_vector:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
229 + ;; The default behavior is to simply ignore all
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
230 + ;; non-reset interrupts.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
231 + rti
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
232 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
233 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
234 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
235 + ;;; vector : The interrupt vector table
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
236 + ;;; The linker will ensure that this gets loaded at address 0xFFF0.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
237 + ;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
238 + .area vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
239 +vectors:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
240 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
241 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
242 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
243 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
244 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
245 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
246 + .word ___crt0_vector
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
247 + .word __start
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
248 diff -urN gcc-4.6.4-clean/gcc/config/m6809/libgcc1.s gcc-4.6.4/gcc/config/m6809/libgcc1.s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
249 --- gcc-4.6.4-clean/gcc/config/m6809/libgcc1.s 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
250 +++ gcc-4.6.4/gcc/config/m6809/libgcc1.s 2015-07-20 19:44:52.766843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
251 @@ -0,0 +1,511 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
252 +/* libgcc routines for m6809
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
253 + Copyright (C) 2006 Free Software Foundation, Inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
254 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
255 +This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
256 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
257 +GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
258 +it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
259 +the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
260 +any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
261 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
262 +GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
263 +but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
264 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
265 +GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
266 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
267 +You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
268 +along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
269 +<http://www.gnu.org/licenses/>. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
270 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
271 +/* As a special exception, if you link this library with other files,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
272 + some of which are compiled with GCC, to produce an executable,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
273 + this library does not by itself cause the resulting executable
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
274 + to be covered by the GNU General Public License.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
275 + This exception does not however invalidate any other reasons why
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
276 + the executable file might be covered by the GNU General Public License. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
277 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
278 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
279 +#define SIGFPE jmp _abort
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
280 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
281 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
282 + ; Shift functions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
283 + ; On input, D is value to be shifted, and X has shift count.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
284 + ; Result is also in D.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
285 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
286 +#ifdef L_ashlhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
287 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
288 + .globl _ashlhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
289 +_ashlhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
290 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
291 +1$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
292 + leax -1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
293 + cmpx #-1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
294 + beq 2$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
295 + aslb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
296 + rola
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
297 + bra 1$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
298 +2$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
299 + puls x,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
300 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
301 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
302 +#ifdef L_ashrhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
303 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
304 + .globl _ashrhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
305 +_ashrhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
306 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
307 +1$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
308 + leax -1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
309 + cmpx #-1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
310 + beq 2$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
311 + asra
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
312 + rorb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
313 + bra 1$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
314 +2$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
315 + puls x,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
316 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
317 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
318 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
319 +#ifdef L_lshrhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
320 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
321 + .globl _lshrhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
322 +_lshrhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
323 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
324 +1$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
325 + leax -1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
326 + cmpx #-1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
327 + beq 2$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
328 + lsra
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
329 + rorb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
330 + bra 1$
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
331 +2$:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
332 + puls x,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
333 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
334 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
335 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
336 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
337 +#ifdef L_softregs
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
338 + .area direct
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
339 + .globl m0, m1, m2, m3, m4, m5, m6, m7
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
340 + .globl m8, m9, m10, m11, m12, m13, m14, m15
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
341 +m0: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
342 +m1: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
343 +m2: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
344 +m3: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
345 +m4: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
346 +m5: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
347 +m6: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
348 +m7: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
349 +m8: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
350 +m9: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
351 +m10: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
352 +m11: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
353 +m12: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
354 +m13: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
355 +m14: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
356 +m15: .blkb 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
357 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
358 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
359 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
360 +#ifdef L_ashlsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
361 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
362 + .globl _ashlsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
363 +_ashlsi3_one:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
364 + asl 3,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
365 + rol 2,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
366 + rol 1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
367 + rol ,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
368 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
369 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
370 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
371 +#ifdef L_ashlsi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
372 + /* X points to the SImode (source/dest)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
373 + B is the count */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
374 +_ashlsi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
375 + pshs u
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
376 + cmpb #16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
377 + blt try8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
378 + subb #16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
379 + ; Shift by 16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
380 + ldu 2,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
381 + stu ,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
382 +try8:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
383 + cmpb #8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
384 + blt try_rest
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
385 + subb #8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
386 + ; Shift by 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
387 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
388 +try_rest:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
389 + tstb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
390 + beq done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
391 +do_rest:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
392 + ; Shift by 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
393 + asl 3,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
394 + rol 2,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
395 + rol 1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
396 + rol ,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
397 + decb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
398 + bne do_rest
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
399 +done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
400 + puls u,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
401 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
402 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
403 +#ifdef L_ashrsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
404 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
405 + .globl _ashlsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
406 +_ashrsi3_one:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
407 + asr ,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
408 + ror 1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
409 + ror 2,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
410 + ror 3,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
411 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
412 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
413 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
414 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
415 +#ifdef L_lshrsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
416 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
417 + .globl _lshrsi3_one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
418 +_lshrsi3_one:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
419 + lsr ,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
420 + ror 1,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
421 + ror 2,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
422 + ror 3,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
423 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
424 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
425 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
426 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
427 +#ifdef L_clzsi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
428 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
429 + .globl ___clzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
430 + ; Input: X = 16-bit unsigned integer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
431 + ; Output: X = number of leading zeros
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
432 + ; This function destroys the value in D.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
433 +___clzhi2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
434 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
435 + ; Find the offset of the leftmost '1' bit in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
436 + ; the left half of the word.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
437 + ;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
438 + ; Bits are numbered in the table with 1 meaning the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
439 + ; LSB and 8 meaning the MSB.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
440 + ;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
441 + ; If nonzero, then clz is 8-a.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
442 + tfr x,d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
443 + ldx #___clz_tab
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
444 + tfr a,b
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
445 + clra
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
446 + ldb d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
447 + bne upper_bit_set
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
448 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
449 +lower_bit_set:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
450 + ; If the upper byte is zero, then check the lower
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
451 + ; half of the word. Return 16-a.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
452 + puls d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
453 + clra
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
454 + ldb d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
455 + negb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
456 + addb #16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
457 + bra done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
458 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
459 +upper_bit_set:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
460 + negb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
461 + addb #8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
462 + puls x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
463 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
464 +done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
465 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
466 + puls pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
467 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
468 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
469 +#ifdef L_clzdi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
470 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
471 + .globl ___clzsi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
472 + ; Input: 32-bit unsigned integer is on the stack, just
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
473 + ; above the return address
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
474 + ; Output: X = number of leading zeros
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
475 +___clzsi2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
476 + ; Check the upper 16-bit word
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
477 + ; If it is not zero, then return clzhi2(X).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
478 + ; A branch can be used instead of a call since no
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
479 + ; postprocessing is needed. Use long branch form
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
480 + ; though since functions may not be near each other.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
481 + ldx 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
482 + lbne ___clzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
483 + ldx 4,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
484 + jsr ___clzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
485 + leax 16,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
486 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
487 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
488 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
489 +#ifdef L_ctzsi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
490 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
491 + .globl ___ctzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
492 + ; Input: X = 16-bit unsigned integer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
493 + ; Output: X = number of trailing zeros
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
494 + ; F(x) = 15 - clzhi2(X & -x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
495 + ; This function destroys the value in D.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
496 +___ctzhi2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
497 + tfr x,d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
498 + coma
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
499 + comb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
500 + addd #1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
501 + pshs a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
502 + pshs b
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
503 + tfr x,d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
504 + andb ,s+
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
505 + anda ,s+
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
506 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
507 + jsr ___clzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
508 + tfr x,d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
509 + subd #16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
510 + coma
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
511 + comb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
512 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
513 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
514 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
515 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
516 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
517 +#ifdef L_ctzdi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
518 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
519 + .globl ___ctzsi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
520 + ; Input: 32-bit unsigned integer is on the stack, just
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
521 + ; above the return address
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
522 + ; Output: X = number of leading zeros
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
523 +___ctzsi2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
524 + ; Check the lower 16-bit word
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
525 + ; If it is not zero, then return ctzhi2(X).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
526 + ; A branch can be used instead of a call since no
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
527 + ; postprocessing is needed. Use long branch form
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
528 + ; though since functions may not be near each other.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
529 + ldx 4,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
530 + lbne ___ctzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
531 + ldx 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
532 + jsr ___ctzhi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
533 + leax 16,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
534 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
535 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
536 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
537 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
538 +#ifdef L_mulhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
539 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
540 +;;; ___mulhi3 - signed/unsigned multiply
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
541 +;;; Called by GCC to implement 16x16 multiplication
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
542 +;;; Arguments: Two 16-bit values, one in stack, one in X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
543 +;;; Result: 16-bit result in X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
544 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
545 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
546 + .globl _mulhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
547 +_mulhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
548 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
549 + lda 5,s ; left msb * right lsb * 256
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
550 + ldb ,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
551 + mul
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
552 + tfr b,a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
553 + clrb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
554 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
555 + ldb 1,s ; left lsb * right msb * 256
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
556 + lda 4,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
557 + mul
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
558 + tfr b,a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
559 + clrb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
560 + leax d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
561 + ldb 1,s ; left lsb * right lsb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
562 + lda 5,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
563 + mul
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
564 + leax d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
565 + puls d,pc ; kill D to remove initial push
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
566 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
567 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
568 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
569 +#ifdef L_divhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
570 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
571 +;;; ___divhi3 - signed division
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
572 +;;; Arguments: Dividend in X, divisor on the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
573 +;;; Returns result in X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
574 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
575 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
576 + .globl _divhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
577 +_divhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
578 + ldd 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
579 + bne do_div ; check dividend
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
580 + SIGFPE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
581 +do_div:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
582 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
583 + jsr _seuclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
584 + puls x,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
585 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
586 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
587 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
588 +#ifdef L_modhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
589 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
590 +;;; ___modhi3 - signed modulo
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
591 +;;; Arguments: Dividend in X, divisor on the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
592 +;;; Returns result in X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
593 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
594 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
595 + .globl _modhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
596 +_modhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
597 + ldd 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
598 + bne do_mod ; check dividend
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
599 + SIGFPE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
600 +do_mod:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
601 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
602 + jsr _seuclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
603 + leas 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
604 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
605 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
606 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
607 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
608 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
609 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
610 +#ifdef L_udivhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
611 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
612 +;;; ___udivhi3 - unsigned division
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
613 +;;; Arguments: Dividend in X, divisor on the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
614 +;;; Returns result in X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
615 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
616 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
617 + .globl _udivhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
618 +_udivhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
619 + ldd 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
620 + bne do_udiv ; check dividend
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
621 + SIGFPE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
622 +do_udiv:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
623 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
624 + jsr _euclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
625 + puls x,pc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
626 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
627 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
628 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
629 +#ifdef L_umodhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
630 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
631 +;;; ___umodhi3 - unsigned modulo
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
632 +;;; Arguments: Dividend in X, divisor on the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
633 +;;; Returns result in X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
634 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
635 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
636 + .globl _umodhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
637 +_umodhi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
638 + ldd 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
639 + bne do_umod ; check dividend
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
640 + SIGFPE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
641 +do_umod:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
642 + pshs x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
643 + jsr _euclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
644 + leas 2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
645 + tfr d,x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
646 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
647 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
648 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
649 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
650 +#ifdef L_euclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
651 +; unsigned euclidean division
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
652 +; calling: (left / right)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
653 +; push left
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
654 +; ldd right
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
655 +; jsr _euclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
656 +; quotient on the stack (left)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
657 +; modulus in d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
658 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
659 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
660 + .globl _euclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
661 + left=5
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
662 + right=1 ; word
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
663 + count=0 ; byte
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
664 + CARRY=1 ; alias
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
665 +_euclid:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
666 + leas -3,s ; 2 local variables
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
667 + clr count,s ; prescale divisor
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
668 + inc count,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
669 + tsta
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
670 +presc:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
671 + bmi presc_done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
672 + inc count,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
673 + aslb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
674 + rola
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
675 + bra presc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
676 +presc_done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
677 + std right,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
678 + ldd left,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
679 + clr left,s ; quotient = 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
680 + clr left+1,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
681 +mod1:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
682 + subd right,s ; check subtract
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
683 + bcc mod2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
684 + addd right,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
685 + andcc #~CARRY
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
686 + bra mod3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
687 +mod2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
688 + orcc #CARRY
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
689 +mod3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
690 + rol left+1,s ; roll in carry
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
691 + rol left,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
692 + lsr right,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
693 + ror right+1,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
694 + dec count,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
695 + bne mod1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
696 + leas 3,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
697 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
698 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
699 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
700 +#ifdef L_seuclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
701 +; signed euclidean division
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
702 +; calling: (left / right)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
703 +; push left
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
704 +; ldd right
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
705 +; jsr _seuclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
706 +; quotient on the stack (left)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
707 +; modulus in d
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
708 + .area .text
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
709 + .globl _seuclid
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
710 + left=6
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
711 + right=2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
712 + quot_sign=1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
713 + mod_sign=0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
714 +_seuclid:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
715 + leas -4,s ; 3 local variables
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
716 + std right,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
717 + clr mod_sign,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
718 + clr quot_sign,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
719 + ldd left,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
720 + bge mod_abs
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
721 + inc mod_sign,s ; sign(mod) = sign(left)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
722 + inc quot_sign,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
723 + bsr negd ; abs(left) -> D
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
724 +mod_abs:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
725 + pshs b,a ; push abs(left)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
726 + ldd right+2,s ; all references shifted by 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
727 + bge quot_abs
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
728 + dec quot_sign+2,s ; sign(quot) = sign(left) XOR sign(right)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
729 + bsr negd ; abs(right) -> D
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
730 +quot_abs:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
731 + jsr _euclid ; call (unsigned) euclidean division
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
732 + std right+2,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
733 + puls a,b ; quot -> D
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
734 + tst quot_sign,s ; all references no longer shifted
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
735 + beq quot_done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
736 + bsr negd
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
737 +quot_done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
738 + std left,s ; quot -> left
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
739 + ldd right,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
740 + tst mod_sign,s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
741 + beq mod_done
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
742 + bsr negd
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
743 +mod_done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
744 + leas 4,s ; destroy stack frame
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
745 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
746 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
747 +negd: ; self-explanatory !
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
748 + nega
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
749 + negb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
750 + sbca #0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
751 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
752 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
753 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
754 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
755 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
756 +#ifdef L_pending_addsi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
757 +_addsi3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
758 + rts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
759 +#endif /* L_pending_addsi3 */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
760 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
761 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
762 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
763 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.c gcc-4.6.4/gcc/config/m6809/m6809.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
764 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.c 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
765 +++ gcc-4.6.4/gcc/config/m6809/m6809.c 2015-07-20 22:11:37.726714746 -0600
438
f18cc0c87a7e Make 32 bit compares work better in gcc6809.
Brett Gordon <beretta42@gmail.com>
parents: 418
diff changeset
766 @@ -0,0 +1,3025 @@
418
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
767 +/*-------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
768 + FILE: m6809.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
769 +-------------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
770 +/* Subroutines for insn-output.c for MC6809.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
771 + Copyright (C) 1989-2007 Free Software Foundation, Inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
772 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
773 + MC6809 Version by Tom Jones (jones@sal.wisc.edu)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
774 + Space Astronomy Laboratory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
775 + University of Wisconsin at Madison
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
776 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
777 + minor changes to adapt it to gcc-2.5.8 by Matthias Doerfel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
778 + ( msdoerfe@informatik.uni-erlangen.de )
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
779 + also added #pragma interrupt (inspired by gcc-6811)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
780 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
781 + minor changes to adapt it to gcc-2.8.0 by Eric Botcazou
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
782 + (ebotcazou@multimania.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
783 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
784 + minor changes to adapt it to gcc-2.95.3 by Eric Botcazou
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
785 + (ebotcazou@multimania.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
786 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
787 + major cleanup, improvements, and upgrade to gcc 3.4 by Brian Dominy
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
788 + (brian@oddchange.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
789 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
790 + additional adjustments, etc., for gcc 4.6.1 by William Astle (lost@l-w.ca)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
791 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
792 +This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
793 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
794 +GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
795 +it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
796 +the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
797 +any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
798 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
799 +GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
800 +but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
801 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
802 +GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
803 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
804 +You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
805 +along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
806 +<http://www.gnu.org/licenses/>. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
807 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
808 +#include <string.h>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
809 +#include <time.h>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
810 +#include <sys/types.h>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
811 +#include <sys/timeb.h>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
812 +#include <stdio.h>
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
813 +#include "config.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
814 +#include "system.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
815 +#include "coretypes.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
816 +#include "tm.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
817 +#include "tree.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
818 +#include "rtl.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
819 +#include "tm_p.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
820 +#include "regs.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
821 +#include "flags.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
822 +#include "hard-reg-set.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
823 +#include "real.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
824 +#include "tree.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
825 +#include "insn-config.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
826 +#include "conditions.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
827 +#include "insn-flags.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
828 +#include "output.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
829 +#include "insn-attr.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
830 +#include "function.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
831 +#include "target.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
832 +#include "target-def.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
833 +#include "expr.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
834 +#include "recog.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
835 +#include "cpplib.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
836 +#include "c-family/c-pragma.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
837 +#include "c-family/c-common.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
838 +#include "toplev.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
839 +#include "optabs.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
840 +#include "version.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
841 +#include "df.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
842 +#include "rtlhooks-def.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
843 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
844 +/* macro to return TRUE if length of operand mode is one byte */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
845 +#define BYTE_MODE(X) ((GET_MODE_SIZE (GET_MODE (X))) == 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
846 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
847 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
848 +/* REAL_REG_P(x) is a true if the rtx 'x' represents a real CPU
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
849 +register and not a fake one that is emulated in software. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
850 +#define REAL_REG_P(x) (REG_P(x) && !M_REG_P(x))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
851 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
852 +/*-------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
853 + Target hooks, moved from target.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
854 +-------------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
855 +static void m6809_encode_section_info (tree decl, rtx rtl, int new_decl_p ATTRIBUTE_UNUSED);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
856 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
857 +#undef TARGET_ENCODE_SECTION_INFO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
858 +#define TARGET_ENCODE_SECTION_INFO m6809_encode_section_info
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
859 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
860 +#undef TARGET_ASM_FILE_START
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
861 +#define TARGET_ASM_FILE_START m6809_asm_file_start
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
862 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
863 +#undef TARGET_ASM_ALIGNED_HI_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
864 +#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
865 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
866 +#undef TARGET_ASM_ALIGNED_SI_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
867 +#define TARGET_ASM_ALIGNED_SI_OP NULL
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
868 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
869 +#undef TARGET_ASM_UNALIGNED_HI_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
870 +#define TARGET_ASM_UNALIGNED_HI_OP "\t.word\t"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
871 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
872 +#undef TARGET_ASM_UNALIGNED_SI_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
873 +#define TARGET_ASM_UNALIGNED_SI_OP NULL
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
874 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
875 +#undef TARGET_RTX_COSTS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
876 +#define TARGET_RTX_COSTS m6809_rtx_costs
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
877 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
878 +#undef TARGET_ATTRIBUTE_TABLE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
879 +#define TARGET_ATTRIBUTE_TABLE m6809_attribute_table
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
880 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
881 +#undef TARGET_INIT_BUILTINS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
882 +#define TARGET_INIT_BUILTINS m6809_init_builtins
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
883 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
884 +#undef TARGET_EXPAND_BUILTIN
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
885 +#define TARGET_EXPAND_BUILTIN m6809_expand_builtin
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
886 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
887 +#undef TARGET_DEFAULT_TARGET_FLAGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
888 +#define TARGET_DEFAULT_TARGET_FLAGS (MASK_REG_ARGS | MASK_DIRECT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
889 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
890 +#undef TARGET_FUNCTION_OK_FOR_SIBCALL
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
891 +#define TARGET_FUNCTION_OK_FOR_SIBCALL m6809_function_ok_for_sibcall
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
892 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
893 +#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
894 +#define TARGET_ASM_TRAMPOLINE_TEMPLATE m6809_asm_trampoline_template
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
895 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
896 +#undef TARGET_TRAMPOLINE_INIT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
897 +#define TARGET_TRAMPOLINE_INIT m6809_initialize_trampoline
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
898 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
899 +#undef TARGET_FRAME_POINTER_REQUIRED
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
900 +#define TARGET_FRAME_POINTER_REQUIRED m6809_frame_pointer_required
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
901 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
902 +#undef TARGET_OPTION_OVERRIDE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
903 +#define TARGET_OPTION_OVERRIDE m6809_override_options
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
904 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
905 +/* External variables used */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
906 +extern int reload_completed; /* set in toplev.c */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
907 +extern FILE *asm_out_file;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
908 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
909 +static int last_mem_size; /* operand size (bytes) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
910 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
911 +/* True if the section was recently changed and another .area
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
912 + * directive needs to be output before emitting the next label. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
913 +int section_changed = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
914 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
915 +/* Section names. The defaults here are used until an
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
916 + * __attribute__((section)) is seen that changes it. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
917 +char code_section_op[128] = "\t.area .text";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
918 +char data_section_op[128] = "\t.area .data";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
919 +char bss_section_op[128] = "\t.area .bss";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
920 +const char *code_bank_option = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
921 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
922 +/* TRUE if the direct mode prefix might be valid in this context.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
923 + * This is set by 'print_address' prior to calling output_addr_const,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
924 + * which performs into 'print_direct_prefix' to do the final checks. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
925 +static int check_direct_prefix_flag;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
926 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
927 +/* Nonzero if an address is being printed in a context which does not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
928 + * permit any PIC modifications to the address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
929 +static int pic_ok_for_addr_p = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
930 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
931 +/* Current code page. This supports machines which can do bank
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
932 + * switching to allow for more than 64KB of code/data. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
933 +char far_code_page[64];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
934 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
935 +/* Current bank name */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
936 +static char current_bank_name[8] = "-1";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
937 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
938 +/* Default bank name */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
939 +static char default_code_bank_name[8] = "-1";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
940 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
941 +/* Direct memory reserved as soft registers */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
942 +unsigned int m6809_soft_regs = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
943 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
944 +/* ABI version */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
945 +unsigned int m6809_abi_version = M6809_ABI_VERSION_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
946 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
947 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
948 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
949 + * Called after options have been parsed.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
950 + * If overrides have been specified on the command-line, then
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
951 + * these values are copied into the main storage variables.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
952 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
953 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
954 +m6809_override_options (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
955 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
956 + /* Handle -mfar-code-page */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
957 + if (far_code_page_option == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
958 + far_code_page_option = "__default_code_page";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
959 + strcpy (far_code_page, far_code_page_option);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
960 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
961 + /* Handle -mcode-section, -mdata-section, and -mbss-section */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
962 + if (code_section_ptr != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
963 + sprintf (code_section_op, "\t.area %s", code_section_ptr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
964 + if (data_section_ptr != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
965 + sprintf (data_section_op, "\t.area %s", data_section_ptr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
966 + if (bss_section_ptr != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
967 + sprintf (bss_section_op, "\t.area %s", bss_section_ptr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
968 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
969 + /* Handle -mcode-bank */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
970 + if (code_bank_option != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
971 + sprintf (default_code_bank_name, "%s", code_bank_option);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
972 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
973 + /* Handle -mabi-version or -mno-reg-args */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
974 + if (m6809_abi_version_ptr != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
975 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
976 + if (!strcmp (m6809_abi_version_ptr, "stack"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
977 + m6809_abi_version = M6809_ABI_VERSION_STACK;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
978 + else if (!strcmp (m6809_abi_version_ptr, "regs"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
979 + m6809_abi_version = M6809_ABI_VERSION_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
980 + else if (!strcmp (m6809_abi_version_ptr, "bx"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
981 + m6809_abi_version = M6809_ABI_VERSION_BX;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
982 + else if (!strcmp (m6809_abi_version_ptr, "latest"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
983 + m6809_abi_version = M6809_ABI_VERSION_LATEST;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
984 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
985 + m6809_abi_version = atoi (m6809_abi_version_ptr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
986 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
987 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
988 + /* The older -mno-reg-args option is deprecated, and treated
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
989 + as -mabi=stack. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
990 + if (!TARGET_REG_ARGS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
991 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
992 + warning (WARNING_OPT "-mno-reg-args deprecated; use -mabi=stack instead.");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
993 + m6809_abi_version = M6809_ABI_VERSION_STACK;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
994 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
995 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
996 + /* -fexceptions is unsupported */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
997 + flag_exceptions = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
998 + flag_non_call_exceptions = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
999 + flag_unwind_tables = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1000 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1001 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1002 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1003 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1004 + * Output prefix that directs the assembler to use a direct-mode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1005 + * instruction if globally enabled, address is a symbol, and symbol
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1006 + * has been marked as in direct page. Also, never do this if
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1007 + * using the indirect mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1008 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1009 +print_direct_prefix (FILE * file, rtx addr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1010 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1011 + if (TARGET_DIRECT &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1012 + (GET_CODE (addr) == SYMBOL_REF) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1013 + SYMBOL_REF_FLAG (addr) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1014 + check_direct_prefix_flag)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1015 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1016 + putc ('*', file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1017 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1018 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1019 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1020 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1021 +/** Prints an operand (that is not an address) in assembly from RTL. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1022 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1023 +print_operand (FILE * file, rtx x, int code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1024 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1025 + if (REG_P (x)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1026 + /* gcc currently allocates the entire 16-bit 'd' register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1027 + * even when it only needs an 8-bit value. So here it
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1028 + * is tricked into printing only the lower 8-bit 'b'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1029 + * register into the assembly output.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1030 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1031 + * Eventually gcc should be modified to allocate a/b
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1032 + * independently and this hack can be removed.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1033 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1034 + * Occasionally, we may want to do an operation using
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1035 + * the 'a' register instead of 'b'; use the 'A' code
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1036 + * to specify that.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1037 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1038 + if (code == 'A')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1039 + fputs ("a", file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1040 + else if ((BYTE_MODE (x)) && (REGNO (x) == HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1041 + fputs ("b", file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1042 + else if (M_REG_P (x) && code == 'L')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1043 + /* Soft registers can be treated like memory and accessed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1044 + * at a particular offset. TODO : handle 'W' */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1045 + fputs (reg_names[REGNO (x)+1], file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1046 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1047 + fputs (reg_names[REGNO (x)], file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1048 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1049 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1050 + else if (MEM_P (x)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1051 + last_mem_size = GET_MODE_SIZE (GET_MODE (x));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1052 + if (code == 'L') { /* LSH of word address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1053 + if (GET_CODE (XEXP (x, 0)) == MEM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1054 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1055 + /* Offseting an indirect addressing mode is not supported */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1056 + error ("expression too complex for 6809 (offset indirect mode)");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1057 + debug_rtx (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1058 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1059 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1060 + x = adjust_address (x, QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1061 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1062 + else if (code == 'M') { /* MSH of word address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1063 + if (GET_CODE (XEXP (x, 0)) == MEM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1064 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1065 + /* Offseting an indirect addressing mode is not supported */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1066 + error ("expression too complex for 6809 (offset indirect mode)");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1067 + debug_rtx (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1068 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1069 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1070 + x = adjust_address (x, QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1071 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1072 + else if (code == 'W') { /* least significant half of 32-bit */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1073 + x = adjust_address (x, HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1074 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1075 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1076 + pic_ok_for_addr_p = (code != 'C');
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1077 + output_address (XEXP (x, 0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1078 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1079 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1080 + else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != DImode) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1081 + union { double d; int i[2]; } u;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1082 + u.i[0] = CONST_DOUBLE_LOW (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1083 + u.i[1] = CONST_DOUBLE_HIGH (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1084 + fprintf (file, "#%#9.9g", u.d);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1085 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1086 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1087 + else if (code == 'R') {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1088 + fprintf (file, "%s",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1089 + m6809_get_regs_printable (INTVAL (x)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1090 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1091 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1092 + else {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1093 + if (code == 'L') { /* LSH of word address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1094 + x = gen_rtx_CONST_INT (VOIDmode, (INTVAL(x) & 0xff));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1095 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1096 + else if (code == 'M') { /* MSH of word address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1097 + x = gen_rtx_CONST_INT (VOIDmode, ((INTVAL(x) >> 8) & 0xff));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1098 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1099 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1100 + putc ('#', file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1101 + output_addr_const (file, x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1102 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1103 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1104 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1105 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1106 +/** Prints an address operand to assembler from its RTL representation. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1107 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1108 +print_operand_address (FILE *file, rtx addr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1109 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1110 + register rtx base = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1111 + register rtx offset = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1112 + int regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1113 + int indirect_flag = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1114 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1115 + check_direct_prefix_flag = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1116 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1117 + /*** check for indirect addressing ***/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1118 + if (MEM_P (addr)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1119 + last_mem_size = GET_MODE_SIZE (GET_MODE (addr));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1120 + addr = XEXP (addr, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1121 + if (pic_ok_for_addr_p)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1122 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1123 + indirect_flag = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1124 + fprintf (file, "[");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1125 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1126 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1127 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1128 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1129 + switch (GET_CODE (addr)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1130 + case REG:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1131 + regno = REGNO (addr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1132 + fprintf (file, ",%s", reg_names[regno]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1133 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1134 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1135 + case PRE_DEC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1136 + regno = REGNO (XEXP (addr, 0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1137 + fputs (((last_mem_size == 1) ? ",-" : ",--"), file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1138 + fprintf (file, "%s", reg_names[regno]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1139 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1140 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1141 + case POST_INC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1142 + regno = REGNO (XEXP (addr, 0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1143 + fprintf (file, ",%s", reg_names[regno]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1144 + fputs (((last_mem_size == 1) ? "+" : "++"), file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1145 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1146 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1147 + case PLUS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1148 + base = XEXP (addr, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1149 + if (MEM_P (base))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1150 + base = XEXP (base, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1151 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1152 + offset = XEXP (addr, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1153 + if (MEM_P (offset))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1154 + offset = XEXP (offset, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1155 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1156 + if ((CONSTANT_ADDRESS_P (base)) && (CONSTANT_ADDRESS_P (offset))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1157 + if (!indirect_flag)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1158 + check_direct_prefix_flag = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1159 + output_addr_const (file, base);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1160 + check_direct_prefix_flag = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1161 + fputs ("+", file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1162 + output_addr_const (file, offset);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1163 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1164 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1165 + else if ((CONSTANT_ADDRESS_P (base)) && (A_REG_P (offset))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1166 + output_addr_const (file, base);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1167 + fprintf (file, ",%s", reg_names[REGNO (offset)]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1168 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1169 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1170 + else if ((CONSTANT_ADDRESS_P (offset)) && (A_REG_P (base))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1171 + output_addr_const (file, offset);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1172 + fprintf (file, ",%s", reg_names[REGNO (base)]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1173 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1174 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1175 + /*** accumulator offset ***/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1176 + else if (((D_REG_P (offset)) || (Q_REG_P (offset)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1177 + && (A_REG_P (base))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1178 + fprintf (file, "%s,%s",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1179 + reg_names[REGNO (offset)], reg_names[REGNO (base)]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1180 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1181 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1182 + else if (((D_REG_P (base)) || (Q_REG_P (base)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1183 + && (A_REG_P (offset))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1184 + fprintf (file, "%s,%s",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1185 + reg_names[REGNO (base)], reg_names[REGNO (offset)]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1186 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1187 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1188 + else if (GET_CODE (base) == PRE_DEC) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1189 + regno = REGNO (XEXP (base, 0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1190 + fputs (((last_mem_size == 1) ? ",-" : ",--"), file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1191 + fprintf (file, "%s", reg_names[regno]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1192 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1193 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1194 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1195 + abort ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1196 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1197 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1198 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1199 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1200 + /* Set this global before calling output_addr_const() */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1201 + if (!indirect_flag)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1202 + check_direct_prefix_flag = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1203 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1204 + /* When printing a SYMBOL_REF in PIC mode, do not print the leading
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1205 + * '#' and follow it by ',pcr' to enable relative addressing. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1206 + if (flag_pic && pic_ok_for_addr_p && GET_CODE (addr) == SYMBOL_REF)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1207 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1208 + ASM_OUTPUT_SYMBOL_REF (file, addr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1209 + fputs (",pcr", file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1210 + pic_ok_for_addr_p = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1211 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1212 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1213 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1214 + output_addr_const (file, addr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1215 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1216 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1217 + check_direct_prefix_flag = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1218 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1219 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1220 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1221 + if (indirect_flag)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1222 + fprintf (file, "]");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1223 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1224 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1225 +/*-------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1226 + Update the CC Status
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1227 +---------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1228 + Set the cc_status for the results of an insn whose pattern is EXP.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1229 + We assume that jumps don't affect the condition codes.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1230 + All else, clobbers the condition codes, by assumption.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1231 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1232 + We assume that ALL add, minus, etc. instructions effect the condition
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1233 + codes.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1234 +-------------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1235 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1236 +notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1237 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1238 + int src_code;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1239 + int dst_code;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1240 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1241 + /*** recognize SET insn's ***/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1242 + if (GET_CODE (exp) == SET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1243 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1244 + src_code = GET_CODE (SET_SRC (exp));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1245 + dst_code = GET_CODE (SET_DEST (exp));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1246 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1247 + /* Jumps do not alter the cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1248 + if (SET_DEST (exp) == pc_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1249 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1250 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1251 + /* Moving one register into another register (tfr):
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1252 + Doesn't alter the cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1253 + if (REG_P (SET_DEST (exp)) && (REG_P (SET_SRC (exp))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1254 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1255 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1256 + /* Moving memory into a register (load): Sets cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1257 + if (REG_P (SET_DEST (exp)) && src_code == MEM) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1258 + cc_status.value1 = SET_SRC (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1259 + cc_status.value2 = SET_DEST (exp);
438
f18cc0c87a7e Make 32 bit compares work better in gcc6809.
Brett Gordon <beretta42@gmail.com>
parents: 418
diff changeset
1260 + cc_status.flags |= CC_NO_OVERFLOW;
418
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1261 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1262 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1263 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1264 + /* Moving register into memory (store): Sets cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1265 + if (dst_code == MEM && REG_P (SET_SRC (exp))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1266 + cc_status.value1 = SET_SRC (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1267 + cc_status.value2 = SET_DEST (exp);
438
f18cc0c87a7e Make 32 bit compares work better in gcc6809.
Brett Gordon <beretta42@gmail.com>
parents: 418
diff changeset
1268 + cc_status.flags |= CC_NO_OVERFLOW;
418
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1269 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1270 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1271 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1272 + /* Function calls clobber the cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1273 + else if (GET_CODE (SET_SRC (exp)) == CALL) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1274 + CC_STATUS_INIT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1275 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1276 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1277 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1278 + /* Tests and compares set the cc's in predictable ways. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1279 + else if (SET_DEST (exp) == cc0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1280 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1281 + cc_status.flags = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1282 + cc_status.value1 = SET_SRC (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1283 + cc_status.value2 = SET_DEST (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1284 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1285 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1286 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1287 + else if (A_REG_P (SET_DEST (exp)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1288 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1289 + CC_STATUS_INIT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1290 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1291 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1292 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1293 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1294 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1295 + /* Certain instructions affect the condition codes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1296 + switch (src_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1297 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1298 + case PLUS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1299 + case MINUS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1300 + case NEG:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1301 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1302 + /* These instructions set the condition codes,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1303 + * and may modify the V bit. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1304 + cc_status.flags |= CC_NO_OVERFLOW;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1305 + /* FALLTHRU */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1306 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1307 + case AND:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1308 + case IOR:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1309 + case XOR:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1310 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1311 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1312 + /* These instructions set the condition codes,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1313 + * but cannot overflow (V=0). */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1314 + cc_status.value1 = SET_SRC (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1315 + cc_status.value2 = SET_DEST (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1316 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1317 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1318 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1319 + /* Everything else is clobbered */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1320 + CC_STATUS_INIT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1321 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1322 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1323 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1324 + } /* SET */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1325 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1326 + else if (GET_CODE (exp) == PARALLEL
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1327 + && GET_CODE (XVECEXP (exp, 0, 0)) == SET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1328 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1329 + if (SET_DEST (XVECEXP (exp, 0, 0)) == pc_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1330 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1331 + if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1332 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1333 + CC_STATUS_INIT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1334 + cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1335 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1336 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1337 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1338 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1339 + /*** default action if we haven't recognized something
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1340 + and returned earlier ***/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1341 + CC_STATUS_INIT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1342 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1343 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1344 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1345 +/** Returns nonzero if the expression EXP can be implemented using one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1346 + * of the 6809's single operand instructions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1347 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1348 +m6809_single_operand_operator (rtx exp)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1349 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1350 + rtx op1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1351 + HOST_WIDE_INT val;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1352 + enum rtx_code code;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1353 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1354 + debug_rtx(exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1355 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1356 + code = GET_CODE (exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1357 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1358 + /* Unary operators always qualify */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1359 + switch (code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1360 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1361 + case NEG:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1362 + case NOT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1363 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1364 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1365 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1366 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1367 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1368 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1369 + /* Binary operators can only qualify if the second
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1370 + * argument is a CONST_INT of certain value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1371 + op1 = XEXP (exp, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1372 + if (GET_CODE (op1) != CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1373 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1374 + val = INTVAL (op1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1375 + switch (code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1376 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1377 + case PLUS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1378 + case MINUS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1379 + if (val == -1 || val == 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1380 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1381 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1382 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1383 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1384 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1385 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1386 + case ROTATE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1387 + case ROTATERT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1388 + if (val == 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1389 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1390 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1391 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1392 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1393 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1394 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1395 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1396 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1397 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1398 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1399 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1400 +/** Return a bitarray of the hard registers which are used by a function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1401 +unsigned int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1402 +m6809_get_live_regs (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1403 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1404 + unsigned int regs = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1405 + int regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1406 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1407 + if (frame_pointer_needed)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1408 + regs |= (1 << HARD_FRAME_POINTER_REGNUM);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1409 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1410 + for (regno = HARD_X_REGNUM; regno <= HARD_U_REGNUM; regno++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1411 + if (df_regs_ever_live_p (regno) && ! call_used_regs[regno])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1412 + regs |= (1 << regno);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1413 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1414 + return regs;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1415 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1416 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1417 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1418 +/** Return a printable version of a list of hard registers, suitable
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1419 + * for use in a PSHx or PULx insn. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1420 +const char *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1421 +m6809_get_regs_printable (unsigned int regs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1422 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1423 + static char list[64];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1424 + char *listp = list;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1425 + unsigned int regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1426 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1427 + for (regno=0; regno < FIRST_PSEUDO_REGISTER; regno++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1428 + if ((regs & (1 << regno)) && !S_REGNO_P (regno))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1429 + listp += sprintf (listp,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1430 + (listp == list) ? "%s" : ",%s", reg_names[regno]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1431 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1432 + return list;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1433 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1434 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1435 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1436 +/** Return the total number of bytes covered by a set of hard registers. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1437 +unsigned int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1438 +m6809_get_regs_size (unsigned int regs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1439 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1440 + unsigned int regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1441 + unsigned int size = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1442 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1443 + for (regno=0; regno < FIRST_PSEUDO_REGISTER; regno++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1444 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1445 + /* Only count register in the given register set */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1446 + if (REGSET_CONTAINS_P (regno, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1447 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1448 + /* Add 1 or 2 byte, depending on the size of the register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1449 + * Since 'D' may be in both sets, check for WORD_REGSET first. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1450 + if (REGSET_CONTAINS_P(regno, WORD_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1451 + size += 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1452 + else if (REGSET_CONTAINS_P(regno, BYTE_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1453 + size++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1454 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1455 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1456 + return size;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1457 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1458 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1459 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1460 +/* Given the target of call instruction in X,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1461 + * return the tree node that contains the function declaration for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1462 + * that target.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1463 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1464 + * If the rtx or the tree do not appear valid for any reason,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1465 + * then return NULL_TREE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1466 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1467 +static tree call_target_decl (rtx x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1468 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1469 + tree decl;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1470 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1471 + /* Make sure the target is really a MEM. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1472 + if (!x || !MEM_P (x))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1473 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1474 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1475 + /* Make sure the address is a SYMBOL_REF. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1476 + x = XEXP (x, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1477 + if (!x || (GET_CODE (x) != SYMBOL_REF))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1478 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1479 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1480 + /* Get the declaration of this symbol */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1481 + decl = SYMBOL_REF_DECL (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1482 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1483 + /* Make sure the declaration is really a function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1484 + if (!decl || (TREE_CODE(decl) != FUNCTION_DECL))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1485 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1486 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1487 + return decl;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1488 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1489 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1490 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1491 +/** Returns nonzero if a function, whose declaration is in DECL,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1492 + * was declared to have the attribute given by ATTR_NAME. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1493 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1494 +m6809_function_has_type_attr_p (tree decl, const char *attr_name)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1495 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1496 + tree type;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1497 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1498 + type = TREE_TYPE (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1499 + return lookup_attribute (attr_name, TYPE_ATTRIBUTES (type)) != NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1500 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1501 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1502 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1503 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1504 +/** Returns nonzero if the current function was declared to have the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1505 + * attribute given by ATTR_NAME. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1506 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1507 +m6809_current_function_has_type_attr_p (const char *attr_name)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1508 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1509 + return m6809_function_has_type_attr_p (current_function_decl, attr_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1510 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1511 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1512 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1513 +/** Return nonzero if the current function has no return value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1514 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1515 +m6809_current_function_is_void (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1516 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1517 + return (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1518 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1519 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1520 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1521 +/** Get the value of a declaration's 'bank', as set by the 'bank'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1522 + * attribute. If no bank was declared, it returns NULL by default. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1523 +const char *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1524 +m6809_get_decl_bank (tree decl)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1525 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1526 + tree attr;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1527 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1528 + /* Lookup the 'bank' attribute. If it does not exist, then
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1529 + * return NULL */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1530 + attr = lookup_attribute ("bank", DECL_ATTRIBUTES (decl));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1531 + if (attr == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1532 + return NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1533 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1534 + /* Make sure it has a value assigned to it */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1535 + attr = TREE_VALUE (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1536 + if (attr == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1537 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1538 + warning (WARNING_OPT "banked function did not declare a bank number");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1539 + return NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1540 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1541 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1542 + /* Return the bank name */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1543 + attr = TREE_VALUE (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1544 + return TREE_STRING_POINTER (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1545 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1546 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1547 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1548 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1549 +m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1550 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1551 + /* Check the function declaration for special properties.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1552 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1553 + * If the function was declare with __attribute__((bank)), output
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1554 + * assembler definitions to force the function to go into the named
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1555 + * bank.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1556 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1557 + const char *bank_name = m6809_get_decl_bank (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1558 + if (bank_name != NULL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1559 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1560 + /* Declare __self_bank as a local assembler value that denotes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1561 + * which bank the current function is in. This is required only
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1562 + * when the bank actually changes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1563 + if (strcmp (bank_name, current_bank_name))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1564 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1565 + fprintf (asm_out_file, "__self_bank\t.equ %s\n", bank_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1566 + strcpy (current_bank_name, bank_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1567 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1568 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1569 + /* Declare a global assembler value that denotes which bank the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1570 + * named function is in. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1571 + fprintf (asm_out_file, "__%s_bank\t.gblequ %s\n", name, bank_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1572 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1573 + /* Force the current function into a new area */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1574 + fprintf (asm_out_file, "\t.bank bank_%s (FSFX=_%s)\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1575 + bank_name, bank_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1576 + fprintf (asm_out_file, "\t.area bank_%s (BANK=bank_%s)\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1577 + bank_name, bank_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1578 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1579 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1580 + /* Emit the label for the function's name */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1581 + ASM_OUTPUT_LABEL (asm_out_file, name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1582 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1583 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1584 +#if 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1585 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1586 + * Handle pragmas. Note that only the last branch pragma seen in the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1587 + * source has any affect on code generation.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1588 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1589 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1590 +#define BAD_PRAGMA(msgid, arg) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1591 + do { warning (WARNING_OPT msgid, arg); return -1; } while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1592 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1593 +static int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1594 +pragma_parse (const char *name, tree *sect)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1595 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1596 + tree s, x;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1597 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1598 + if (pragma_lex (&x) != CPP_OPEN_PAREN)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1599 + BAD_PRAGMA ("missing '(' after '#pragma %s' - ignored", name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1600 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1601 + if (pragma_lex (&s) != CPP_STRING)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1602 + BAD_PRAGMA ("missing section name in '#pragma %s' - ignored", name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1603 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1604 + if (pragma_lex (&x) != CPP_CLOSE_PAREN)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1605 + BAD_PRAGMA ("missing ')' for '#pragma %s' - ignored", name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1606 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1607 + if (pragma_lex (&x) != CPP_EOF)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1608 + warning (WARNING_OPT "junk at end of '#pragma %s'", name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1609 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1610 + *sect = s;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1611 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1612 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1613 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1614 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1615 +/*
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1616 + * Handle #pragma section.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1617 + * This is deprecated; code should use __attribute__(section("name"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1618 + * instead.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1619 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1620 +void pragma_section (cpp_reader *pfile ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1621 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1622 + tree sect;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1623 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1624 + if (pragma_parse ("section", &sect))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1625 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1626 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1627 + snprintf (code_section_op, 6+TREE_STRING_LENGTH (sect),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1628 + ".area\t%s", TREE_STRING_POINTER (sect));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1629 + snprintf (data_section_op, 6+TREE_STRING_LENGTH (sect),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1630 + ".area\t%s", TREE_STRING_POINTER (sect));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1631 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1632 + /* Mark a flag that sections have changed. Upon emitting another
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1633 + * declaration, the new .area directive will be written. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1634 + section_changed++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1635 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1636 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1637 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1638 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1639 + * Check a `double' value for validity for a particular machine mode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1640 + * Called by the CHECK_FLOAT_VALUE() machine-dependent macro.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1641 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1642 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1643 +check_float_value (enum machine_mode mode, double *d, int overflow)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1644 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1645 + if (mode == SFmode) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1646 + if (*d > 1.7014117331926443e+38) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1647 + error("magnitude of constant too large for `float'");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1648 + *d = 1.7014117331926443e+38;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1649 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1650 + else if (*d < -1.7014117331926443e+38) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1651 + error("magnitude of constant too large for `float'");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1652 + *d = -1.7014117331926443e+38;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1653 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1654 + else if ((*d > 0) && (*d < 2.9387358770557188e-39)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1655 + warning(WARNING_OPT "`float' constant truncated to zero");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1656 + *d = 0.0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1657 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1658 + else if ((*d < 0) && (*d > -2.9387358770557188e-39)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1659 + warning(WARNING_OPT "`float' constant truncated to zero");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1660 + *d = 0.0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1661 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1662 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1663 + return overflow;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1664 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1665 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1666 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1667 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1668 +/** Declare that the target supports named output sections. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1669 +bool m6809_have_named_section = (bool)1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1670 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1671 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1672 +/** Write to the assembler file a directive to place
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1673 + * subsequent objects to a different section in the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1674 + * object file. ASxxxx uses the "area" directive for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1675 + * this purpose. It does not however support generalized
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1676 + * alignment, and can only place items on an odd/even
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1677 + * boundary. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1678 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1679 +m6809_asm_named_section (
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1680 + const char *name,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1681 + unsigned int flags ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1682 + tree decl)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1683 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1684 + fprintf (asm_out_file, "\t.area\t%s\n", name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1685 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1686 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1687 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1688 +enum reg_class
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1689 +m6809_preferred_reload_class (rtx x, enum reg_class regclass)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1690 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1691 + /* Check cases based on type code of rtx */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1692 + switch (GET_CODE(x))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1693 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1694 + /*
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1695 + * Observation, 2015-07-19, William Astle
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1696 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1697 + * The original comparison for range for 16 bits was wrong, adding 0x80
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1698 + * instead of 0x8000. Replaced both 8 bit and 16 bit comparisions with
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1699 + * a more straight forward range comparison - excessive cleverness isn't
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1700 + * really required here.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1701 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1702 + case CONST_INT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1703 + /* Constants that can fit into 1 byte should be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1704 + * loaded into a Q_REGS reg */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1705 + if ((INTVAL(x) >= -128 && INTVAL(x) <= 127) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1706 +// if (((unsigned) (INTVAL(x) + 0x80) < 0x100) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1707 + (regclass > A_REGS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1708 + return Q_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1709 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1710 + /* 16-bit constants should be loaded into A_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1711 + * when possible. gcc may already require A_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1712 + * or D_REGS for certain types of instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1713 + * This case applies mostly to simple copy operations
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1714 + * to/from memory when any register will do, but
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1715 + * it's best to avoid using D register since it is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1716 + * needed for other things.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1717 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1718 + else if ((INTVAL(x) >= -32768 && INTVAL(x) <= 32767) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1719 +// else if (((unsigned) (INTVAL(x) + 0x80) < 0x10000) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1720 + (regclass > A_REGS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1721 + return A_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1722 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1723 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1724 + case SYMBOL_REF:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1725 + case LABEL_REF:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1726 + /* Addresses should always be loaded into A_REGS */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1727 + if (regclass >= A_REGS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1728 + return (A_REGS);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1729 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1730 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1731 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1732 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1733 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1734 + /* Check cases based on mode of rtx */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1735 + if ((GET_MODE(x) == QImode) && (regclass != A_REGS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1736 + return Q_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1737 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1738 + /* Default: return whatever class reload suggested */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1739 + return regclass;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1740 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1741 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1742 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1743 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1744 + * Check a new declaration for the "section" attribute.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1745 + * If it exists, and the target section is "direct", then mark
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1746 + * the declaration (in RTL) to indicate special treatment.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1747 + * When the variable is referenced later, we test for this flag
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1748 + * and can emit special asm text to force the assembler to use
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1749 + * short instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1750 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1751 +static void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1752 +m6809_encode_section_info (tree decl, rtx rtl, int new_decl_p ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1753 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1754 + tree attr, id;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1755 + const char *name;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1756 + const char *decl_name;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1757 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1758 + /* We only care about variable declarations, not functions */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1759 + if (TREE_CODE (decl) != VAR_DECL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1760 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1761 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1762 + /* For debugging purposes only; grab the decl's name */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1763 + decl_name = IDENTIFIER_POINTER (DECL_NAME (decl));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1764 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1765 + /* Give up if the decl doesn't have any RTL */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1766 + if (!DECL_RTL (decl))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1767 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1768 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1769 + /* See if it has a section attribute */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1770 + attr = lookup_attribute ("section", DECL_ATTRIBUTES (decl));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1771 + if (!attr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1772 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1773 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1774 + /* See if the section attribute has a value */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1775 + id = TREE_VALUE (TREE_VALUE (attr));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1776 + if (!id)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1777 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1778 + name = TREE_STRING_POINTER (id);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1779 + if (!name)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1780 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1781 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1782 + /* See if the value is 'direct'. If so, mark it. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1783 + if (!strcmp (name, "direct"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1784 + SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1785 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1786 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1787 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1788 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1789 + * Output code to perform a complex shift, for which there is no
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1790 + * direct support in the instruction set.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1791 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1792 + * shift1 is an instruction pattern for performing a 1-bit modification.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1793 + * This code wraps that pattern in a loop to perform the shift N times,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1794 + * where N is given by the address register in operands[2].
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1795 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1796 + * To support 16-bit shifts, shift2 can also be provided: it is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1797 + * a second instruction to be included in the loop. 8-bit shift
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1798 + * insns will pass NULL here.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1799 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1800 + * The insn length of shift1/shift2 is assumed to be 1 byte,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1801 + * which works in all of the cases it is needed so far.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1802 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1803 +static void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1804 +m6809_gen_register_shift (
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1805 + rtx *operands,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1806 + const char *shift1,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1807 + const char *shift2 )
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1808 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1809 + char beq_pattern[32];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1810 + char bra_pattern[32];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1811 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1812 + int shiftlen = (shift1 && shift2) ? 2 : 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1813 + int cmplen = (REGNO (operands[2]) == HARD_X_REGNUM) ? 3 : 4;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1814 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1815 + int beq_offset = 2 + shiftlen + 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1816 + int bra_offset = shiftlen + 2 + cmplen + 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1817 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1818 + sprintf (beq_pattern, "beq\t.+%d", beq_offset);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1819 + sprintf (bra_pattern, "bra\t.-%d", bra_offset);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1820 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1821 + output_asm_insn ("pshs\t%2", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1822 + output_asm_insn ("lea%2\t-1,%2", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1823 + output_asm_insn ("cmp%2\t#-1", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1824 + output_asm_insn (beq_pattern, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1825 + if (shift1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1826 + output_asm_insn (shift1, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1827 + if (shift2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1828 + output_asm_insn (shift2, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1829 + output_asm_insn (bra_pattern, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1830 + output_asm_insn ("puls\t%2", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1831 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1832 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1833 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1834 +/** Generate RTL for the upper 8-bits of a 16-bit constant. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1835 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1836 +gen_rtx_const_high (rtx r)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1837 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1838 + unsigned char v = (INTVAL (r) >> 8) & 0xFF;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1839 + signed char s = (signed char)v;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1840 + return gen_int_mode (s, QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1841 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1842 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1843 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1844 +/** Generate RTL for the lower 8-bits of a 16-bit constant. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1845 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1846 +gen_rtx_const_low (rtx r)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1847 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1848 + unsigned char v = INTVAL (r) & 0xFF;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1849 + signed char s = (signed char)v;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1850 + return gen_int_mode (s, QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1851 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1852 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1853 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1854 +/** Generate RTL to allocate/free bytes on the stack.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1855 + * CODE is given as MINUS when allocating and PLUS when freeing,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1856 + * to match the semantics of a downward-growing stack. SIZE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1857 + * is always given as a positive integer.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1858 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1859 +static rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1860 +gen_rtx_stack_adjust (enum rtx_code code, int size)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1861 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1862 + if (size <= 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1863 + return NULL_RTX;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1864 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1865 + if (code == MINUS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1866 + size = -size;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1867 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1868 + return gen_rtx_SET (Pmode, stack_pointer_rtx,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1869 + gen_rtx_PLUS (Pmode, stack_pointer_rtx,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1870 + gen_int_mode (size, HImode)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1871 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1872 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1873 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1874 +/** Generate RTL to push/pop a set of registers. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1875 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1876 +gen_rtx_register_pushpop (int op, int regs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1877 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1878 + rtx nregs = gen_int_mode (regs, QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1879 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1880 + if (op == UNSPEC_PUSH_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1881 + return gen_register_push (nregs);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1882 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1883 + return gen_register_pop (nregs);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1884 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1885 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1886 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1887 +/* Given a register set REGS, where the bit positions correspond to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1888 + * hard register numbers, return another bitmask that represents the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1889 + * order in which those registers would be pushed/popped.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1890 + * Registers that are pushed first have higher bit positions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1891 + * The pop order is just the reverse bitmask.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1892 + * These values are the same as the bitmasks actually used in the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1893 + * machine instructions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1894 +static unsigned int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1895 +register_push_order (int regs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1896 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1897 + unsigned int order = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1898 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1899 + if (REGSET_CONTAINS_P (HARD_PC_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1900 + order |= 0x80;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1901 + if (REGSET_CONTAINS_P (HARD_U_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1902 + order |= 0x40;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1903 + if (REGSET_CONTAINS_P (HARD_Y_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1904 + order |= 0x20;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1905 + if (REGSET_CONTAINS_P (HARD_X_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1906 + order |= 0x10;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1907 + if (REGSET_CONTAINS_P (HARD_DP_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1908 + order |= 0x8;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1909 + if (REGSET_CONTAINS_P (HARD_B_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1910 + order |= 0x4;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1911 + if (REGSET_CONTAINS_P (HARD_A_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1912 + order |= 0x2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1913 + if (REGSET_CONTAINS_P (HARD_CC_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1914 + order |= 0x1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1915 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1916 + if (REGSET_CONTAINS_P (HARD_D_REGNUM, regs))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1917 + order |= (0x4 | 0x2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1918 + return order;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1919 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1920 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1921 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1922 +/* Returns nonzero if two consecutive push or pop instructions,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1923 + * as determined by the OP, can be merged into a single instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1924 + * The first instruction in the sequence pushes/pops REGS1; the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1925 + * second applies to REGS2.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1926 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1927 + * If true, the resulting instruction can use (regs1 | regs2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1928 + * safely.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1929 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1930 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1931 +m6809_can_merge_pushpop_p (int op, int regs1, int regs2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1932 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1933 + /* Register sets must not overlap */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1934 + if (regs1 & regs2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1935 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1936 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1937 + if (op == UNSPEC_PUSH_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1938 + return (register_push_order (regs1) > register_push_order (regs2));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1939 + else if (op == UNSPEC_POP_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1940 + return (register_push_order (regs1) < register_push_order (regs2));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1941 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1942 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1943 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1944 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1945 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1946 +/** Emit instructions for making a library call.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1947 + * MODE is the mode of the operation.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1948 + * NAME is the library function name.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1949 + * OPERANDS is the rtx array provided by the recognizer.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1950 + * COUNT is the number of input operands to the call, and
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1951 + * should be 1 for a unary op or 2 for a binary op.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1952 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1953 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1954 +emit_libcall_insns (enum machine_mode mode,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1955 + const char *name,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1956 + rtx *operands,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1957 + int count)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1958 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1959 + /* Generate an rtx for the call target. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1960 + rtx symbol = gen_rtx_SYMBOL_REF (Pmode, name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1961 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1962 + /* Emit the library call. Slightly different based
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1963 + on the number of operands */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1964 + if (count == 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1965 + emit_library_call (symbol, LCT_NORMAL, mode,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1966 + 2, operands[1], mode, operands[2], mode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1967 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1968 + emit_library_call (symbol, LCT_NORMAL, mode,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1969 + 1, operands[1], mode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1970 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1971 + /* The library call is expected to put its result
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1972 + in LIBCALL_VALUE, so need to copy it into the destination. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1973 + emit_move_insn (operands[0], LIBCALL_VALUE(mode));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1974 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1975 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1976 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1977 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1978 + * A small helper function that writes out a single branch instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1979 + * OPCODE is the short name, e.g. "ble".
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1980 + * OPERANDS has the rtx for the target label.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1981 + * LONG_P is nonzero if we are emitting a long branch, and need to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1982 + * prepend an 'l' to the opcode name.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1983 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1984 +void output_branch_insn1 (const char *opcode, rtx *operands, int long_p)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1985 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1986 + char pattern[64];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1987 + sprintf (pattern, "%s%s\t%%l0", long_p ? "l" : "", opcode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1988 + output_asm_insn (pattern, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1989 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1990 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1991 +/**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1992 + * Output a branch/conditional branch insn of the proper
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1993 + * length. code identifies the particular branch insn.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1994 + * operands holds the branch target in operands[0].
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1995 + * length says what the size of this insn should be.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1996 + * Based on the length, we know whether it should be a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1997 + * short (8-bit) or long (16-bit) branch.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1998 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
1999 +const char *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2000 +output_branch_insn (enum rtx_code code, rtx *operands, int length)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2001 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2002 + int shortform;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2003 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2004 + /* Decide whether or not to use the long or short form.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2005 + * Calculate automatically based on insn lengths. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2006 + shortform = ((length > 2) ? 0 : 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2007 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2008 + /* Determine the proper opcode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2009 + * Use the short (2-byte) opcode if the target is within
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2010 + * reach. Otherwise, use jmp (3-byte opcode), unless
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2011 + * compiling with -fpic, in which case we'll need to use
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2012 + * lbra (4-byte opcode).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2013 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2014 + switch (code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2015 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2016 + case LABEL_REF:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2017 + if (shortform)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2018 + output_branch_insn1 ("bra", operands, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2019 + else if (flag_pic)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2020 + output_branch_insn1 ("bra", operands, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2021 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2022 + output_branch_insn1 ("jmp", operands, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2023 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2024 + case EQ:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2025 + output_branch_insn1 ("beq", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2026 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2027 + case NE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2028 + output_branch_insn1 ("bne", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2029 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2030 + case GT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2031 + output_branch_insn1 ("bgt", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2032 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2033 + case GTU:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2034 + output_branch_insn1 ("bhi", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2035 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2036 + case LT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2037 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2038 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2039 + output_branch_insn1 ("bmi", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2040 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2041 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2042 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2043 + output_branch_insn1 ("blt", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2044 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2045 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2046 + case LTU:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2047 + output_branch_insn1 ("blo", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2048 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2049 + case GE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2050 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2051 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2052 + output_branch_insn1 ("bpl", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2053 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2054 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2055 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2056 + output_branch_insn1 ("bge", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2057 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2058 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2059 + case GEU:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2060 + output_branch_insn1 ("bhs", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2061 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2062 + case LE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2063 + if (cc_prev_status.flags & CC_NO_OVERFLOW)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2064 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2065 + output_branch_insn1 ("bmi", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2066 + output_branch_insn1 ("beq", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2067 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2068 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2069 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2070 + output_branch_insn1 ("ble", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2071 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2072 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2073 + case LEU:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2074 + output_branch_insn1 ("bls", operands, !shortform);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2075 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2076 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2077 + abort();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2078 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2079 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2080 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2081 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2082 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2083 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2084 +/** Returns the "cost" of an RTL expression.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2085 + * In general, the expression "COSTS_N_INSNS(1)" is used to represent
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2086 + * the cost of a fast 8-bit arithmetic instruction that operates on
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2087 + * a reg/mem or a reg/immed. Other costs are relative to this.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2088 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2089 + * Notes:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2090 + * - The cost of a REG is always zero; this cannot be changed.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2091 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2092 + * - On the 6809, instructions on two registers will nearly always take
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2093 + * longer than those that operate on a register and a constant/memory,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2094 + * because of the way the instruction set is structured.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2095 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2096 + * TODO: multiply HImode by 2 should be done via shifts, instead of add.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2097 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2098 +static bool
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2099 +m6809_rtx_costs (rtx X, int code, int outer_code ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2100 + int *total, bool speed)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2101 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2102 + int has_const_arg = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2103 + HOST_WIDE_INT const_arg;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2104 + enum machine_mode mode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2105 + int nargs = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2106 + rtx op0, op1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2107 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2108 + /* Data RTXs return a value between 0-3, depending on complexity.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2109 + All of these are less than COSTS_N_INSNS(1). */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2110 + switch (code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2111 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2112 + case CC0:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2113 + case PC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2114 + *total = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2115 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2116 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2117 + case CONST_INT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2118 + if (X == const0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2119 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2120 + *total = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2121 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2122 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2123 + else if ((unsigned) INTVAL (X) < 077)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2124 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2125 + *total = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2126 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2127 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2128 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2129 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2130 + *total = 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2131 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2132 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2133 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2134 + case LABEL_REF: case CONST:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2135 + *total = 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2136 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2137 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2138 + case SYMBOL_REF:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2139 + /* References to memory are made cheaper if they have
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2140 + * the 'direct' mode attribute set */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2141 + *total = (SYMBOL_REF_FLAG (X)) ? 1 : 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2142 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2143 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2144 + case MEM:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2145 + /* See what form of address was given */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2146 + X = XEXP (X, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2147 + switch (GET_CODE (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2148 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2149 + case SYMBOL_REF:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2150 + *total = (SYMBOL_REF_FLAG (X)) ? 1 : 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2151 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2152 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2153 + case CONST_INT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2154 + *total = 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2155 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2156 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2157 + case MEM:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2158 + *total = COSTS_N_INSNS (1) + 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2159 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2160 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2161 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2162 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2163 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2164 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2165 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2166 + case CONST_DOUBLE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2167 + /* TODO : not sure about this value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2168 + *total = 3;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2169 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2170 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2171 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2172 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2173 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2174 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2175 + /* Decode the rtx */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2176 + mode = GET_MODE (X);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2177 + op0 = XEXP (X, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2178 + op1 = XEXP (X, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2179 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2180 + /* We don't implement anything in SImode or greater. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2181 + if (GET_MODE_SIZE (mode) >= GET_MODE_SIZE (SImode))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2182 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2183 + *total = COSTS_N_INSNS (100);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2184 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2185 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2186 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2187 + /* Figure out if there is a constant argument, and its value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2188 + if (GET_RTX_CLASS (code) == RTX_BIN_ARITH
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2189 + || GET_RTX_CLASS (code) == RTX_COMM_ARITH)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2190 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2191 + nargs = 2;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2192 + if (GET_CODE (op1) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2193 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2194 + has_const_arg = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2195 + const_arg = INTVAL (op1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2196 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2197 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2198 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2199 + /* Penalize a reg/reg operation by adding MEMORY_MOVE_COST,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2200 + * Ignore soft registers, since these are really in memory.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2201 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2202 + * TODO: penalize HImode reg/reg for most operations, except maybe
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2203 + * additions since index registers allow for that.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2204 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2205 + * TODO: shifts by constant N do not always require N instructions;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2206 + * some of this can be done cheaper. The number of actual insns can be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2207 + * predicted well.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2208 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2209 + if (nargs == 2 && REAL_REG_P (op0) && REAL_REG_P (op1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2210 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2211 + *total = MEMORY_MOVE_COST (mode, Q_REGS, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2212 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2213 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2214 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2215 + *total = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2216 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2217 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2218 + /* Operator RTXs are counted as COSTS_N_INSNS(N), where N is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2219 + the estimated number of actual machine instructions needed to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2220 + perform the computation. Some small adjustments are made since
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2221 + some "instructions" are more complex than others. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2222 + switch (code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2223 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2224 + case PLUS: case MINUS: case COMPARE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2225 + /* 6809 handles these natively in QImode, and in HImode as long
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2226 + * as operand 1 is constant. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2227 + if (mode == QImode || (mode == HImode && has_const_arg))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2228 + *total += COSTS_N_INSNS (1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2229 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2230 + *total += COSTS_N_INSNS (GET_MODE_SIZE (mode));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2231 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2232 + /* -1, 0, and 1 can be done using inherent instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2233 + * for PLUS and MINUS in QImode, so don't add extra cost. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2234 + if (has_const_arg
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2235 + && (mode == QImode || mode == HImode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2236 + && (const_arg == -1 || const_arg == 0 || const_arg == 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2237 + && (code == PLUS || code == MINUS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2238 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2239 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2240 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2241 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2242 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2243 + case AND: case IOR: case XOR:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2244 + case NEG: case NOT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2245 + /* 6809 handles these natively in QImode, but requires
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2246 + * splitting in HImode. Treat these as 2 insns. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2247 + *total += COSTS_N_INSNS (1) * GET_MODE_SIZE (mode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2248 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2249 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2250 + case ASHIFT: case ASHIFTRT: case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2251 + case ROTATE: case ROTATERT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2252 + /* 6809 can do shift/rotates of a QImode by a constant in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2253 + * 1 insn times the shift count, or in HImode by a constant
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2254 + * by splitting to 2 insns.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2255 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2256 + * Shift by a nonconstant will take significantly longer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2257 + * than any of these. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2258 + if (has_const_arg)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2259 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2260 + const_arg %= (GET_MODE_SIZE (mode) * 8);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2261 + if (const_arg == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2262 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2263 + *total += COSTS_N_INSNS(1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2264 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2265 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2266 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2267 + /* HImode shifts greater than 8 get optimized due
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2268 + * to register transfer from b to a; this cuts down the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2269 + * cost. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2270 + if (const_arg >= 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2271 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2272 + *total += COSTS_N_INSNS (1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2273 + const_arg -= 8;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2274 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2275 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2276 + /* The computed cost is 'const_arg' 1-bit shifts, doubled
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2277 + if in HImode, minus the cost of the constant itself which
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2278 + will be added in later but really shouldn't be. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2279 + *total += COSTS_N_INSNS (const_arg) * GET_MODE_SIZE (mode) - 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2280 + return true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2281 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2282 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2283 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2284 + /* It may take up to 7 iterations of about 6-7 real
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2285 + * instructions, so make this expensive. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2286 + *total += COSTS_N_INSNS (50);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2287 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2288 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2289 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2290 + case MULT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2291 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2292 + /* Multiply is cheap when both arguments are 8-bits. They
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2293 + could be QImode, or QImode widened to HImode, or a constant
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2294 + that fits into 8-bits. As long as both operands qualify,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2295 + we can use a single mul instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2296 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2297 + Assume that fast multiply can be used, and change this if we find
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2298 + differently... */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2299 + int ok_for_qihi3 = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2300 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2301 + /* Check the first operand */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2302 + switch (GET_MODE (op0))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2303 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2304 + case QImode:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2305 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2306 + case HImode:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2307 + if (GET_CODE (op0) != SIGN_EXTEND && GET_CODE (op0) != ZERO_EXTEND)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2308 + ok_for_qihi3 = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2309 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2310 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2311 + ok_for_qihi3 = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2312 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2313 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2314 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2315 + /* Likewise, check the second operand. This is where constants may appear. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2316 + switch (GET_MODE (op1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2317 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2318 + case QImode:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2319 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2320 + case HImode:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2321 + if (GET_CODE (op1) != SIGN_EXTEND && GET_CODE (op1) != ZERO_EXTEND)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2322 + ok_for_qihi3 = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2323 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2324 + case VOIDmode:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2325 + if (!CONST_OK_FOR_LETTER_P (const_arg, 'K'))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2326 + ok_for_qihi3 = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2327 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2328 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2329 + ok_for_qihi3 = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2330 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2331 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2332 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2333 + /* Fast multiply takes about 4 times as many cycles as a normal
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2334 + arithmetic operation. Otherwise, it will take an expensive libcall. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2335 + if (ok_for_qihi3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2336 + *total += COSTS_N_INSNS (4);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2337 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2338 + *total = COSTS_N_INSNS (50);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2339 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2340 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2341 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2342 + case DIV: case UDIV: case MOD: case UMOD:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2343 + /* These all require more expensive libcalls. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2344 + *total += COSTS_N_INSNS (100);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2345 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2346 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2347 + /* TODO : TRUNCATE, SIGN_EXTEND, and ZERO_EXTEND */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2348 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2349 + /* These can normally be done with autoincrement, etc., so
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2350 + * don't charge for them. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2351 + case PRE_DEC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2352 + case PRE_INC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2353 + case POST_DEC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2354 + case POST_INC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2355 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2356 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2357 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2358 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2359 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2360 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2361 + /* Always return false, and let the caller gather the costs
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2362 + * of the operands */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2363 + return false;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2364 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2365 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2366 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2367 +static tree
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2368 +m6809_handle_fntype_attribute (tree *node, tree name,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2369 + tree args ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2370 + int flags ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2371 + bool *no_add_attrs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2372 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2373 + if (TREE_CODE (*node) != FUNCTION_TYPE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2374 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2375 + warning (WARNING_OPT "'%s' only valid for functions",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2376 + IDENTIFIER_POINTER (name));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2377 + *no_add_attrs = TRUE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2378 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2379 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2380 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2381 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2382 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2383 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2384 +static tree
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2385 +m6809_handle_data_type_attribute (tree *node ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2386 + tree name ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2387 + tree args ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2388 + int flags ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2389 + bool *no_add_attrs ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2390 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2391 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2392 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2393 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2394 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2395 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2396 +static tree
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2397 +m6809_handle_default_attribute (tree *node ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2398 + tree name ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2399 + tree args ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2400 + int flags ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2401 + bool *no_add_attrs ATTRIBUTE_UNUSED )
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2402 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2403 + return NULL_TREE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2404 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2405 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2406 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2407 +/* Table of valid machine attributes */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2408 +const struct attribute_spec m6809_attribute_table[] = { /*
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2409 +{ name, min, max, decl, type, fntype, handler } */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2410 +{ "interrupt", 0, 0, false, true, true, m6809_handle_fntype_attribute },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2411 +{ "naked", 0, 0, false, true, true, m6809_handle_fntype_attribute },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2412 +{ "far", 0, 1, false, true, true, m6809_handle_fntype_attribute },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2413 +{ "bank", 0, 1, true, false, false, m6809_handle_default_attribute },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2414 +{ "boolean", 0, 0, false, true, false, m6809_handle_data_type_attribute },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2415 +{ NULL, 0, 0, false, true, false, NULL },
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2416 +};
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2417 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2418 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2419 +/** Initialize builtin routines for the 6809. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2420 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2421 +m6809_init_builtins (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2422 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2423 + /* Create type trees for each function signature required.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2424 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2425 + * void_ftype_void = void f(void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2426 + * void_ftype_uchar = void f(unsigned char)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2427 + * uchar_ftype_uchar2 = unsigned char f (unsigned char, unsigned char)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2428 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2429 + tree void_ftype_void =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2430 + build_function_type (void_type_node, void_list_node);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2431 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2432 + tree void_ftype_uchar =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2433 + build_function_type (void_type_node,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2434 + tree_cons (NULL_TREE, unsigned_char_type_node, void_list_node));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2435 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2436 + tree uchar_ftype_uchar2 =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2437 + build_function_type (unsigned_char_type_node,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2438 + tree_cons (NULL_TREE, unsigned_char_type_node,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2439 + tree_cons (NULL_TREE, unsigned_char_type_node, void_list_node)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2440 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2441 + /* Register each builtin function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2442 + add_builtin_function ("__builtin_swi", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2443 + M6809_SWI, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2444 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2445 + add_builtin_function ("__builtin_swi2", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2446 + M6809_SWI2, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2447 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2448 + add_builtin_function ("__builtin_swi3", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2449 + M6809_SWI3, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2450 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2451 + add_builtin_function ("__builtin_cwai", void_ftype_uchar,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2452 + M6809_CWAI, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2453 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2454 + add_builtin_function ("__builtin_sync", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2455 + M6809_SYNC, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2456 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2457 + add_builtin_function ("__builtin_nop", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2458 + M6809_NOP, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2459 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2460 + add_builtin_function ("__builtin_blockage", void_ftype_void,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2461 + M6809_BLOCKAGE, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2462 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2463 + add_builtin_function ("__builtin_add_decimal", uchar_ftype_uchar2,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2464 + M6809_ADD_DECIMAL, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2465 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2466 + add_builtin_function ("__builtin_add_carry", uchar_ftype_uchar2,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2467 + M6809_ADD_CARRY, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2468 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2469 + add_builtin_function ("__builtin_sub_carry", uchar_ftype_uchar2,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2470 + M6809_SUB_CARRY, BUILT_IN_MD, NULL, NULL_TREE);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2471 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2472 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2473 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2474 +/** Used by m6809_expand_builtin, given a tree ARGLIST which
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2475 + * refers to the operands of a builtin call, return an rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2476 + * that represents the nth operand, as denoted by OPNUM, which
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2477 + * is a zero-based integer. MODE gives the expected mode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2478 + * of the operand.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2479 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2480 + * This rtx is suitable for use in the emitted RTL for the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2481 + * builtin instruction. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2482 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2483 +m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2484 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2485 + tree arg;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2486 + rtx r;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2487 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2488 + arg = CALL_EXPR_ARG (arglist, opnum);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2489 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2490 + /* Convert the tree to RTL */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2491 + r = expand_expr (arg, NULL_RTX, mode, EXPAND_NORMAL);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2492 + if (r == NULL_RTX)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2493 + return NULL_RTX;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2494 + return r;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2495 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2496 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2497 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2498 +/** Expand a builtin that was registered in init_builtins into
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2499 + * RTL. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2500 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2501 +m6809_expand_builtin (tree exp,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2502 + rtx target,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2503 + rtx subtarget ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2504 + enum machine_mode mode ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2505 + int ignore ATTRIBUTE_UNUSED )
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2506 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2507 + tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2508 + tree arglist = exp;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2509 + unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2510 + rtx r0, r1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2511 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2512 + switch (fcode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2513 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2514 + case M6809_SWI:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2515 + r0 = gen_rtx_CONST_INT (VOIDmode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2516 + emit_insn (target = gen_m6809_swi (r0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2517 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2518 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2519 + case M6809_SWI2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2520 + r0 = gen_rtx_CONST_INT (VOIDmode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2521 + emit_insn (target = gen_m6809_swi (r0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2522 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2523 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2524 + case M6809_SWI3:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2525 + r0 = gen_rtx_CONST_INT (VOIDmode, 3);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2526 + emit_insn (target = gen_m6809_swi (r0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2527 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2528 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2529 + case M6809_CWAI:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2530 + r0 = m6809_builtin_operand (arglist, QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2531 + emit_insn (target = gen_m6809_cwai (r0));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2532 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2533 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2534 + case M6809_SYNC:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2535 + emit_insn (target = gen_m6809_sync ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2536 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2537 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2538 + case M6809_ADD_CARRY:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2539 + r0 = m6809_builtin_operand (arglist, QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2540 + r1 = m6809_builtin_operand (arglist, QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2541 + if (!target)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2542 + target = gen_reg_rtx (QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2543 + emit_insn (gen_addqi3_carry (target, r0, r1));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2544 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2545 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2546 + case M6809_SUB_CARRY:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2547 + r0 = m6809_builtin_operand (arglist, QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2548 + r1 = m6809_builtin_operand (arglist, QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2549 + if (!target)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2550 + target = gen_reg_rtx (QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2551 + emit_insn (gen_subqi3_carry (target, r0, r1));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2552 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2553 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2554 + case M6809_NOP:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2555 + emit_insn (target = gen_nop ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2556 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2557 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2558 + case M6809_BLOCKAGE:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2559 + emit_insn (target = gen_blockage ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2560 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2561 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2562 + case M6809_ADD_DECIMAL:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2563 + r0 = m6809_builtin_operand (arglist, QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2564 + r1 = m6809_builtin_operand (arglist, QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2565 + if (!target)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2566 + target = gen_reg_rtx (QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2567 + emit_insn (gen_addqi3_decimal (target, r0, r1));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2568 + return target;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2569 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2570 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2571 + warning (WARNING_OPT "unknown builtin expansion ignored");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2572 + return NULL_RTX;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2573 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2574 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2575 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2576 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2577 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2578 +/* Returns nonzero if 'x' represents a function that was declared
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2579 + * as __noreturn__. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2580 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2581 +noreturn_functionp (rtx x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2582 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2583 + tree decl = call_target_decl (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2584 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2585 + if (decl == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2586 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2587 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2588 + return TREE_THIS_VOLATILE (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2589 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2590 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2591 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2592 +const char *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2593 +far_function_type_p (tree type)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2594 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2595 + tree attr;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2596 + const char *page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2597 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2598 + /* Return whether or not this decl has the far attribute */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2599 + attr = lookup_attribute ("far", TYPE_ATTRIBUTES (type));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2600 + if (attr == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2601 + return NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2602 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2603 + /* If it is far, check for a value */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2604 + attr = TREE_VALUE (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2605 + if (attr == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2606 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2607 + warning (WARNING_OPT "far code page not specified, using local value");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2608 + return far_code_page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2609 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2610 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2611 + /* We have a TREE_LIST of attribute values, get the first one.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2612 + * It should be an INTEGER_CST. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2613 + attr = TREE_VALUE (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2614 + page = TREE_STRING_POINTER (attr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2615 + return page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2616 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2617 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2618 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2619 +/* For a far function, returns the identifier that states which page
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2620 + * it resides in. Otherwise, returns NULL for ordinary functions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2621 +const char *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2622 +far_functionp (rtx x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2623 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2624 + tree decl, decl_type;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2625 + const char *page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2626 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2627 + /* Find the FUNCTION_DECL corresponding to the rtx being called. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2628 + decl = call_target_decl (x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2629 + if (decl == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2630 + return NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2631 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2632 + /* See if the function has the new 'banked' attribute. These
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2633 + * are numeric instead of text */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2634 + page = m6809_get_decl_bank (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2635 + if (page)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2636 + return page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2637 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2638 + /* No, lookup the type of the function and see if the type
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2639 + * specifies far or not. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2640 + decl_type = TREE_TYPE (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2641 + if (decl_type == NULL_TREE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2642 + return NULL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2643 + return far_function_type_p (decl_type);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2644 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2645 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2646 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2647 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2648 +/** Outputs the assembly language for a far call. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2649 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2650 +output_far_call_insn (rtx *operands, int has_return)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2651 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2652 + static char page_data[64];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2653 + const char *called_page;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2654 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2655 + /* The logic is the same for functions whether or not there
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2656 + * is a return value. Skip over the return value in this
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2657 + * case, so that the call location is always operands[0]. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2658 + if (has_return)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2659 + operands++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2660 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2661 + /* Get the name of the page being called */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2662 + called_page = far_functionp (operands[0]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2663 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2664 +#if 0 /* TODO : broken logic */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2665 + /* See if the called page name is a 'bank' */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2666 + if (isdigit (*called_page))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2667 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2668 + /* New style banking */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2669 + if (!strcmp (called_page, current_bank_name))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2670 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2671 + /* Same page */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2672 + output_asm_insn ("jsr\t%0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2673 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2674 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2675 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2676 + /* Different page */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2677 + output_asm_insn ("jsr\t__far_call_handler\t;new style", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2678 + output_asm_insn ("\t.dw\t%0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2679 + sprintf (page_data, "\t.db\t%s", called_page);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2680 + output_asm_insn (page_data, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2681 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2682 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2683 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2684 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2685 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2686 + /* Are we calling a different page than we are running in? */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2687 + if (!strcmp (called_page, far_code_page))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2688 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2689 + /* Same page : no need to execute a far call */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2690 + if (flag_pic)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2691 + output_asm_insn ("lbsr\t%C0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2692 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2693 + output_asm_insn ("jsr\t%0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2694 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2695 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2696 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2697 + /* Different page : need to emit far call thunk */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2698 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2699 + /* First output a call to the thunk for making far calls. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2700 + if (flag_pic)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2701 + output_asm_insn ("lbsr\t__far_call_handler", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2702 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2703 + output_asm_insn ("jsr\t__far_call_handler\t;old style", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2704 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2705 + /* Now output the name of the call site */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2706 + output_asm_insn ("\t.dw\t%C0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2707 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2708 + /* Finally output the page number */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2709 + sprintf (page_data, "\t.db\t%s", far_functionp (operands[0]));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2710 + output_asm_insn (page_data, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2711 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2712 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2713 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2714 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2715 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2716 +m6809_init_cumulative_args (CUMULATIVE_ARGS cum ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2717 + tree fntype,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2718 + rtx libname ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2719 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2720 + cum = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2721 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2722 + /* For far functions, the current implementation does not allow for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2723 + * stack parameters. So note whenever the called function is far
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2724 + * and in a different page than the current one; such a function
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2725 + * should give an error if a stack parameter is generated. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2726 + if (fntype)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2727 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2728 + const char *called_page = far_function_type_p (fntype);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2729 + if (called_page && strcmp (called_page, far_code_page) && !TARGET_FAR_STACK_PARAM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2730 + cum |= CUM_STACK_INVALID;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2731 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2732 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2733 + if (fntype && TYPE_ARG_TYPES (fntype) != 0 &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2734 + (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2735 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2736 + /* has variable arguments, cannot use registers */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2737 + cum |= (CUM_X_MASK | CUM_B_MASK | CUM_STACK_ONLY);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2738 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2739 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2740 + if (m6809_abi_version == M6809_ABI_VERSION_STACK)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2741 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2742 + /* cannot use registers ; only use the stack */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2743 + cum |= (CUM_STACK_ONLY | CUM_X_MASK | CUM_B_MASK);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2744 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2745 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2746 + return cum;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2747 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2748 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2749 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2750 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2751 +m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2752 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2753 + if (*cump & CUM_STACK_INVALID)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2754 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2755 + *cump &= ~CUM_STACK_INVALID;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2756 + error ("far function needs stack, will not work");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2757 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2758 + return NULL_RTX;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2759 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2760 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2761 +void m6809_asm_trampoline_template(FILE *f)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2762 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2763 + fprintf(f, "ldy #0000\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2764 + fprintf(f, "jmp 0x0000\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2765 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2766 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2767 +/*
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2768 + * Trampoline output:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2769 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2770 + * ldu #&cxt 4 bytes --LDY- ?? ??
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2771 + * jmp fnaddr 3 bytes JMP ?? ??
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2772 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2773 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2774 +m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2775 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2776 + rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2777 + /* TODO - optimize by generating the entire trampoline code here,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2778 + * and removing the template altogether, since there are only two
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2779 + * bytes there that matter. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2780 + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2781 + emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 5)), fnaddr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2782 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2783 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2784 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2785 +/** Echo the version of the compiler and the name of the source file
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2786 + * at the beginning of each assembler output file. asm_out_file
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2787 + * is a global FILE * pointing to the output stream. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2788 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2789 +m6809_asm_file_start (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2790 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2791 + const char *module_name;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2792 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2793 + fprintf (asm_out_file, "\n;;; gcc for m6809 : %s %s\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2794 + __DATE__, __TIME__);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2795 + fprintf (asm_out_file, ";;; %s\n", version_string);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2796 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2797 + fprintf (asm_out_file, ";;; ABI version %d\n", m6809_abi_version);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2798 + fprintf (asm_out_file, ";;; %s\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2799 + (TARGET_BYTE_INT ? "-mint8" : "-mint16"));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2800 + if (TARGET_EXPERIMENT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2801 + fprintf (asm_out_file, ";;; -mexperiment\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2802 + if (TARGET_WPC)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2803 + fprintf (asm_out_file, ";;; -mwpc\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2804 + if (TARGET_6309)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2805 + fprintf (asm_out_file, ";;; -m6309\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2806 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2807 + /* Print the name of the module, which is taken as the base name
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2808 + * of the input file.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2809 + * See the 'User-Defined Symbols' section of the assembler
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2810 + * documentation for the rules on valid symbols.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2811 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2812 + module_name = lbasename (main_input_filename);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2813 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2814 + fprintf (asm_out_file, "\t.module\t");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2815 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2816 + if (*module_name >= '0' && *module_name <= '9')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2817 + fprintf (asm_out_file, "_");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2818 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2819 + while (*module_name)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2820 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2821 + if ((*module_name >= '0' && *module_name <= '9')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2822 + || (*module_name >= 'A' && *module_name <= 'Z')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2823 + || (*module_name >= 'a' && *module_name <= 'z')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2824 + || *module_name == '$'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2825 + || *module_name == '.'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2826 + || *module_name == '_')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2827 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2828 + fprintf (asm_out_file, "%c", *module_name);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2829 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2830 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2831 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2832 + fprintf (asm_out_file, "_");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2833 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2834 + module_name++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2835 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2836 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2837 + fprintf (asm_out_file, "\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2838 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2839 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2840 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2841 +/** Returns true if prologue/epilogue code is required for the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2842 + * current function being compiled.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2843 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2844 + * This is just the inverse of whether the function is declared as
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2845 + * 'naked'.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2846 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2847 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2848 +prologue_epilogue_required (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2849 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2850 + return !m6809_current_function_has_type_attr_p ("naked")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2851 + && !m6809_current_function_has_type_attr_p ("noreturn");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2852 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2853 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2854 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2855 +/** Expand RTL for function entry */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2856 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2857 +emit_prologue_insns (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2858 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2859 + rtx insn;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2860 + unsigned int live_regs = m6809_get_live_regs ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2861 + unsigned int frame_size = get_frame_size ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2862 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2863 + /* Save all registers used, including the frame pointer */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2864 + if (live_regs && !m6809_current_function_has_type_attr_p ("interrupt"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2865 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2866 + insn = emit_insn (
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2867 + gen_rtx_register_pushpop (UNSPEC_PUSH_RS, live_regs));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2868 + RTX_FRAME_RELATED_P (insn) = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2869 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2870 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2871 + /* Allocate space for local variables */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2872 + if (frame_size != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2873 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2874 + insn = emit_insn (gen_rtx_stack_adjust (MINUS, frame_size));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2875 + RTX_FRAME_RELATED_P (insn) = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2876 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2877 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2878 + /* Set the frame pointer if it is needed */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2879 + if (frame_pointer_needed)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2880 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2881 + insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2882 + RTX_FRAME_RELATED_P (insn) = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2883 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2884 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2885 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2886 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2887 +/** Expand RTL for function exit */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2888 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2889 +emit_epilogue_insns (bool sibcall_p)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2890 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2891 + unsigned int live_regs = m6809_get_live_regs ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2892 + unsigned int frame_size = get_frame_size ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2893 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2894 + if (frame_size != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2895 + emit_insn (gen_rtx_stack_adjust (PLUS, frame_size));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2896 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2897 + if (sibcall_p)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2898 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2899 + if (live_regs)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2900 + emit_insn (gen_rtx_register_pushpop (UNSPEC_POP_RS, live_regs));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2901 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2902 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2903 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2904 + if (live_regs && !m6809_current_function_has_type_attr_p ("interrupt"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2905 + emit_insn (
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2906 + gen_rtx_register_pushpop (UNSPEC_POP_RS, PC_REGBIT | live_regs));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2907 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2908 + if (m6809_current_function_has_type_attr_p ("interrupt"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2909 + emit_jump_insn (gen_return_rti ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2910 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2911 + emit_jump_insn (gen_return_rts ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2912 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2913 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2914 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2915 +#if 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2916 +/** Predefine some preprocessor names according to the currently
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2917 + * selected compiler options */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2918 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2919 +m6809_cpu_cpp_builtins (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2920 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2921 + if (TARGET_6309)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2922 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2923 + builtin_define_std ("__M6309__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2924 + builtin_define_std ("__m6309__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2925 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2926 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2927 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2928 + builtin_define_std ("__M6809__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2929 + builtin_define_std ("__m6809__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2930 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2931 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2932 + if (TARGET_BYTE_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2933 + builtin_define_std ("__int8__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2934 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2935 + builtin_define_std ("__int16__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2936 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2937 + switch (m6809_abi_version)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2938 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2939 + case M6809_ABI_VERSION_STACK:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2940 + builtin_define_std ("__regargs__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2941 + builtin_define_std ("__ABI_STACK__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2942 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2943 + case M6809_ABI_VERSION_REGS:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2944 + builtin_define_std ("__ABI_REGS__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2945 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2946 + case M6809_ABI_VERSION_BX:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2947 + builtin_define_std ("__ABI_BX__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2948 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2949 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2950 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2951 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2952 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2953 + if (TARGET_WPC)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2954 + builtin_define_std ("__WPC__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2955 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2956 + if (TARGET_DRET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2957 + builtin_define_std ("__DRET__");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2958 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2959 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2960 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2961 +#define MAX_ASM_ASCII_STRING 48
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2962 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2963 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2964 +m6809_output_ascii (FILE *fp, const char *str, unsigned long size)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2965 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2966 + unsigned long i;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2967 + bool use_ascii = true;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2968 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2969 + /* If the size is too large, then break this up into multiple
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2970 + outputs. The assembler can only output roughly 48 bytes at a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2971 + time. Note that if there are lots of escape sequences in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2972 + the string, this may fail. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2973 + if (size > MAX_ASM_ASCII_STRING)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2974 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2975 + m6809_output_ascii (fp, str, MAX_ASM_ASCII_STRING);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2976 + m6809_output_ascii (fp, str + MAX_ASM_ASCII_STRING,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2977 + size - MAX_ASM_ASCII_STRING);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2978 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2979 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2980 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2981 + /* Check for 8-bit codes, which cannot be embedded in an .ascii */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2982 + for (i = 0; i < size; i++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2983 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2984 + int c = str[i] & 0377;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2985 + if (c >= 0x80)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2986 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2987 + use_ascii = false;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2988 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2989 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2990 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2991 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2992 + if (use_ascii)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2993 + fprintf (fp, "\t.ascii \"");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2994 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2995 + for (i = 0; i < size; i++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2996 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2997 + int c = str[i] & 0377;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2998 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
2999 + if (use_ascii)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3000 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3001 + /* Just output the plain character if it is printable,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3002 + otherwise output the escape code for the character.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3003 + The assembler recognizes the same C-style octal escape sequences,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3004 + except that it only supports 7-bit codes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3005 + if (c >= ' ' && c < 0177 && c != '\\' && c != '"')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3006 + putc (c, fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3007 + else switch (c)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3008 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3009 + case '\n':
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3010 +#ifndef TARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3011 + fputs ("\\n", fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3012 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3013 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3014 + /* On the CoCo, we fallthrough and treat '\n' like '\r'. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3015 + case '\r':
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3016 + fputs ("\\r", fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3017 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3018 + case '\t':
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3019 + fputs ("\\t", fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3020 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3021 + case '\f':
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3022 + fputs ("\\f", fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3023 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3024 + case 0:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3025 + fputs ("\\0", fp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3026 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3027 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3028 + fprintf (fp, "\\%03o", c);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3029 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3030 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3031 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3032 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3033 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3034 + fprintf (fp, "\t.byte\t0x%02X\n", c);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3035 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3036 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3037 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3038 + if (use_ascii)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3039 + fprintf (fp, "\"\n");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3040 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3041 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3042 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3043 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3044 +m6809_output_quoted_string (FILE *asm_file, const char *string)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3045 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3046 + char c;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3047 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3048 + if (strlen (string) > MAX_ASM_ASCII_STRING)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3049 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3050 + /* The string length is too large. We'll have to truncate it.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3051 + This is only called from debugging functions, so it's usually
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3052 + not critical. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3053 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3054 + char truncated_string[MAX_ASM_ASCII_STRING+1];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3055 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3056 + /* Copy as many characters as we can. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3057 + strncpy (truncated_string, string, MAX_ASM_ASCII_STRING);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3058 + truncated_string[MAX_ASM_ASCII_STRING] = '\0';
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3059 + string = truncated_string;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3060 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3061 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3062 + /* Copied from toplev.c */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3063 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3064 + putc ('\"', asm_file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3065 + while ((c = *string++) != 0) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3066 + if (ISPRINT (c)) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3067 + if (c == '\"' || c == '\\')
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3068 + putc ('\\', asm_file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3069 + putc (c, asm_file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3070 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3071 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3072 + fprintf (asm_file, "\\%03o", (unsigned char) c);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3073 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3074 + putc ('\"', asm_file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3075 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3076 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3077 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3078 +/** Output the assembly code for a shift instruction where the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3079 + * shift count is not constant. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3080 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3081 +m6809_output_shift_insn (int rtx_code, rtx *operands)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3082 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3083 + struct shift_opcode *op;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3084 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3085 + if (GET_CODE (operands[2]) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3086 + abort ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3087 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3088 + if (optimize_size && GET_MODE (operands[0]) == HImode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3089 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3090 + switch (rtx_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3091 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3092 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3093 + output_asm_insn ("jsr\t_ashlhi3", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3094 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3095 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3096 + output_asm_insn ("jsr\t_ashrhi3", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3097 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3098 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3099 + output_asm_insn ("jsr\t_lshrhi3", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3100 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3101 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3102 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3103 + else if (GET_MODE (operands[0]) == HImode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3104 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3105 + switch (rtx_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3106 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3107 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3108 + m6809_gen_register_shift (operands, "aslb", "rola");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3109 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3110 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3111 + m6809_gen_register_shift (operands, "asra", "rorb");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3112 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3113 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3114 + m6809_gen_register_shift (operands, "lsra", "rorb");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3115 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3116 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3117 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3118 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3119 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3120 + switch (rtx_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3121 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3122 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3123 + m6809_gen_register_shift (operands, "aslb", NULL);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3124 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3125 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3126 + m6809_gen_register_shift (operands, "asrb", NULL);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3127 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3128 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3129 + m6809_gen_register_shift (operands, "lsrb", NULL);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3130 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3131 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3132 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3133 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3134 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3135 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3136 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3137 +m6809_emit_move_insn (rtx dst, rtx src)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3138 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3139 + emit_insn (gen_rtx_SET (VOIDmode, dst, src));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3140 + if (ACC_A_REG_P (dst))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3141 + emit_insn (gen_rtx_USE (VOIDmode, dst));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3142 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3143 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3144 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3145 +/** Split a complex shift instruction into multiple CPU
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3146 + * shift instructions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3147 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3148 +m6809_split_shift (enum rtx_code code, rtx *operands)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3149 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3150 + enum machine_mode mode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3151 + int count;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3152 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3153 + mode = GET_MODE (operands[0]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3154 + count = INTVAL (operands[2]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3155 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3156 + /* Handle a shift count outside the range of 0 .. N-1, where
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3157 + * N is the mode size in bits. We normalize the count, and
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3158 + * for negative counts we also invert the direction of the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3159 + * shift. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3160 + if ((count < 0) || (count >= 8 * GET_MODE_SIZE (mode)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3161 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3162 + if (count < 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3163 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3164 + count = -count;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3165 + code = (code == ASHIFT) ? ASHIFTRT : ASHIFT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3166 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3167 + count %= (8 * GET_MODE_SIZE (mode));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3168 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3169 + gen_rtx_fmt_ee (code, mode, operands[1],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3170 + gen_rtx_CONST_INT (VOIDmode, count)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3171 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3172 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3173 + /* Handle shift by zero explicitly as a no-op. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3174 + if (count == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3175 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3176 + emit_insn (gen_nop ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3177 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3178 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3179 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3180 + /* Decompose the shift by a constant N > 8 into two
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3181 + * shifts, first by 8 and then by N-8.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3182 + * This "speeds up" the process for large shifts that would be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3183 + * handled below, but allows for some optimization.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3184 + * In some cases shift by 8 can be implemented fast. If an
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3185 + * instruction to shift by 8 is defined, it will be used here;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3186 + * otherwise it will be further decomposed as below. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3187 + if (mode == HImode && count > 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3188 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3189 + rtx output = operands[0];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3190 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3191 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3192 + gen_rtx_fmt_ee (code, mode, operands[1],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3193 + gen_rtx_CONST_INT (VOIDmode, 8)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3194 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3195 + /* Unsigned shifts always produce a zero in either the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3196 + * upper or lower half of the output; then, that part
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3197 + * does not need to be shifted anymore. We modify the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3198 + * output and the subsequent instructions to operate in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3199 + * QImode only on the relevant part. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3200 + if (REG_P (output))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3201 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3202 + if (code == ASHIFT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3203 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3204 + output = gen_rtx_REG (QImode, HARD_A_REGNUM);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3205 + mode = QImode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3206 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3207 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3208 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3209 + output = gen_rtx_REG (QImode, HARD_D_REGNUM);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3210 + mode = QImode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3211 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3212 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3213 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3214 + m6809_emit_move_insn (output,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3215 + gen_rtx_fmt_ee (code, mode, copy_rtx (output),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3216 + gen_rtx_CONST_INT (VOIDmode, count-8)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3217 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3218 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3219 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3220 + /* Rewrite the unsigned shift of an 8-bit register by a large constant N
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3221 + * (near to the maximum of 8) as a rotate and mask. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3222 + if (mode == QImode && REG_P (operands[0]) && count >= ((code == ASHIFTRT) ? 7 : 6))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3223 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3224 + unsigned int mask;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3225 + unsigned int was_signed = (code == ASHIFTRT);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3226 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3227 + code = (code == ASHIFT) ? ROTATERT : ROTATE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3228 + if (code == ROTATE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3229 + mask = (count == 6) ? 0x03 : 0x01;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3230 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3231 + mask = (count == 6) ? 0xC0 - 0x100 : 0x80 - 0x100;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3232 + count = 9 - count;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3233 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3234 + do {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3235 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3236 + gen_rtx_fmt_ee (code, QImode, operands[1], const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3237 + } while (--count != 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3238 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3239 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3240 + gen_rtx_fmt_ee (AND, QImode, operands[1],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3241 + gen_rtx_CONST_INT (VOIDmode, mask)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3242 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3243 + if (was_signed)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3244 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3245 + emit_insn (gen_negqi2 (operands[0], copy_rtx (operands[0])));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3246 + if (ACC_A_REG_P (operands[0]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3247 + emit_insn (gen_rtx_USE (VOIDmode, operands[0]));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3248 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3249 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3250 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3251 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3252 + /* Decompose the shift by any constant N > 1 into a sequence
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3253 + * of N shifts.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3254 + * This is done recursively, by creating a shift by 1 and a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3255 + * shift by N-1, as long as N>1. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3256 + if (count > 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3257 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3258 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3259 + gen_rtx_fmt_ee (code, mode, operands[1], const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3260 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3261 + m6809_emit_move_insn (operands[0],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3262 + gen_rtx_fmt_ee (code, mode, operands[1],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3263 + gen_rtx_CONST_INT (VOIDmode, count-1)));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3264 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3265 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3266 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3267 + /* Decompose the single shift of a 16-bit quantity into two
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3268 + * CPU instructions, one for each 8-bit half.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3269 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3270 + if (mode == HImode && count == 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3271 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3272 + rtx first, second;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3273 + enum rtx_code rotate_code;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3274 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3275 + rotate_code = (code == ASHIFT) ? ROTATE : ROTATERT;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3276 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3277 + /* Split the operand into two 8-bit entities.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3278 + * FIRST is the one that will get shifted via a regular CPU
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3279 + * instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3280 + * SECOND is the one that will have the result of the first shift
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3281 + * rotated in.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3282 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3283 + * We initialize first and second as if we are doing a left shift,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3284 + * then swap the operands if it's a right shift.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3285 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3286 + if (REG_P (operands[0]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3287 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3288 + first = gen_rtx_REG (QImode, HARD_D_REGNUM); /* HARD_B_REGNUM? */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3289 + second = gen_rtx_REG (QImode, HARD_A_REGNUM);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3290 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3291 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3292 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3293 + first = adjust_address (operands[0], QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3294 + second = adjust_address (operands[0], QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3295 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3296 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3297 + if (rotate_code == ROTATERT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3298 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3299 + rtx tmp; tmp = first; first = second; second = tmp;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3300 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3301 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3302 + /* Decompose into a shift and a rotate instruction. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3303 + m6809_emit_move_insn (first,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3304 + gen_rtx_fmt_ee (code, QImode, copy_rtx (first), const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3305 + m6809_emit_move_insn (second,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3306 + gen_rtx_fmt_ee (rotate_code, QImode, copy_rtx (second), const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3307 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3308 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3309 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3310 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3311 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3312 +/** Adjust register usage based on compile-time flags. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3313 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3314 +m6809_conditional_register_usage (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3315 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3316 + unsigned int soft_regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3317 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3318 +#ifdef CONFIG_SOFT_REGS_ALWAYS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3319 + m6809_soft_regs = CONFIG_SOFT_REGS_ALWAYS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3320 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3321 + if (!m6809_soft_reg_count)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3322 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3323 + m6809_soft_regs = atoi (m6809_soft_reg_count);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3324 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3325 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3326 + if (m6809_soft_regs == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3327 + return;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3328 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3329 + if (m6809_soft_regs > NUM_M_REGS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3330 + m6809_soft_regs = NUM_M_REGS;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3331 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3332 + /* Registers are marked FIXED by default. Free up if
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3333 + the user wishes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3334 + for (soft_regno = 1; soft_regno < m6809_soft_regs; soft_regno++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3335 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3336 + fixed_regs[SOFT_M0_REGNUM + soft_regno] = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3337 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3338 + /* Mark the softregs as call-clobbered, so that they need
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3339 + * not be saved/restored on function entry/exit. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3340 + call_used_regs[SOFT_M0_REGNUM + soft_regno] = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3341 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3342 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3343 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3344 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3345 +/** Return a RTX representing how to return a value from a function.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3346 + VALTYPE gives the type of the value, FUNC identifies the function
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3347 + itself.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3348 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3349 + In general, we only care about the width of the result. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3350 +rtx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3351 +m6809_function_value (const tree valtype, const tree func ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3352 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3353 + unsigned int regno;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3354 + enum machine_mode mode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3355 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3356 + /* Get the mode (i.e. width) of the result. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3357 + mode = TYPE_MODE (valtype);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3358 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3359 + if (lookup_attribute ("boolean", TYPE_ATTRIBUTES (valtype)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3360 + regno = HARD_Z_REGNUM;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3361 + else if (mode == QImode || (TARGET_DRET && mode == HImode))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3362 + regno = HARD_D_REGNUM;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3363 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3364 + regno = HARD_X_REGNUM;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3365 + return gen_rtx_REG (mode, regno);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3366 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3367 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3368 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3369 +/** Return 1 if REGNO is possibly needed to return the result
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3370 +of a function, 0 otherwise. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3371 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3372 +m6809_function_value_regno_p (unsigned int regno)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3373 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3374 + if (regno == HARD_Z_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3375 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3376 + else if ((TARGET_BYTE_INT || TARGET_DRET) && regno == HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3377 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3378 + else if (!TARGET_DRET && regno == HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3379 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3380 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3381 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3382 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3383 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3384 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3385 +#ifdef TRACE_PEEPHOLE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3386 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3387 +m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3388 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3389 + if (stage == PEEP_END)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3390 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3391 + printf ("%s: peephole %d pattern and predicate matched\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3392 + main_input_filename, peephole_id);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3393 + fflush (stdout);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3394 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3395 + else if (stage == PEEP_COND)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3396 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3397 + printf ("%s: peephole %d? at least pattern matched\n",
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3398 + main_input_filename, peephole_id);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3399 + fflush (stdout);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3400 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3401 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3402 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3403 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3404 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3405 +m6809_match_peephole2 (unsigned int peephole_id ATTRIBUTE_UNUSED,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3406 + unsigned int stage ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3407 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3408 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3409 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3410 +#endif /* TRACE_PEEPHOLE */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3411 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3412 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3413 +/** Return 1 if it is OK to store a value of MODE in REGNO. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3414 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3415 +m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3416 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3417 + /* Soft registers, as they are just memory, can really hold
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3418 + values of any type. However we restrict them to values of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3419 + size HImode or QImode to prevent exhausting them for larger
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3420 + values.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3421 + Word values cannot be placed into the first soft register,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3422 + as it is the low byte that is being placed there, which
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3423 + corrupts the (non-soft) register before it. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3424 + if (M_REGNO_P (regno))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3425 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3426 + switch (GET_MODE_SIZE (mode))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3427 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3428 + case 1:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3429 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3430 + case 2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3431 + return regno != SOFT_M0_REGNUM;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3432 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3433 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3434 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3435 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3436 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3437 + /* VOIDmode can be stored anywhere */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3438 + else if (mode == VOIDmode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3439 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3440 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3441 + /* Zero is a reserved register, but problems occur if we don't
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3442 + say yes here??? */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3443 + else if (regno == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3444 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3445 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3446 + /* For other registers, return true only if the requested size
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3447 + exactly matches the hardware size. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3448 + else if ((G_REGNO_P (regno)) && (GET_MODE_SIZE (mode) == 2))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3449 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3450 + else if ((BYTE_REGNO_P (regno)) && (GET_MODE_SIZE (mode) == 1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3451 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3452 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3453 + return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3454 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3455 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3456 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3457 +/* exp is the call expression. DECL is the called function,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3458 + * or NULL for an indirect call */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3459 +bool
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3460 +m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3461 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3462 + tree type, arg;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3463 + const char *name;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3464 + bool result = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3465 + int argcount = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3466 + int step = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3467 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3468 + /* If there is no DECL, it is an indirect call.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3469 + * Never optimize this??? */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3470 + if (decl == NULL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3471 + goto done;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3472 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3473 + /* Never allow an interrupt handler to be optimized this way. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3474 + if (m6809_function_has_type_attr_p (decl, "interrupt"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3475 + goto done;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3476 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3477 + /* Skip sibcall if the type can't be found for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3478 + * some reason */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3479 + step++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3480 + name = IDENTIFIER_POINTER (DECL_NAME (decl));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3481 + type = TREE_TYPE (decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3482 + if (type == NULL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3483 + goto done;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3484 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3485 + /* Skip sibcall if the target is a far function */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3486 + step++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3487 + if (far_function_type_p (type) != NULL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3488 + goto done;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3489 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3490 + /* Skip sibcall if the called function's arguments are
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3491 + * variable */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3492 + step++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3493 + if (TYPE_ARG_TYPES (type) == NULL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3494 + goto done;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3495 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3496 + /* Allow sibcalls in other cases. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3497 + result = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3498 +done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3499 + /* printf ("%s ok for sibcall? %s, step %d, args %d\n", name, result ? "yes" : "no", step, argcount); */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3500 + return result;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3501 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3502 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3503 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3504 +/** Emit code for the 'casesi' pattern.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3505 + * This pattern is only used in 8-bit mode, and can be disabled
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3506 + * with -mold-case there as well. The rationale for this is to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3507 + * do a better job than the simpler but well-tested 'tablejump'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3508 + * method.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3509 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3510 + * For small jumptables, where the switch expression is an
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3511 + * 8-bit value, the lookup can be done more efficiently
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3512 + * using the "B,X" style index mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3513 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3514 +m6809_do_casesi (rtx index, rtx lower_bound, rtx range,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3515 + rtx table_label, rtx default_label)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3516 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3517 + enum machine_mode mode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3518 + rtx scaled;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3519 + rtx table_in_reg;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3520 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3521 + /* expr.c has to be patched so that it does not promote
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3522 + * the expression to SImode, but rather to HImode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3523 + * Fail now if that isn't the case. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3524 + if (GET_MODE_SIZE (GET_MODE (index)) > GET_MODE_SIZE (HImode))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3525 + error ("try_casesi promotion bug");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3526 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3527 + /* Determine whether or not we are going to work primarily in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3528 + * QImode or HImode. This depends on the size of the index
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3529 + * into the lookup table. QImode can only be used when the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3530 + * index is less than 0x40, since it will be doubled but
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3531 + * must remain unsigned. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3532 + if ((GET_CODE (range) == CONST_INT) && (INTVAL (range) < 0x40))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3533 + mode = QImode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3534 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3535 + mode = HImode;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3536 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3537 + /* Convert to QImode if necessary */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3538 + if (mode == QImode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3539 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3540 + index = gen_lowpart_general (mode, index);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3541 + lower_bound = gen_lowpart_general (mode, lower_bound);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3542 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3543 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3544 + /* Translate from case value to table index by subtraction */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3545 + if (lower_bound != const0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3546 + index = expand_binop (mode, sub_optab, index, lower_bound,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3547 + NULL_RTX, 0, OPTAB_LIB_WIDEN);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3548 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3549 + /* Emit compare-and-jump to test for index out-of-range */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3550 + emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3551 + default_label);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3552 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3553 + /* Put the table address is in a register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3554 + table_in_reg = gen_reg_rtx (Pmode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3555 + emit_move_insn (table_in_reg, gen_rtx_LABEL_REF (Pmode, table_label));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3556 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3557 + /* Emit table lookup and jump */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3558 + if (mode == QImode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3559 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3560 + /* Scale the index */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3561 + scaled = gen_reg_rtx (QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3562 + emit_insn (gen_ashlqi3 (scaled, index, const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3563 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3564 + /* Emit the jump */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3565 + emit_jump_insn (gen_tablejump_short_offset (scaled, table_in_reg));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3566 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3567 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3568 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3569 + /* Scale the index */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3570 + emit_insn (gen_ashlhi3 (index, index, const1_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3571 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3572 + /* Emit the jump */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3573 + emit_jump_insn (gen_tablejump_long_offset (index, table_in_reg));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3574 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3575 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3576 + /* Copied from expr.c */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3577 + if (!CASE_VECTOR_PC_RELATIVE && !flag_pic)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3578 + emit_barrier ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3579 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3580 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3581 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3582 +/** Output the assembly code for a 32-bit add/subtract. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3583 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3584 +m6809_output_addsi3 (int rtx_code, rtx *operands)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3585 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3586 + rtx xoperands[8];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3587 + rtx dst = operands[0];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3588 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3589 + /* Prepare the operands by splitting each SImode into two HImodes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3590 + that can be operated independently. The high word of operand 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3591 + is further divided into two QImode components for use with 'adc'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3592 + style instructions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3593 + xoperands[7] = operands[3];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3594 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3595 + xoperands[0] = adjust_address (dst, HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3596 + xoperands[3] = adjust_address (dst, HImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3597 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3598 +#if 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3599 + xoperands[2] = adjust_address (operands[1], HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3600 + xoperands[6] = adjust_address (operands[1], HImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3601 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3602 + /* Operand 2 may be a MEM or a CONST_INT */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3603 + if (GET_CODE (operands[2]) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3604 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3605 + xoperands[1] = gen_int_mode (INTVAL (operands[2]) & 0xFFFF, HImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3606 + xoperands[4] = gen_int_mode ((INTVAL (operands[2]) >> 24) & 0xFF, QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3607 + xoperands[5] = gen_int_mode ((INTVAL (operands[2]) >> 16) & 0xFF, QImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3608 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3609 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3610 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3611 + xoperands[1] = adjust_address (operands[2], HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3612 + xoperands[4] = adjust_address (operands[2], QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3613 + xoperands[5] = adjust_address (operands[2], QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3614 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3615 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3616 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3617 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3618 +#if 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3619 + xoperands[1] = adjust_address (operands[1], HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3620 + xoperands[4] = adjust_address (operands[1], QImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3621 + xoperands[5] = adjust_address (operands[1], QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3622 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3623 + /* Operand 2 may be a MEM or a CONST_INT */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3624 + if (GET_CODE (operands[2]) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3625 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3626 + xoperands[2] = gen_int_mode ((INTVAL (operands[2])) & 0xFFFF, HImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3627 + xoperands[6] = gen_int_mode ((INTVAL (operands[2]) >> 16) & 0xFFFF, HImode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3628 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3629 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3630 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3631 + xoperands[2] = adjust_address (operands[2], HImode, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3632 + xoperands[6] = adjust_address (operands[2], HImode, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3633 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3634 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3635 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3636 + /* Output the assembly code. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3637 + if (rtx_code == PLUS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3638 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3639 + output_asm_insn ("ld%7\t%2", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3640 + output_asm_insn ("add%7\t%1", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3641 + output_asm_insn ("st%7\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3642 + output_asm_insn ("ld%7\t%6", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3643 + output_asm_insn ("adcb\t%5", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3644 + output_asm_insn ("adca\t%4", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3645 + output_asm_insn ("st%7\t%3", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3646 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3647 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3648 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3649 + output_asm_insn ("ld%7\t%2", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3650 + output_asm_insn ("sub%7\t%1", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3651 + output_asm_insn ("st%7\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3652 + output_asm_insn ("ld%7\t%6", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3653 + output_asm_insn ("sbcb\t%5", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3654 + output_asm_insn ("sbca\t%4", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3655 + output_asm_insn ("st%7\t%3", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3656 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3657 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3658 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3659 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3660 +#if 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3661 +/** Output the assembly code for a 32-bit shift.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3662 +Operands 0 and 1 must be the same rtx, forced by a matching
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3663 +constraint. Operand 2 must be a CONST_INT. Operand 3 is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3664 +"d" in case a temporary reg is needed. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3665 +void
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3666 +m6809_output_shiftsi3 (int rtx_code, rtx *operands)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3667 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3668 + unsigned int count = INTVAL (operands[2]) % 32;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3669 + unsigned int size = 4; /* sizeof (SImode) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3670 + int s;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3671 + rtx xoperands[4];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3672 + int op;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3673 + int start, end, step;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3674 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3675 + /* Initialize */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3676 + if (rtx_code == ASHIFT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3677 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3678 + start = size-1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3679 + end = -1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3680 + step = -1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3681 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3682 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3683 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3684 + start = 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3685 + end = size;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3686 + step = 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3687 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3688 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3689 + xoperands[2] = operands[2];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3690 + xoperands[3] = operands[3];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3691 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3692 + if (count <= 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3693 + abort ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3694 + if (rtx_code == ROTATE || rtx_code == ROTATERT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3695 + abort ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3696 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3697 + /* Extract bit shifts over 16 bits by HImode moves. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3698 + if (count >= 16)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3699 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3700 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3701 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3702 + /* Extract bit shifts over 8 bits by QImode moves. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3703 + if (count >= 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3704 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3705 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3706 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3707 + /* Iterate over the number of bits to be shifted. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3708 + while (count > 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3709 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3710 + /* Each bit to be shifted requires 1 proper bit shift
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3711 + and 3 rotates. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3712 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3713 + /* First, do the arithmetic/logical shift. Left shifts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3714 + start from the LSB; right shifts start from the MSB. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3715 + xoperands[0] = adjust_address (operands[0], QImode, start);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3716 + switch (rtx_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3717 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3718 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3719 + output_asm_insn ("asl\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3720 + start--;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3721 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3722 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3723 + output_asm_insn ("asr\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3724 + start++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3725 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3726 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3727 + output_asm_insn ("lsr\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3728 + start++;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3729 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3730 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3731 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3732 + /* Next, rotate the other bytes */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3733 + for (s = start; s != end; s += step)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3734 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3735 + xoperands[0] = adjust_address (operands[0], QImode, s);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3736 + switch (rtx_code)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3737 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3738 + case ASHIFT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3739 + output_asm_insn ("rol\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3740 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3741 + case ASHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3742 + case LSHIFTRT:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3743 + output_asm_insn ("ror\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3744 + break;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3745 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3746 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3747 + count--;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3748 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3749 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3750 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3751 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3752 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3753 +power_of_two_p (unsigned int n)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3754 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3755 + return (n & (n-1)) == 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3756 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3757 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3758 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3759 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3760 +m6809_can_eliminate (int from, int to)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3761 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3762 + if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3763 + return !frame_pointer_needed;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3764 + return 1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3765 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3766 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3767 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3768 +int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3769 +m6809_initial_elimination_offset (int from, int to)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3770 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3771 + switch (from)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3772 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3773 + case ARG_POINTER_REGNUM:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3774 + return get_frame_size () + m6809_get_regs_size (m6809_get_live_regs ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3775 + case FRAME_POINTER_REGNUM:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3776 + return get_frame_size ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3777 + default:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3778 + gcc_unreachable ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3779 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3780 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3781 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3782 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3783 +bool
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3784 +m6809_frame_pointer_required (void)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3785 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3786 + return false;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3787 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3788 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3789 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3790 +/* Defines the target-specific hooks structure. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3791 +struct gcc_target targetm = TARGET_INITIALIZER;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3792 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.h gcc-4.6.4/gcc/config/m6809/m6809.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3793 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.h 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3794 +++ gcc-4.6.4/gcc/config/m6809/m6809.h 2015-07-20 21:56:53.518727644 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3795 @@ -0,0 +1,1352 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3796 +/* Definitions of target machine for GNU compiler. MC6809 version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3797 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3798 + MC6809 Version by Tom Jones (jones@sal.wisc.edu)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3799 + Space Astronomy Laboratory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3800 + University of Wisconsin at Madison
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3801 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3802 + minor changes to adapt it to gcc-2.5.8 by Matthias Doerfel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3803 + ( msdoerfe@informatik.uni-erlangen.de )
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3804 + also added #pragma interrupt (inspired by gcc-6811)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3805 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3806 + minor changes to adapt it to gcc-2.8.0 by Eric Botcazou
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3807 + (ebotcazou@multimania.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3808 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3809 + minor changes to adapt it to egcs-1.1.2 by Eric Botcazou
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3810 + (ebotcazou@multimania.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3811 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3812 + minor changes to adapt it to gcc-2.95.3 by Eric Botcazou
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3813 + (ebotcazou@multimania.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3814 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3815 + changes for gcc-3.1.1 by ???
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3816 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3817 + further changes for gcc-3.1.1 and beyond by Brian Dominy
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3818 + (brian@oddchange.com)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3819 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3820 + even more changes for gcc-4.6.1 by William Astle (lost@l-w.ca)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3821 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3822 +This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3823 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3824 +GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3825 +it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3826 +the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3827 +any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3828 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3829 +GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3830 +but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3831 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3832 +GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3833 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3834 +You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3835 +along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3836 +<http://www.gnu.org/licenses/>. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3837 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3838 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3839 +/* Helper macros for creating strings with macros */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3840 +#define C_STRING(x) C_STR(x)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3841 +#define C_STR(x) #x
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3842 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3843 +/* Certain parts of GCC include host-side includes, which is bad.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3844 + * Some things that get pulled in need to be undone.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3845 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3846 +#undef HAVE_GAS_HIDDEN
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3847 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3848 +/* Names to predefine in the preprocessor for this target machine. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3849 +/*#define TARGET_CPU_CPP_BUILTINS() m6809_cpu_cpp_builtins () */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3850 +#define TARGET_CPU_CPP_BUILTINS() do \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3851 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3852 + if (TARGET_6309) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3853 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3854 + builtin_define_std ("__M6309__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3855 + builtin_define_std ("__m6309__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3856 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3857 + else \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3858 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3859 + builtin_define_std ("__M6809__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3860 + builtin_define_std ("__m6809__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3861 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3862 + \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3863 + if (TARGET_BYTE_INT) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3864 + builtin_define_std ("__int8__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3865 + else \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3866 + builtin_define_std ("__int16__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3867 + \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3868 + switch (m6809_abi_version) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3869 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3870 + case M6809_ABI_VERSION_STACK: \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3871 + builtin_define_std ("__regargs__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3872 + builtin_define_std ("__ABI_STACK__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3873 + break; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3874 + case M6809_ABI_VERSION_REGS: \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3875 + builtin_define_std ("__ABI_REGS__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3876 + break; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3877 + case M6809_ABI_VERSION_BX: \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3878 + builtin_define_std ("__ABI_BX__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3879 + break; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3880 + default: \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3881 + break; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3882 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3883 + \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3884 + if (TARGET_WPC) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3885 + builtin_define_std ("__WPC__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3886 + \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3887 + if (TARGET_DRET) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3888 + builtin_define_std ("__DRET__"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3889 + } while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3890 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3891 +/* As an embedded target, we have no libc. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3892 +#ifndef inhibit_libc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3893 +#define inhibit_libc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3894 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3895 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3896 +/* Print subsidiary information on the compiler version in use. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3897 +#define TARGET_VERSION fprintf (stderr, " (MC6809)");
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3898 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3899 +/* Run-time compilation parameters selecting different hardware subsets. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3900 +/*extern int target_flags; */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3901 +extern short *reg_renumber; /* def in local_alloc.c */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3902 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3903 +/* Runtime current values of section names */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3904 +extern int section_changed;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3905 +extern char code_section_op[], data_section_op[], bss_section_op[];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3906 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3907 +#define WARNING_OPT 0,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3908 +/*extern const char *m6809_abi_version_ptr; */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3909 +extern unsigned int m6809_soft_regs;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3910 +extern unsigned int m6809_abi_version;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3911 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3912 +/* ABI versions */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3913 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3914 +#define M6809_ABI_VERSION_STACK 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3915 +#define M6809_ABI_VERSION_REGS 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3916 +#define M6809_ABI_VERSION_BX 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3917 +#define M6809_ABI_VERSION_LATEST (M6809_ABI_VERSION_BX)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3918 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3919 +/* Allow $ in identifiers */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3920 +#define DOLLARS_IN_IDENTIFIERS 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3921 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3922 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3923 + Target machine storage layout
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3924 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3925 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3926 +/* Define this if most significant bit is lowest numbered
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3927 + in instructions that operate on numbered bit-fields. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3928 +#define BITS_BIG_ENDIAN 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3929 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3930 +/* Define to 1 if most significant byte of a word is the lowest numbered. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3931 +#define BYTES_BIG_ENDIAN 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3932 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3933 +/* Define to 1 if most significant word of a multiword value is the lowest numbered. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3934 +#define WORDS_BIG_ENDIAN 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3935 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3936 +/* Number of bits in an addressible storage unit */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3937 +#define BITS_PER_UNIT 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3938 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3939 +/* Width in bits of a "word", or the contents of a machine register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3940 + * Although the 6809 has a few byte registers, define this to 16-bits
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3941 + * since this is the natural size of most registers. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3942 +#define BITS_PER_WORD 16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3943 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3944 +/* Width of a word, in units (bytes). */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3945 +#define UNITS_PER_WORD (BITS_PER_WORD/8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3946 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3947 +/* Width in bits of a pointer. See also the macro `Pmode' defined below. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3948 +#define POINTER_SIZE 16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3949 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3950 +/* Allocation boundary (bits) for storing pointers in memory. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3951 +#define POINTER_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3952 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3953 +/* Allocation boundary (bits) for storing arguments in argument list. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3954 +/* PARM_BOUNDARY is divided by BITS_PER_WORD in expr.c -- tej */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3955 +#define PARM_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3956 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3957 +/* Boundary (bits) on which stack pointer should be aligned. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3958 +#define STACK_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3959 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3960 +/* Allocation boundary (bits) for the code of a function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3961 +#define FUNCTION_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3962 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3963 +/* Alignment of field after `int : 0' in a structure. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3964 +#define EMPTY_FIELD_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3965 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3966 +/* Every structure's size must be a multiple of this. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3967 +#define STRUCTURE_SIZE_BOUNDARY 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3968 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3969 +/* Largest mode size to use when putting an object, including
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3970 + * a structure, into a register. By limiting this to 16, no
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3971 + * 32-bit objects will ever be allocated to a pair of hard
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3972 + * registers. This is a good thing, since there aren't that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3973 + * many of them. 32-bit objects are only needed for floats
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3974 + * and "long long"s. Larger values have been tried and did not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3975 + * work. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3976 +#define MAX_FIXED_MODE_SIZE 16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3977 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3978 +/* No data type wants to be aligned rounder than this. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3979 +#define BIGGEST_ALIGNMENT 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3980 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3981 +/* Define this if move instructions will actually fail to work
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3982 + when given unaligned data. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3983 +#define STRICT_ALIGNMENT 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3984 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3985 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3986 + Standard register usage.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3987 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3988 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3989 +/* Register values as bitmasks.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3990 + * TODO : merge D_REGBIT and B_REGBIT, and treat this as the same
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3991 + * register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3992 +#define RSVD1_REGBIT (1 << HARD_RSVD1_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3993 +#define D_REGBIT (1 << HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3994 +#define X_REGBIT (1 << HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3995 +#define Y_REGBIT (1 << HARD_Y_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3996 +#define U_REGBIT (1 << HARD_U_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3997 +#define S_REGBIT (1 << HARD_S_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3998 +#define PC_REGBIT (1 << HARD_PC_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
3999 +#define Z_REGBIT (1 << HARD_Z_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4000 +#define A_REGBIT (1 << HARD_A_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4001 +#define B_REGBIT (1 << HARD_B_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4002 +#define CC_REGBIT (1 << HARD_CC_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4003 +#define DP_REGBIT (1 << HARD_DP_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4004 +#define SOFT_FP_REGBIT (1 << SOFT_FP_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4005 +#define SOFT_AP_REGBIT (1 << SOFT_AP_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4006 +#define M_REGBIT(n) (1 << (SOFT_M0_REGNUM + n))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4007 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4008 +/* Macros for dealing with set of registers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4009 + * A register set is just a bitwise-OR of all the register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4010 + * bitmask values. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4011 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4012 +/* Which registers can hold 8-bits */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4013 +#define BYTE_REGSET \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4014 + (Z_REGBIT | A_REGBIT | D_REGBIT | CC_REGBIT | DP_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4015 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4016 +/* Which registers can hold 16-bits.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4017 + * Note: D_REGBIT is defined as both an 8-bit and 16-bit register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4018 +#define WORD_REGSET \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4019 + (D_REGBIT | X_REGBIT | Y_REGBIT | U_REGBIT | S_REGBIT | PC_REGBIT | SOFT_FP_REGBIT | SOFT_AP_REGBIT | RSVD1_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4020 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4021 +/* Returns nonzero if a given REGNO is in the REGSET. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4022 +#define REGSET_CONTAINS_P(regno, regset) (((1 << (regno)) & (regset)) != 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4023 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4024 +/* Defines related to the number of soft registers supported.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4025 + * The actual number used may be less depending on -msoft-reg-count.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4026 + * If you change one of these, you should change them all. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4027 +#define NUM_M_REGS 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4028 +#define M_REGS_FIXED 1, 1, 1, 1, 1, 1, 1, 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4029 +#define M_REGS_CALL_USED 1, 1, 1, 1, 1, 1, 1, 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4030 +#define HARD_M_REGNUMS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4031 + SOFT_M0_REGNUM+0, SOFT_M0_REGNUM+1, SOFT_M0_REGNUM+2, SOFT_M0_REGNUM+3, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4032 + SOFT_M0_REGNUM+4, SOFT_M0_REGNUM+5, SOFT_M0_REGNUM+6, SOFT_M0_REGNUM+7
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4033 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4034 +#define SOFT_M_REGBITS (((1UL << NUM_M_REGS) - 1) << (SOFT_M0_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4035 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4036 +/* Number of actual hardware registers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4037 + The hardware registers are assigned numbers for the compiler
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4038 + from 0 to just below FIRST_PSEUDO_REGISTER.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4039 + All registers that the compiler knows about must be given numbers,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4040 + even those that are not normally considered general registers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4041 + Make sure the constant below matches the value of SOFT_M0_REGNUM;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4042 + for some reason, GCC won't compile if that name is used here directly. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4043 +#ifdef SOFT_M0_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4044 +#if (SOFT_M0_REGNUM != 14)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4045 +#error "bad register numbering"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4046 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4047 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4048 +#define FIRST_PSEUDO_REGISTER (14 + NUM_M_REGS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4049 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4050 +/* 1 for registers that have pervasive standard uses
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4051 + and are not available for the register allocator.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4052 + The psuedoregisters (M_REGS) are declared fixed here, but
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4053 + will be unfixed if -msoft-reg-count is seen later. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4054 +#define FIXED_REGISTERS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4055 + {1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, M_REGS_FIXED, }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4056 + /* -, X, Y, U, S, PC,D, Z, A, B, C, DP,FP,AP,M... */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4057 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4058 +/* 1 for registers not available across function calls.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4059 + These must include the FIXED_REGISTERS and also any
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4060 + registers that can be used without being saved.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4061 + The latter must include the registers where values are returned
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4062 + and the register where structure-value addresses are passed.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4063 + Aside from that, you can include as many other registers as you like. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4064 +#define CALL_USED_REGISTERS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4065 + {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, M_REGS_CALL_USED, }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4066 + /* -, X, Y, U, S, PC,D, Z, A, B, C, DP,FP,AP,M... */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4067 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4068 +/* Return number of consecutive hard regs needed starting at reg REGNO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4069 + to hold something of mode MODE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4070 + For the 6809, we distinguish between word-length and byte-length
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4071 + registers. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4072 +#define HARD_REGNO_NREGS(REGNO, MODE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4073 + (REGSET_CONTAINS_P (REGNO, WORD_REGSET) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4074 + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4075 + (GET_MODE_SIZE (MODE)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4076 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4077 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4078 +/* Value is 1 if hard register REGNO can hold a value
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4079 +of machine-mode MODE. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4080 +#define HARD_REGNO_MODE_OK(REGNO, MODE) m6809_hard_regno_mode_ok (REGNO, MODE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4081 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4082 +/* Value is 1 if it is a good idea to tie two pseudo registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4083 + when one has mode MODE1 and one has mode MODE2.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4084 + If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4085 + for any hard reg, then this must be 0 for correct output. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4086 +#define MODES_TIEABLE_P(MODE1, MODE2) 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4087 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4088 +/* Specify the registers used for certain standard purposes.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4089 + The values of these macros are register numbers. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4090 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4091 +/* program counter if referenced as a register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4092 +#define PC_REGNUM HARD_PC_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4093 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4094 +/* Register to use for pushing function arguments. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4095 +#define STACK_POINTER_REGNUM HARD_S_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4096 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4097 +/* Base register for access to local variables of the function.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4098 + * Before reload, FRAME_POINTER_REGNUM will be used. Later,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4099 + * the elimination pass will convert these to STACK_POINTER_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4100 + * if possible, or else HARD_FRAME_POINTER_REGNUM. The idea is to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4101 + * avoid tying up a hard register (U) for the frame pointer if
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4102 + * it can be eliminated entirely, making it available for use as
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4103 + * a general register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4104 +#define FRAME_POINTER_REGNUM SOFT_FP_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4105 +#define HARD_FRAME_POINTER_REGNUM HARD_U_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4106 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4107 +/* Define a table of possible eliminations.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4108 + * The idea is to try to avoid using hard registers for the argument
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4109 + * and frame pointers if they can be derived from the stack pointer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4110 + * instead, which already has a hard register reserved for it.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4111 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4112 + * The order of entries in this table will try to convert
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4113 + * ARG_POINTER_REGNUM and FRAME_POINTER_REGNUM into stack pointer
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4114 + * references first, but if that fails, they will be converted to use
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4115 + * HARD_FRAME_POINTER_REGNUM.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4116 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4117 +#define ELIMINABLE_REGS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4118 +{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4119 + { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4120 + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4121 + { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4122 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4123 +/* #define CAN_ELIMINATE(FROM, TO) m6809_can_eliminate (FROM, TO) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4124 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4125 +/* Define how to offset the frame or argument pointer to turn it
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4126 + * into a stack pointer reference. This is based on the way that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4127 + * the frame is constructed in the function prologue. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4128 +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4129 + (OFFSET) = m6809_initial_elimination_offset (FROM, TO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4130 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4131 +/* Base register for access to arguments of the function.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4132 + * This is only used prior to reload; no instructions will ever
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4133 + * be output referring to this register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4134 +#define ARG_POINTER_REGNUM SOFT_AP_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4135 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4136 +/* Register in which static-chain is passed to a function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4137 +#define STATIC_CHAIN_REGNUM HARD_Y_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4138 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4139 +/* #define CONDITIONAL_REGISTER_USAGE (m6809_conditional_register_usage ()) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4140 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4141 +/* Order in which hard registers are allocated to pseudos.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4142 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4143 + * Since the D register is the only valid reg for 8-bit values
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4144 + * now, avoid using it for 16-bit values by putting it after all
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4145 + * other 16-bits.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4146 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4147 + * Prefer X first since the first 16-bit function argument goes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4148 + * there. We may be able to pass in to a subroutine without
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4149 + * a copy.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4150 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4151 + * Prefer U over Y since instructions using Y take one extra
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4152 + * byte, and thus one extra cycle to execute.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4153 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4154 +#define REG_ALLOC_ORDER \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4155 + { HARD_X_REGNUM, HARD_U_REGNUM, HARD_Y_REGNUM, HARD_D_REGNUM, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4156 + HARD_M_REGNUMS, HARD_S_REGNUM, HARD_PC_REGNUM, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4157 + HARD_B_REGNUM, HARD_A_REGNUM, HARD_CC_REGNUM, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4158 + HARD_DP_REGNUM, SOFT_FP_REGNUM, SOFT_AP_REGNUM, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4159 + 6, HARD_Z_REGNUM }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4160 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4161 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4162 + classes of registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4163 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4164 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4165 +/* Define the classes of registers for register constraints in the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4166 + machine description. Also define ranges of constants.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4167 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4168 + One of the classes must always be named ALL_REGS and include all hard regs.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4169 + If there is more than one class, another class must be named NO_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4170 + and contain no registers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4171 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4172 + The name GENERAL_REGS must be the name of a class (or an alias for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4173 + another name such as ALL_REGS). This is the class of registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4174 + that is allowed by "g" or "r" in a register constraint.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4175 + Also, registers outside this class are allocated only when
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4176 + instructions express preferences for them.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4177 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4178 + The classes must be numbered in nondecreasing order; that is,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4179 + a larger-numbered class must never be contained completely
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4180 + in a smaller-numbered class.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4181 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4182 + For any two classes, it is very desirable that there be another
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4183 + class that represents their union. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4184 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4185 +enum reg_class {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4186 + NO_REGS, /* The trivial class with no registers in it */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4187 + D_REGS, /* 16-bit (word (HI)) data (D) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4188 + ACC_A_REGS, /* The A register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4189 + ACC_B_REGS, /* The B register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4190 + X_REGS, /* The X register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4191 + Z_REGS, /* The Z (zero-bit) register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4192 + Q_REGS, /* 8-bit (byte (QI)) data (A,B) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4193 + M_REGS, /* 8-bit (byte (QI)) soft registers */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4194 + CC_REGS, /* 8-bit condition code register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4195 + I_REGS, /* An index register (A,B,D) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4196 + T_REGS, /* 16-bit addresses, not including stack or PC (X,Y,U) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4197 + A_REGS, /* 16-bit addresses (X,Y,U,S,PC) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4198 + S_REGS, /* 16-bit soft registers (FP, AP) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4199 + P_REGS, /* 16-bit pushable registers (D,X,Y,U); omit PC and S */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4200 + G_REGS, /* 16-bit data and address (D,X,Y,U,S,PC) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4201 + ALL_REGS, /* All registers */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4202 + LIM_REG_CLASSES
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4203 +};
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4204 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4205 +#define N_REG_CLASSES (int) LIM_REG_CLASSES
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4206 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4207 +/* Since GENERAL_REGS is a smaller class than ALL_REGS,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4208 + it is not an alias to ALL_REGS, but to G_REGS. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4209 +#define GENERAL_REGS G_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4210 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4211 +/* Give names of register classes as strings for dump file. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4212 +#define REG_CLASS_NAMES \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4213 + { "NO_REGS", "D_REGS", "ACC_A_REGS", "ACC_B_REGS", "X_REGS", "Z_REGS", "Q_REGS", "M_REGS", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4214 + "CC_REGS", "I_REGS", "T_REGS", "A_REGS", "S_REGS", "P_REGS", "G_REGS", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4215 + "ALL_REGS" }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4216 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4217 +/* Define which registers fit in which classes.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4218 + This is an initializer for a vector of HARD_REG_SET
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4219 + of length N_REG_CLASSES. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4220 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4221 +#define D_REGSET (D_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4222 +#define ACC_A_REGSET (A_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4223 +#define ACC_B_REGSET (D_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4224 +#define X_REGSET (X_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4225 +#define Z_REGSET (Z_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4226 +#define Q_REGSET (D_REGBIT | A_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4227 +#define M_REGSET (SOFT_M_REGBITS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4228 +#define CC_REGSET (CC_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4229 +#define I_REGSET (A_REGBIT | B_REGBIT | D_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4230 +#define T_REGSET (X_REGBIT | Y_REGBIT | U_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4231 +#define A_REGSET (X_REGBIT | Y_REGBIT | U_REGBIT | S_REGBIT | PC_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4232 +#define S_REGSET (SOFT_FP_REGBIT | SOFT_AP_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4233 +#define P_REGSET (D_REGBIT | X_REGBIT | Y_REGBIT | U_REGBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4234 +#define G_REGSET \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4235 + (D_REGSET | Q_REGSET | I_REGSET | A_REGSET | M_REGSET | S_REGSET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4236 +#define ALL_REGSET (G_REGSET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4237 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4238 +#define REG_CLASS_CONTENTS { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4239 + {0}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4240 + {D_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4241 + {ACC_A_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4242 + {ACC_B_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4243 + {X_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4244 + {Z_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4245 + {Q_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4246 + {M_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4247 + {CC_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4248 + {I_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4249 + {T_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4250 + {A_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4251 + {S_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4252 + {P_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4253 + {G_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4254 + {ALL_REGSET}, \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4255 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4256 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4257 +/* The same information, inverted.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4258 + * This is defined to use the REG_CLASS_CONTENTS defines above, so that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4259 + * these two sets of definitions are always consistent. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4260 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4261 +#define REGNO_REG_CLASS(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4262 + (D_REGNO_P (REGNO) ? D_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4263 + (Z_REGNO_P (REGNO) ? Z_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4264 + (ACC_A_REGNO_P (REGNO) ? ACC_A_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4265 + (ACC_B_REGNO_P (REGNO) ? ACC_B_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4266 + (X_REGNO_P (REGNO) ? X_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4267 + (Q_REGNO_P (REGNO) ? Q_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4268 + (M_REGNO_P (REGNO) ? M_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4269 + (CC_REGNO_P (REGNO) ? CC_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4270 + (I_REGNO_P (REGNO) ? I_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4271 + (T_REGNO_P (REGNO) ? T_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4272 + (A_REGNO_P (REGNO) ? A_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4273 + (S_REGNO_P (REGNO) ? S_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4274 + (P_REGNO_P (REGNO) ? P_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4275 + (G_REGNO_P (REGNO) ? G_REGS : ALL_REGS))))))))))))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4276 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4277 +#define D_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, D_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4278 +#define ACC_A_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, ACC_A_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4279 +#define ACC_B_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, ACC_B_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4280 +#define X_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, X_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4281 +#define Z_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, Z_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4282 +#define Q_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, Q_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4283 +#define M_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, M_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4284 +#define CC_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, CC_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4285 +#define I_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, I_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4286 +#define T_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, T_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4287 +#define A_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, A_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4288 +#define S_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, S_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4289 +#define P_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, P_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4290 +#define G_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, G_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4291 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4292 +/* Macros that test an rtx 'X' to see if it's in a particular
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4293 + * register class. 'X' need not be a REG necessarily. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4294 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4295 +#define D_REG_P(X) (REG_P (X) && D_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4296 +#define ACC_A_REG_P(X) (REG_P (X) && ACC_A_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4297 +#define ACC_B_REG_P(X) (REG_P (X) && ACC_B_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4298 +#define X_REG_P(X) (REG_P (X) && X_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4299 +#define Z_REG_P(X) (REG_P (X) && Z_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4300 +#define I_REG_P(X) (REG_P (X) && I_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4301 +#define T_REG_P(X) (REG_P (X) && T_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4302 +#define A_REG_P(X) (REG_P (X) && A_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4303 +#define S_REG_P(X) (REG_P (X) && S_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4304 +#define P_REG_P(X) (REG_P (X) && P_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4305 +#define Q_REG_P(X) (REG_P (X) && Q_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4306 +#define M_REG_P(X) (REG_P (X) && M_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4307 +#define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4308 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4309 +/* Redefine this in terms of BYTE_REGSET */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4310 +#define BYTE_REGNO_P(REGNO) (REGSET_CONTAINS_P (REGNO, BYTE_REGSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4311 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4312 +/* The class value for index registers, and the one for base regs. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4313 +#define INDEX_REG_CLASS I_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4314 +#define BASE_REG_CLASS A_REGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4315 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4316 +/* Get reg_class from a letter in the machine description. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4317 +#define REG_CLASS_FROM_LETTER(C) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4318 + (((C) == 'a' ? A_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4319 + ((C) == 'd' ? D_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4320 + ((C) == 'x' ? I_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4321 + ((C) == 't' ? M_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4322 + ((C) == 'c' ? CC_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4323 + ((C) == 'A' ? ACC_A_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4324 + ((C) == 'B' ? ACC_B_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4325 + ((C) == 'v' ? X_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4326 + ((C) == 'u' ? S_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4327 + ((C) == 'U' ? P_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4328 + ((C) == 'T' ? T_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4329 + ((C) == 'z' ? Z_REGS : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4330 + ((C) == 'q' ? Q_REGS : NO_REGS))))))))))))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4331 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4332 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4333 + The letters I through O in a register constraint string
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4334 + can be used to stand for particular ranges of immediate operands.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4335 + This macro defines what the ranges are.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4336 + C is the letter, and VALUE is a constant value.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4337 + Return 1 if VALUE is in the range specified by C.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4338 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4339 + For the 6809, J, K, L are used for indexed addressing.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4340 + `I' is used for the constant 1.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4341 + `J' is used for the 5-bit offsets.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4342 + `K' is used for the 8-bit offsets.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4343 + `L' is used for the range of signed numbers that fit in 16 bits.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4344 + `M' is used for the exact value '8'.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4345 + `N' is used for the constant -1.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4346 + `O' is used for the constant 0.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4347 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4348 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4349 +#define CONST_OK_FOR_LETTER_P(VALUE, C) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4350 + ((C) == 'I' ? ((VALUE) == 1) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4351 + (C) == 'J' ? ((VALUE) >= -16 && (VALUE) <= 15) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4352 + (C) == 'K' ? ((VALUE) >= -128 && (VALUE) <= 127) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4353 + (C) == 'L' ? ((VALUE) >= -32768 && (VALUE) <= 32767) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4354 + (C) == 'M' ? ((VALUE) == 8) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4355 + (C) == 'N' ? ((VALUE) == -1) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4356 + (C) == 'O' ? ((VALUE) == 0) : 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4357 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4358 +/* Similar, but for floating constants, and defining letters G and H.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4359 + No floating-point constants are valid on MC6809. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4360 +#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4361 + ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4362 + && VALUE == CONST0_RTX (GET_MODE (VALUE))) : 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4363 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4364 +/* Given an rtx X being reloaded into a reg required to be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4365 + in class CLASS, return the class of reg to actually use.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4366 + In general this is just CLASS; but on some machines
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4367 + in some cases it is preferable to use a more restrictive class. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4368 +#define PREFERRED_RELOAD_CLASS(X,CLASS) m6809_preferred_reload_class(X,CLASS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4369 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4370 +#define SMALL_REGISTER_CLASSES 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4371 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4372 +/* Return the maximum number of consecutive registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4373 + needed to represent mode MODE in a register of class CLASS. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4374 +#define CLASS_MAX_NREGS(CLASS, MODE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4375 + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4376 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4377 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4378 + Stack layout; function entry, exit and calling.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4379 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4380 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4381 +/* Define this if pushing a word on the stack
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4382 + makes the stack pointer a smaller address. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4383 +#define STACK_GROWS_DOWNWARD
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4384 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4385 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4386 +/* Define this if the nominal address of the stack frame
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4387 + is at the high-address end of the local variables;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4388 + that is, each additional local variable allocated
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4389 + goes at a more negative offset in the frame. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4390 +#define FRAME_GROWS_DOWNWARD 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4391 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4392 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4393 +/* Offset within stack frame to start allocating local variables at.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4394 + If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4395 + first local allocated. Otherwise, it is the offset to the BEGINNING
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4396 + of the first local allocated. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4397 +#define STARTING_FRAME_OFFSET 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4398 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4399 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4400 +/* Always push stack arguments for now. Accumulation is not yet working. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4401 +#define PUSH_ROUNDING(BYTES) (BYTES)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4402 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4403 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4404 +/* Offset of first parameter from the argument pointer register value.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4405 + * ARG_POINTER_REGNUM is defined to point to the return address pushed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4406 + * onto the stack, so we must offset by 2 bytes to get to the arguments. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4407 +#define FIRST_PARM_OFFSET(FNDECL) 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4408 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4409 +/* Value is 1 if returning from a function call automatically
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4410 + pops the arguments described by the number-of-args field in the call.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4411 + FUNTYPE is the data type of the function (as a tree),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4412 + or for a library call it is an identifier node for the subroutine name. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4413 +/* #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4414 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4415 +/* Define how to find the value returned by a function.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4416 + VALTYPE is the data type of the value (as a tree).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4417 + If the precise function being called is known, FUNC is its FUNCTION_DECL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4418 + otherwise, FUNC is 0. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4419 +#define FUNCTION_VALUE(VALTYPE, FUNC) m6809_function_value (VALTYPE, FUNC)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4420 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4421 +/* Define how to find the value returned by a library function
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4422 + assuming the value has mode MODE. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4423 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4424 +/* All return values are in the X-register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4425 +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4426 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4427 +/* Define this if using the nonreentrant convention for returning
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4428 + structure and union values. No; it is inefficient and buggy. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4429 +#undef PCC_STATIC_STRUCT_RETURN
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4430 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4431 +/* 1 if N is a possible register number for a function value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4432 +#define FUNCTION_VALUE_REGNO_P(N) m6809_function_value_regno_p (N)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4433 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4434 +/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4435 + more than one register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4436 +#define NEEDS_UNTYPED_CALL 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4437 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4438 +/* 1 if N is a possible register number for function argument passing. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4439 +#define FUNCTION_ARG_REGNO_P(N) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4440 + ((m6809_abi_version != M6809_ABI_VERSION_STACK) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4441 + (((N) == HARD_D_REGNUM) || ((N) == HARD_X_REGNUM)) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4442 + 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4443 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4444 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4445 + Argument Lists
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4446 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4447 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4448 +/* Cumulative arguments are tracked in a single integer,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4449 + * which is the number of bytes of arguments scanned so far,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4450 + * plus which registers have already been used. The register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4451 + * info is kept in some of the upper bits */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4452 +#define CUMULATIVE_ARGS unsigned int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4453 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4454 +#define CUM_STACK_ONLY 0x80000000
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4455 +#define CUM_X_MASK 0x40000000
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4456 +#define CUM_B_MASK 0x20000000
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4457 +#define CUM_STACK_INVALID 0x10000000
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4458 +#define CUM_STACK_MASK 0xFFFFFFF
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4459 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4460 +#define CUM_ADVANCE_8BIT(cum) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4461 + (((cum) & CUM_B_MASK) ? (cum)++ : ((cum) |= CUM_B_MASK))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4462 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4463 +#define CUM_ADVANCE_16BIT(cum) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4464 + (((cum) & CUM_X_MASK) ? (cum) += 2 : ((cum) |= CUM_X_MASK))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4465 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4466 +/* Initialize a variable CUM of type CUMULATIVE_ARGS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4467 + for a call to a function whose data type is FNTYPE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4468 + For a library call, FNTYPE is 0.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4469 + N_NAMED was added in gcc 3.4 and is not used currently. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4470 +#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4471 + ((CUM) = m6809_init_cumulative_args (CUM, FNTYPE, LIBNAME))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4472 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4473 +#define FUNCTION_ARG_SIZE(MODE, TYPE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4474 + ((MODE) != BLKmode ? GET_MODE_SIZE (MODE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4475 + : (unsigned) int_size_in_bytes (TYPE))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4476 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4477 +/* Update the data in CUM to advance over an argument
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4478 + of mode MODE and data type TYPE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4479 + (TYPE is null for libcalls where that information may not be available.) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4480 +#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4481 + (((MODE == QImode) && !((CUM) & CUM_STACK_ONLY)) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4482 + CUM_ADVANCE_8BIT (CUM) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4483 + ((MODE == HImode) && !((CUM) & CUM_STACK_ONLY)) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4484 + CUM_ADVANCE_16BIT (CUM) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4485 + ((CUM) = ((CUM) + (TYPE ? int_size_in_bytes (TYPE) : 2))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4486 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4487 +/* Define where to put the arguments to a function.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4488 + Value is zero to push the argument on the stack,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4489 + or a hard register rtx in which to store the argument.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4490 + This macro is used _before_ FUNCTION_ARG_ADVANCE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4491 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4492 + For the 6809, the first 8-bit function argument can be placed into B,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4493 + and the first 16-bit arg can go into X. All other arguments
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4494 + will be pushed onto the stack.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4495 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4496 + Command-line options can adjust this behavior somewhat.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4497 + */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4498 +#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4499 + ((MODE == VOIDmode) ? NULL_RTX : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4500 + ((MODE == BLKmode) || (GET_MODE_SIZE (MODE) > 2)) ? NULL_RTX : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4501 + ((MODE == QImode) && !((CUM) & (CUM_STACK_ONLY | CUM_B_MASK))) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4502 + gen_rtx_REG (QImode, HARD_D_REGNUM) : \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4503 + ((MODE == HImode) && !((CUM) & (CUM_STACK_ONLY | CUM_X_MASK))) ? \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4504 + gen_rtx_REG (HImode, HARD_X_REGNUM) : m6809_function_arg_on_stack (&CUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4505 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4506 +/* Output assembler code to FILE to increment profiler label # LABELNO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4507 + for profiling a function entry. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4508 +#define FUNCTION_PROFILER(FILE, LABELNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4509 + fprintf (FILE, "\tldd\t#LP%u\n\tjsr\tmcount\n", (LABELNO));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4510 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4511 +/* Stack pointer must be correct on function exit */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4512 +#define EXIT_IGNORE_STACK 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4513 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4514 +/*****************************************************************************
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4515 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4516 +** Trampolines for Nested Functions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4517 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4518 +*****************************************************************************/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4519 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4520 +/* Length in units of the trampoline for entering a nested function. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4521 +#define TRAMPOLINE_SIZE 7
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4522 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4523 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4524 + Addressing modes,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4525 + and classification of registers for them.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4526 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4527 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4528 +/* 6809 has postincrement and predecrement addressing modes */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4529 +#define HAVE_POST_INCREMENT 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4530 +#define HAVE_PRE_DECREMENT 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4531 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4532 +/* Whether or not to use index registers is configurable.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4533 + * Experiments show that things work better when this is off, so
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4534 + * that's the way it is for now. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4535 +#undef USE_INDEX_REGISTERS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4536 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4537 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4538 +/* Macros to check register numbers against specific register classes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4539 +#define REG_VALID_FOR_BASE_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4540 + (((REGNO) < FIRST_PSEUDO_REGISTER) && A_REGNO_P (REGNO))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4541 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4542 +/* MC6809 index registers do not allow scaling, */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4543 +/* but there is "accumulator-offset" mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4544 +#ifdef USE_INDEX_REGISTERS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4545 +#define REG_VALID_FOR_INDEX_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4546 + (((REGNO) < FIRST_PSEUDO_REGISTER) && I_REGNO_P (REGNO))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4547 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4548 +#define REG_VALID_FOR_INDEX_P(REGNO) 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4549 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4550 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4551 +/* Internal macro, the nonstrict definition for REGNO_OK_FOR_BASE_P */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4552 +#define REGNO_OK_FOR_BASE_NONSTRICT_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4553 + ((REGNO) >= FIRST_PSEUDO_REGISTER \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4554 + || REG_VALID_FOR_BASE_P (REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4555 + || (REGNO) == FRAME_POINTER_REGNUM \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4556 + || (REGNO) == HARD_FRAME_POINTER_REGNUM \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4557 + || (REGNO) == ARG_POINTER_REGNUM \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4558 + || (reg_renumber && REG_VALID_FOR_BASE_P (reg_renumber[REGNO])))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4559 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4560 +/* Internal macro, the nonstrict definition for REGNO_OK_FOR_INDEX_P */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4561 +#define REGNO_OK_FOR_INDEX_NONSTRICT_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4562 + ((REGNO) >= FIRST_PSEUDO_REGISTER \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4563 + || REG_VALID_FOR_INDEX_P (REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4564 + || (reg_renumber && REG_VALID_FOR_INDEX_P (reg_renumber[REGNO])))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4565 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4566 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4567 +/* Internal macro, the strict definition for REGNO_OK_FOR_BASE_P */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4568 +#define REGNO_OK_FOR_BASE_STRICT_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4569 + ((REGNO) < FIRST_PSEUDO_REGISTER ? REG_VALID_FOR_BASE_P (REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4570 + : (reg_renumber && REG_VALID_FOR_BASE_P (reg_renumber[REGNO])))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4571 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4572 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4573 +/* Internal macro, the strict definition for REGNO_OK_FOR_INDEX_P */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4574 +#define REGNO_OK_FOR_INDEX_STRICT_P(REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4575 + ((REGNO) < FIRST_PSEUDO_REGISTER ? REG_VALID_FOR_INDEX_P (REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4576 + : (reg_renumber && REG_VALID_FOR_INDEX_P (reg_renumber[REGNO])))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4577 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4578 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4579 +#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_BASE_STRICT_P (REGNO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4580 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4581 +#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_INDEX_STRICT_P (REGNO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4582 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4583 +#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_STRICT_P (REGNO (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4584 +#define REG_OK_FOR_BASE_NONSTRICT_P(X) REGNO_OK_FOR_BASE_NONSTRICT_P (REGNO (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4585 +#define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_STRICT_P (REGNO (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4586 +#define REG_OK_FOR_INDEX_NONSTRICT_P(X) REGNO_OK_FOR_INDEX_NONSTRICT_P (REGNO (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4587 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4588 +#ifndef REG_OK_STRICT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4589 +#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4590 +#ifdef USE_INDEX_REGISTERS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4591 +#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4592 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4593 +#define REG_OK_FOR_INDEX_P(X) 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4594 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4595 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4596 +#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4597 +#ifdef USE_INDEX_REGISTERS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4598 +#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4599 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4600 +#define REG_OK_FOR_INDEX_P(X) 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4601 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4602 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4603 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4604 +/* Maximum number of registers that can appear in a valid memory address */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4605 +#ifdef USE_INDEX_REGISTERS
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4606 +#define MAX_REGS_PER_ADDRESS 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4607 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4608 +#define MAX_REGS_PER_ADDRESS 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4609 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4610 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4611 +/* 1 if X is an rtx for a constant that is a valid address.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4612 + * We allow any constant, plus the sum of any two constants (this allows
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4613 + * offsetting a symbol ref) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4614 +#define CONSTANT_ADDRESS_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4615 + ((CONSTANT_P (X)) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4616 + || ((GET_CODE (X) == PLUS) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4617 + && (CONSTANT_P (XEXP (X, 0))) && (CONSTANT_P (XEXP (X, 1)))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4618 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4619 +/* Nonzero if the constant value X is a legitimate general operand.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4620 + It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4621 +/* Any single-word constant is ok; the only contexts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4622 + allowing general_operand of mode DI or DF are movdi and movdf. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4623 +#define LEGITIMATE_CONSTANT_P(X) (GET_CODE (X) != CONST_DOUBLE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4624 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4625 +/* Nonzero if the X is a legitimate immediate operand in PIC mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4626 +#define LEGITIMATE_PIC_OPERAND_P(X) !symbolic_operand (X, VOIDmode)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4627 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4628 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4629 + Test for valid memory addresses
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4630 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4631 +/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4632 + that is a valid memory address for an instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4633 + The MODE argument is the machine mode for the MEM expression
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4634 + that wants to use this address. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4635 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4636 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4637 + Valid addresses are either direct or indirect (MEM) versions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4638 + of the following forms.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4639 + constant N
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4640 + register ,X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4641 + constant indexed N,X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4642 + accumulator indexed D,X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4643 + auto_increment ,X++
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4644 + auto_decrement ,--X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4645 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4646 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4647 +#define REGISTER_ADDRESS_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4648 + (REG_P (X) && REG_OK_FOR_BASE_P (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4649 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4650 +#define EXTENDED_ADDRESS_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4651 + CONSTANT_ADDRESS_P (X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4652 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4653 +#define LEGITIMATE_BASE_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4654 + ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4655 + || (GET_CODE (X) == SIGN_EXTEND \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4656 + && GET_CODE (XEXP (X, 0)) == REG \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4657 + && GET_MODE (XEXP (X, 0)) == HImode \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4658 + && REG_OK_FOR_BASE_P (XEXP (X, 0))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4659 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4660 +#define LEGITIMATE_OFFSET_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4661 + (CONSTANT_ADDRESS_P (X) || (REG_P (X) && REG_OK_FOR_INDEX_P (X)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4662 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4663 +/* 1 if X is the sum of a base register and an offset. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4664 +#define INDEXED_ADDRESS(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4665 + ((GET_CODE (X) == PLUS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4666 + && LEGITIMATE_BASE_P (XEXP (X, 0)) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4667 + && LEGITIMATE_OFFSET_P (XEXP (X, 1))) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4668 + || (GET_CODE (X) == PLUS \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4669 + && LEGITIMATE_BASE_P (XEXP (X, 1)) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4670 + && LEGITIMATE_OFFSET_P (XEXP (X, 0))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4671 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4672 +#define STACK_REG_P(X) (REG_P(X) && REGNO(X) == HARD_S_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4673 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4674 +#define STACK_PUSH_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4675 + (MEM_P (X) && GET_CODE (XEXP (X, 0)) == PRE_DEC && STACK_REG_P (XEXP (XEXP (X, 0), 0)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4676 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4677 +#define STACK_POP_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4678 + (MEM_P (X) && GET_CODE (XEXP (X, 0)) == POST_INC && STACK_REG_P (XEXP (XEXP (X, 0), 0)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4679 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4680 +#define PUSH_POP_ADDRESS_P(X) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4681 + (((GET_CODE (X) == PRE_DEC) || (GET_CODE (X) == POST_INC)) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4682 + && (LEGITIMATE_BASE_P (XEXP (X, 0))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4683 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4684 +/* Go to ADDR if X is a valid address. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4685 +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4686 +{ \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4687 + if (REGISTER_ADDRESS_P(X)) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4688 + if (PUSH_POP_ADDRESS_P (X)) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4689 + if (EXTENDED_ADDRESS_P (X)) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4690 + if (INDEXED_ADDRESS (X)) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4691 + if (MEM_P (X) && REGISTER_ADDRESS_P(XEXP (X, 0))) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4692 + if (MEM_P (X) && PUSH_POP_ADDRESS_P (XEXP (X, 0))) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4693 + if (MEM_P (X) && EXTENDED_ADDRESS_P (XEXP (X, 0))) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4694 + if (MEM_P (X) && INDEXED_ADDRESS (XEXP (X, 0))) goto ADDR; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4695 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4696 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4697 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4698 + Address Fix-up
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4699 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4700 +/* Go to LABEL if ADDR (a legitimate address expression)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4701 + has an effect that depends on the machine mode it is used for.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4702 + In the latest GCC, this case is already handled by the core code
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4703 + so no action is required here. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4704 +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4705 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4706 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4707 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4708 + Miscellaneous Parameters
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4709 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4710 +/* Specify the machine mode that this machine uses
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4711 + for the index in the tablejump instruction. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4712 +#define CASE_VECTOR_MODE Pmode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4713 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4714 +/* Define this as 1 if `char' should by default be signed; else as 0. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4715 +#define DEFAULT_SIGNED_CHAR 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4716 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4717 +/* This flag, if defined, says the same insns that convert to a signed fixnum
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4718 + also convert validly to an unsigned one. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4719 +#define FIXUNS_TRUNC_LIKE_FIX_TRUNC
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4720 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4721 +/* Max number of bytes we can move from memory to memory/register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4722 + in one reasonably fast instruction. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4723 +#define MOVE_MAX 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4724 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4725 +/* Int can be 8 or 16 bits (default is 16) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4726 +#define INT_TYPE_SIZE (TARGET_BYTE_INT ? 8 : 16)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4727 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4728 +/* Short is always 16 bits */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4729 +#define SHORT_TYPE_SIZE (TARGET_BYTE_INT ? 8 : 16)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4730 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4731 +/* Size (bits) of the type "long" on target machine */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4732 +#define LONG_TYPE_SIZE (TARGET_BYTE_INT ? 16 : 32)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4733 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4734 +/* Size (bits) of the type "long long" on target machine */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4735 +#define LONG_LONG_TYPE_SIZE 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4736 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4737 +/* Size (bits) of the type "char" on target machine */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4738 +#define CHAR_TYPE_SIZE 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4739 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4740 +/* Size (bits) of the type "float" on target machine */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4741 +#define FLOAT_TYPE_SIZE 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4742 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4743 +/* Size (bits) of the type "double" on target machine.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4744 + * Note that the C standard does not require that doubles
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4745 + * hold any more bits than float. Since the 6809 has so few
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4746 + * registers, we cannot really support more than 32-bits. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4747 +#define DOUBLE_TYPE_SIZE 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4748 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4749 +/* Size (bits) of the type "long double" on target machine */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4750 +#define LONG_DOUBLE_TYPE_SIZE 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4751 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4752 +/* Define the type used for "size_t". With a 64KB address space,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4753 + * only a 16-bit value here makes sense. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4754 +#define SIZE_TYPE (TARGET_BYTE_INT ? "long unsigned int" : "unsigned int")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4755 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4756 +/* Likewise, the difference between two pointers is also a 16-bit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4757 + * signed value. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4758 +#define PTRDIFF_TYPE (TARGET_BYTE_INT ? "long int" : "int")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4759 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4760 +/* Nonzero if access to memory by bytes is slow and undesirable. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4761 +#define SLOW_BYTE_ACCESS 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4762 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4763 +/* Define if shifts truncate the shift count
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4764 + which implies one can omit a sign-extension or zero-extension
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4765 + of a shift count. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4766 +#define SHIFT_COUNT_TRUNCATED 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4767 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4768 +/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4769 + is done just by pretending it is already truncated. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4770 +#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4771 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4772 +/* It is as good to call a constant function address as to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4773 + call an address kept in a register. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4774 +#define NO_FUNCTION_CSE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4775 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4776 +/* Specify the machine mode that pointers have.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4777 + After generation of rtl, the compiler makes no further distinction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4778 + between pointers and any other objects of this machine mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4779 +#define Pmode HImode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4780 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4781 +/* A function address in a call instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4782 + is a byte address (for indexing purposes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4783 + so give the MEM rtx a byte's mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4784 +#define FUNCTION_MODE HImode
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4785 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4786 +/* Define the cost of moving a value from a register in CLASS1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4787 + * to CLASS2, of a given MODE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4788 + *
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4789 + * On the 6809, hard register transfers are all basically equivalent.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4790 + * But soft register moves are treated more like memory moves. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4791 +#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4792 + (((CLASS1 == M_REGS) || (CLASS2 == M_REGS)) ? 4 : 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4793 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4794 +/* Define the cost of moving a value between a register and memory. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4795 +#define MEMORY_MOVE_COST(MODE, CLASS, IN) 5
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4796 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4797 +/* Check a `double' value for validity for a particular machine mode. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4798 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4799 +#define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4800 + ((OVERFLOW) = check_float_value (MODE, &D, OVERFLOW))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4801 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4802 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4803 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4804 + machine-dependent
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4805 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4806 +/* Tell final.c how to eliminate redundant test instructions. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4807 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4808 +/* Here we define machine-dependent flags and fields in cc_status
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4809 + (see `conditions.h'). */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4810 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4811 +/* Store in cc_status the expressions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4812 + that the condition codes will describe
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4813 + after execution of an instruction whose pattern is EXP.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4814 + Do not alter them if the instruction would not alter the cc's. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4815 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4816 +/* On the 6809, most of the insns to store in an address register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4817 + fail to set the cc's. However, in some cases these instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4818 + can make it possibly invalid to use the saved cc's. In those
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4819 + cases we clear out some or all of the saved cc's so they won't be used. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4820 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4821 +#define NOTICE_UPDATE_CC(EXP, INSN) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4822 + notice_update_cc((EXP), (INSN))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4823 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4824 +/*****************************************************************************
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4825 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4826 +** pragma support
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4827 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4828 +*****************************************************************************/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4829 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4830 +#if 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4831 +#define REGISTER_TARGET_PRAGMAS() \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4832 +do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4833 + extern void pragma_section PARAMS ((cpp_reader *)); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4834 + c_register_pragma (0, "section", pragma_section); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4835 +} while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4836 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4837 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4838 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4839 +/*--------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4840 + ASSEMBLER FORMAT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4841 +--------------------------------------------------------------*/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4842 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4843 +#define FMT_HOST_WIDE_INT "%ld"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4844 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4845 +/* Output to assembler file text saying following lines
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4846 + may contain character constants, extra white space, comments, etc. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4847 +#define ASM_APP_ON ";----- asm -----\n"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4848 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4849 +/* Output to assembler file text saying following lines
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4850 + no longer contain unusual constructs. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4851 +#define ASM_APP_OFF ";--- end asm ---\n"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4852 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4853 +/* Use a semicolon to begin a comment. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4854 +#define ASM_COMMENT_START "; "
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4855 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4856 +/* Output assembly directives to switch to section 'name' */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4857 +#undef TARGET_ASM_NAMED_SECTION
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4858 +#define TARGET_ASM_NAMED_SECTION m6809_asm_named_section
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4859 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4860 +#undef TARGET_HAVE_NAMED_SECTION
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4861 +#define TARGET_HAVE_NAMED_SECTION m6809_have_named_section
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4862 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4863 +/* Output before read-only data. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4864 +#define TEXT_SECTION_ASM_OP (code_section_op)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4865 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4866 +/* Output before writable data. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4867 +#define DATA_SECTION_ASM_OP (data_section_op)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4868 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4869 +/* Output before uninitialized data. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4870 +#define BSS_SECTION_ASM_OP (bss_section_op)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4871 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4872 +/* Support the ctors and dtors sections for g++. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4873 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4874 +#undef CTORS_SECTION_ASM_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4875 +#define CTORS_SECTION_ASM_OP "\t.area .ctors"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4876 +#undef DTORS_SECTION_ASM_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4877 +#define DTORS_SECTION_ASM_OP "\t.area .dtors"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4878 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4879 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4880 +#undef DO_GLOBAL_CTORS_BODY
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4881 +#undef DO_GLOBAL_DTORS_BODY
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4882 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4883 +#define HAS_INIT_SECTION
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4884 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4885 +/* This is how to output an assembler line
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4886 + that says to advance the location counter
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4887 + to a multiple of 2**LOG bytes. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4888 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4889 +#define ASM_OUTPUT_ALIGN(FILE,LOG) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4890 + if ((LOG) > 1) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4891 + fprintf (FILE, "\t.bndry %u\n", 1 << (LOG))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4892 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4893 +/* The .set foo,bar construct doesn't work by default */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4894 +#undef SET_ASM_OP
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4895 +#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4896 + do \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4897 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4898 + fputc ('\t', FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4899 + assemble_name (FILE, LABEL1); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4900 + fputs (" = ", FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4901 + assemble_name (FILE, LABEL2); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4902 + fputc ('\n', FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4903 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4904 + while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4905 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4906 +/* How to refer to registers in assembler output.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4907 + This sequence is indexed by compiler's hard-register-number (see above). */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4908 +#define MNAME(x) [SOFT_M0_REGNUM+(x)] = "*m" C_STRING(x) ,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4909 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4910 +#define REGISTER_NAMES { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4911 + [HARD_D_REGNUM]= "d", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4912 + [HARD_X_REGNUM]= "x", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4913 + [HARD_Y_REGNUM]= "y", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4914 + [HARD_U_REGNUM]= "u", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4915 + [HARD_S_REGNUM]= "s", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4916 + [HARD_PC_REGNUM]= "pc", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4917 + [HARD_A_REGNUM]= "a", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4918 + [HARD_B_REGNUM]= "b", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4919 + [HARD_CC_REGNUM]= "cc",\
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4920 + [HARD_DP_REGNUM]= "dp", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4921 + [SOFT_FP_REGNUM]= "soft_fp", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4922 + [SOFT_AP_REGNUM]= "soft_ap", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4923 + MNAME(0) MNAME(1) MNAME(2) MNAME(3) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4924 + MNAME(4) MNAME(5) MNAME(6) MNAME(7) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4925 + [HARD_RSVD1_REGNUM] = "-", \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4926 + [HARD_Z_REGNUM] = "z" /* bit 2 of CC */ }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4927 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4928 +/*****************************************************************************
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4929 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4930 +** Debug Support
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4931 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4932 +*****************************************************************************/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4933 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4934 +/* Default to DBX-style debugging */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4935 +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4936 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4937 +#define DBX_DEBUGGING_INFO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4938 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4939 +#define DEFAULT_GDB_EXTENSIONS 0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4940 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4941 +#define ASM_STABS_OP ";\t.stabs\t"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4942 +#define ASM_STABD_OP ";\t.stabd\t"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4943 +#define ASM_STABN_OP ";\t.stabn\t"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4944 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4945 +#define DBX_CONTIN_LENGTH 54
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4946 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4947 +#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(ASMFILE, FILENAME) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4948 +do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4949 + const char *p = FILENAME; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4950 + while ((p = strchr (p, '/')) != NULL) { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4951 + p = FILENAME = p+1; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4952 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4953 + fprintf (ASMFILE, "%s", ASM_STABS_OP); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4954 + output_quoted_string (ASMFILE, FILENAME); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4955 + fprintf (ASMFILE, ",%d,0,0,", N_SO); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4956 + assemble_name (ASMFILE, ltext_label_name); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4957 + fputc ('\n', ASMFILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4958 + switch_to_section (text_section); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4959 + (*targetm.asm_out.internal_label) (ASMFILE, "Ltext", 0); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4960 +} while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4961 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4962 +/* With -g, GCC sometimes outputs string literals that are longer than
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4963 + * the assembler can handle. Without actual debug support, these are
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4964 + * not really required. Redefine the function to output strings to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4965 + * output as much as possible. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4966 +#define OUTPUT_QUOTED_STRING(FILE, STR) m6809_output_quoted_string (FILE, STR)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4967 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4968 +/*****************************************************************************
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4969 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4970 +** Output and Generation of Labels
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4971 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4972 +*****************************************************************************/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4973 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4974 +/* Prefixes for various assembly-time objects */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4975 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4976 +#define REGISTER_PREFIX ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4977 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4978 +#define LOCAL_LABEL_PREFIX ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4979 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4980 +#define USER_LABEL_PREFIX "_"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4981 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4982 +#define IMMEDIATE_PREFIX "#"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4983 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4984 +/* This is how to output the definition of a user-level label named NAME,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4985 + such as the label on a static function or variable NAME. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4986 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4987 +#define ASM_OUTPUT_LABEL(FILE,NAME) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4988 +do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4989 + if (section_changed) { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4990 + fprintf (FILE, "\n%s\n\n", code_section_op); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4991 + section_changed = 0; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4992 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4993 + assemble_name (FILE, NAME); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4994 + fputs (":\n", FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4995 +} while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4996 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4997 +/* This is how to output the label for a function definition. It
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4998 + invokes ASM_OUTPUT_LABEL, but may examine the DECL tree node for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
4999 + other properties. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5000 +#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5001 + m6809_declare_function_name (FILE,NAME,DECL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5002 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5003 +/* This is how to output a command to make the user-level label
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5004 + named NAME defined for reference from other files. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5005 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5006 +#define GLOBAL_ASM_OP "\t.globl "
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5007 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5008 +/* This is how to output a reference to a user label named NAME. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5009 +#define ASM_OUTPUT_LABELREF(FILE,NAME) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5010 + fprintf (FILE, "_%s", NAME)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5011 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5012 +/* This is how to output a reference to a symbol ref
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5013 + * Check to see if the symbol is in the direct page */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5014 +#define ASM_OUTPUT_SYMBOL_REF(FILE,sym) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5015 +{ \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5016 + print_direct_prefix (FILE, sym); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5017 + assemble_name (FILE, XSTR (sym, 0)); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5018 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5019 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5020 +/* External references aren't necessary, so don't emit anything */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5021 +#define ASM_OUTPUT_EXTERNAL(FILE,DECL,NAME)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5022 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5023 +/* This is how to store into the string LABEL
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5024 + the symbol_ref name of an internal numbered label where
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5025 + PREFIX is the class of label and NUM is the number within the class.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5026 + This is suitable for output with `assemble_name'. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5027 +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5028 + sprintf (LABEL, "*%s%lu", PREFIX, (unsigned long int)NUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5029 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5030 +/* This is how to output an assembler line defining an `int' constant. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5031 +#define ASM_OUTPUT_INT(FILE,VALUE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5032 +( fprintf (FILE, "\t.word "), \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5033 + output_addr_const (FILE, (VALUE)), \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5034 + fprintf (FILE, "\n"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5035 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5036 +/* Likewise for `char' and `short' constants. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5037 +#define ASM_OUTPUT_SHORT(FILE,VALUE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5038 +( fprintf (FILE, "\t.word "), \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5039 + output_addr_const (FILE, (VALUE)), \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5040 + fprintf (FILE, "\n"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5041 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5042 +/* This is how to output a string. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5043 +#define ASM_OUTPUT_ASCII(FILE,STR,SIZE) m6809_output_ascii (FILE, STR, SIZE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5044 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5045 +/* This is how to output an insn to push a register on the stack.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5046 + It need not be very fast code. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5047 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5048 +#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5049 + fprintf (FILE, "\tpshs\t%s\n", reg_names[REGNO])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5050 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5051 +/* This is how to output an insn to pop a register from the stack.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5052 + It need not be very fast code. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5053 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5054 +#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5055 + fprintf (FILE, "\tpuls\t%s\n", reg_names[REGNO])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5056 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5057 +/* This is how to output an element of a case-vector that is absolute. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5058 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5059 +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5060 + fprintf (FILE, "\t.word L%u\n", VALUE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5061 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5062 +/* This is how to output an element of a case-vector that is relative. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5063 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5064 +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5065 + fprintf (FILE, "\t.word L%u-L%u\n", VALUE, REL)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5066 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5067 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5068 +/*****************************************************************************
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5069 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5070 +** Assembler Commands for Alignment
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5071 +**
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5072 +*****************************************************************************/
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5073 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5074 +/* ASM_OUTPUT_SKIP is supposed to zero initialize the data.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5075 + * So use the .byte and .word directives instead of .blkb */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5076 +#define ASM_OUTPUT_SKIP(FILE,SIZE) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5077 + do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5078 + int __size = SIZE; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5079 + while (__size > 0) { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5080 + if (__size >= 2) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5081 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5082 + fprintf (FILE, "\t.word\t0\t;skip space %d\n", __size); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5083 + __size -= 2; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5084 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5085 + else \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5086 + { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5087 + fprintf (FILE, "\t.byte\t0\t;skip space\n"); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5088 + __size--; \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5089 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5090 + } \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5091 + } while (0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5092 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5093 +/* This says how to output an assembler line
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5094 + to define a global common symbol. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5095 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5096 +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5097 + do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5098 + switch_to_section (bss_section); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5099 + fputs ("\t.globl\t", FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5100 + assemble_name ((FILE), (NAME)); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5101 + fputs ("\n", FILE); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5102 + assemble_name ((FILE), (NAME)); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5103 + fprintf ((FILE), ":\t.blkb\t" FMT_HOST_WIDE_INT "\n", (ROUNDED));} while(0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5104 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5105 +/* This says how to output an assembler line
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5106 + to define a local common symbol. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5107 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5108 +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5109 +do { \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5110 + switch_to_section (bss_section); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5111 + assemble_name ((FILE), (NAME)); \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5112 + fprintf ((FILE), ":\t.blkb\t" FMT_HOST_WIDE_INT "\n", (ROUNDED));} while(0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5113 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5114 +/* Store in OUTPUT a string (made with alloca) containing
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5115 + an assembler-name for a local static variable named NAME.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5116 + LABELNO is an integer which is different for each call. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5117 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5118 +#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5119 +( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5120 + sprintf ((OUTPUT), "%s.%lu", (NAME), (unsigned long int)(LABELNO)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5121 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5122 +/* Print an instruction operand X on file FILE.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5123 + CODE is the code from the %-spec for printing this operand.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5124 + If `%z3' was used to print operand 3, then CODE is 'z'. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5125 +#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5126 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5127 +/* Print a memory operand whose address is X, on file FILE. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5128 +#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5129 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5130 +/* Don't let stack pushes build up too much. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5131 +#define MAX_PENDING_STACK 8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5132 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5133 +/* Define values for builtin operations */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5134 +enum m6809_builtins
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5135 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5136 + M6809_SWI,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5137 + M6809_SWI2,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5138 + M6809_SWI3,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5139 + M6809_CWAI,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5140 + M6809_SYNC,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5141 + M6809_ADD_CARRY,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5142 + M6809_SUB_CARRY,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5143 + M6809_ADD_DECIMAL,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5144 + M6809_NOP,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5145 + M6809_BLOCKAGE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5146 +};
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5147 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5148 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.md gcc-4.6.4/gcc/config/m6809/m6809.md
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5149 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.md 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5150 +++ gcc-4.6.4/gcc/config/m6809/m6809.md 2015-07-20 22:05:21.702720231 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5151 @@ -0,0 +1,2358 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5152 +;; GCC machine description for Motorola 6809
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5153 +;; Copyright (C) 1989, 2005, 2006, 2007, 2008,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5154 +;; 2009 Free Software Foundation, Inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5155 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5156 +;; Mostly by Brian Dominy (brian@oddchange.com) with substantial renovations
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5157 +;; by William Astle (lost@l-w.ca).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5158 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5159 +;; Based on earlier work by Tom Jones (jones@sal.wisc.edu) and
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5160 +;; Matthias Doerfel (msdoerfe@informatik.uni-erlangen.de)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5161 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5162 +;; This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5163 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5164 +;; GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5165 +;; it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5166 +;; the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5167 +;; any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5168 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5169 +;; GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5170 +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5171 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5172 +;; GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5173 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5174 +;; You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5175 +;; along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5176 +;; <http://www.gnu.org/licenses/>.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5177 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5178 +;; General information:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5179 +;; --------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5180 +;; * This backend is mostly a rewrite from earlier (3.1.1 and before)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5181 +;; versions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5182 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5183 +;; * The 'A' and 'B' registers are treated as a single register by the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5184 +;; register allocator; hence, the instruction templates assume that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5185 +;; both can be modified if either one is available for use. No
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5186 +;; attempt is made to split instructions to refer to a particular half
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5187 +;; of the register. It is always referred to as the 'D' register, even
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5188 +;; in QImode (when it will be displayed as 'B').
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5189 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5190 +;; * There is full support for proper branch instruction generation,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5191 +;; based on instruction lengths. However, many instruction patterns
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5192 +;; are still overloaded to emit lots of real instructions, which can
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5193 +;; make the length calculation difficult; in those cases, I've tried
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5194 +;; to be pessimistic and assume the worst-case.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5195 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5196 +;; * The instruction type attributes are only defined for branch
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5197 +;; vs. non branch instructions for now, since there is seemingly no
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5198 +;; reason to define these for other types anyway.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5199 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5200 +;; * The limited number of total registers presents the greatest
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5201 +;; challenge. There are 'soft registers' -- memory locations
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5202 +;; used to simulate real regs -- which can be helpful.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5203 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5204 +;; * Position-independent code (PIC) is supported and has been tested
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5205 +;; but not to the extent of absolute code generation.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5206 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5207 +;; * All of the 6809 special opcodes, e.g. SWI and SYNC, are defined
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5208 +;; as UNSPEC instructions, and can be accessed from C code using
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5209 +;; __builtin_xxxx() style functions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5210 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5211 +;; What still needs to be done:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5212 +;; ----------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5213 +;; * Replace remaining instances of (define_peephole) with
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5214 +;; (define_peephole2), or remove them completely if they are not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5215 +;; matching anyway. Add more peepholes for things actually encountered.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5216 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5217 +;; * Indexing addressing can lead to crashes in complex functions when
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5218 +;; register pressure is high. Only the 'D' register can actually be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5219 +;; used as an index register, and its demand by other instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5220 +;; can sometimes mean that it is impossible to satisfy constraints.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5221 +;; Currently, indexing is completely disabled to avoid these types
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5222 +;; of problems, although code is slightly more inefficient in some
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5223 +;; working cases.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5224 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5225 +;; * 32-bit math is terribly inefficient.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5226 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5227 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5228 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5229 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5230 +;;- Constants
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5231 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5232 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5233 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5234 +; Define constants for hard register numbers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5235 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5236 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5237 + (HARD_RSVD1_REGNUM 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5238 + (HARD_X_REGNUM 1) (HARD_Y_REGNUM 2) (HARD_U_REGNUM 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5239 + (HARD_S_REGNUM 4) (HARD_PC_REGNUM 5) (HARD_D_REGNUM 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5240 + (HARD_Z_REGNUM 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5241 + (HARD_A_REGNUM 8) (HARD_B_REGNUM 9)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5242 + (HARD_CC_REGNUM 10) (HARD_DP_REGNUM 11)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5243 + (SOFT_FP_REGNUM 12) (SOFT_AP_REGNUM 13)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5244 + (SOFT_M0_REGNUM 14) (SOFT_M1_REGNUM 15)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5245 + (SOFT_M2_REGNUM 16) (SOFT_M3_REGNUM 17)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5246 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5247 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5248 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5249 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5250 +; The range in which a short branch insn can be used.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5251 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5252 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5253 + (MIN_SHORT_BRANCH_OFFSET -127)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5254 + (MAX_SHORT_BRANCH_OFFSET 128)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5255 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5256 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5257 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5258 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5259 +; The lengths of various types of real 6809 instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5260 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5261 +; By default, ordinary insns are 4 bytes long. This is often not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5262 +; right, and the insn patterns below will redefine this to the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5263 +; correct value.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5264 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5265 +; Branch instruction lengths (conditional and unconditionals) are
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5266 +; well known and declared here. The short insns are used when the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5267 +; offset is within the range declared above (between MIN_SHORT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5268 +; and MAX_SHORT) ; otherwise the long form is used.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5269 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5270 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5271 + (DEFAULT_INSN_LENGTH 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5272 + (SHORT_CBRANCH_LENGTH 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5273 + (LONG_CBRANCH_LENGTH 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5274 + (SHORT_BRANCH_LENGTH 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5275 + (LONG_BRANCH_LENGTH 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5276 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5277 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5278 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5279 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5280 +; Constants for insn cycle counts.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5281 +; Note that these counts all assume 1-byte opcodes. 2-byte
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5282 +; opcodes require 1 extra cycles for fetching the extra byte.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5283 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5284 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5285 + ;; The default insn length, when it cannot be calculated.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5286 + ;; Take a conservative approach and estimate high.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5287 + (DEFAULT_INSN_CYCLES 10)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5288 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5289 + ;; Cycle counts for ALU and load operations.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5290 + (ALU_INHERENT_CYCLES 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5291 + (ALU_IMMED_CYCLES 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5292 + (ALU_DIRECT_CYCLES 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5293 + (ALU_INDEXED_BASE_CYCLES 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5294 + (ALU_EXTENDED_CYCLES 5)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5295 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5296 + ;; If an ALU operation is on a 16-bit register (D), then
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5297 + ;; add this number of cycles to the total count.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5298 + (ALU_16BIT_CYCLES 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5299 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5300 + ;; A load of a 16-bit register incurs this extra amount.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5301 + (LOAD_16BIT_CYCLES 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5302 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5303 + ;; Cycle counts for memory-only operations (bit shifts, clear, test)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5304 + (MEM_DIRECT_CYCLES 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5305 + (MEM_INDEXED_BASE_CYCLES 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5306 + (MEM_EXTENDED_CYCLES 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5307 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5308 + ;; Cycle count for any reg-reg transfer (regardless of size)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5309 + (EXG_CYCLES 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5310 + (TFR_CYCLES 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5311 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5312 + ;; Cycle count for a condition code update (andcc/orcc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5313 + (CC_CYCLES 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5314 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5315 + (JMP_DIRECT_CYCLES 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5316 + (JMP_INDEXED_BASE_CYCLES 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5317 + (JMP_EXTENDED_CYCLES 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5318 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5319 + (JSR_DIRECT_CYCLES 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5320 + (JSR_INDEXED_BASE_CYCLES 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5321 + (JSR_EXTENDED_CYCLES 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5322 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5323 + (LEA_BASE_CYCLES 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5324 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5325 + ;; Cycle count for a psh/pul operations. Add to this the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5326 + ;; total number of bytes moved for the correct count.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5327 + (PSH_PUL_CYCLES 5)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5328 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5329 + ;; Miscellaneous cycle counts
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5330 + (CWAI_CYCLES 20)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5331 + (MUL_CYCLES 11)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5332 + (NOP_CYCLES 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5333 + (RTI_CYCLES 15)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5334 + (RTS_CYCLES 5)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5335 + (SWI_CYCLES 20)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5336 + (SYNC_CYCLES 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5337 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5338 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5339 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5340 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5341 +; An enumeration of values for each "unspec"; i.e. unspecified
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5342 +; instruction. These represent insns that are meaningful on the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5343 +; 6809 but which have no intrinsic meaning to GCC itself.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5344 +; These insns can be generated explicitly using the __builtin_xxx
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5345 +; syntax; they are also implicitly generated by the backend
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5346 +; as needed to implement other insns.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5347 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5348 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5349 + (UNSPEC_BLOCKAGE 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5350 + (UNSPEC_PUSH_RS 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5351 + (UNSPEC_POP_RS 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5352 + (UNSPEC_SWI 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5353 + (UNSPEC_CWAI 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5354 + (UNSPEC_ADD_CARRY 5)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5355 + (UNSPEC_SUB_CARRY 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5356 + (UNSPEC_SYNC 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5357 + (UNSPEC_ADD_DECIMAL 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5358 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5359 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5360 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5361 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5362 +;;- Predicates
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5363 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5364 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5365 +(include "predicates.md")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5366 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5367 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5368 +;;- Attributes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5369 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5370 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5371 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5372 +;; The type attribute is used to distinguish between different
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5373 +;; types of branch instructions, so that their lengths can be
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5374 +;; calculated correctly.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5375 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5376 +(define_attr "type" "branch,cbranch,unknown" (const_string "unknown"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5377 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5378 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5379 +;; The length of a branch instruction is calculated based on how
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5380 +;; far away the branch target is. Lengths of other insns default
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5381 +;; to 4. set_attr is used in instruction templates to specify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5382 +;; the length when it is known exactly. When not sure, err on
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5383 +;; the high side to avoid compile errors.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5384 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5385 +(define_attr "length" ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5386 + (cond [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5387 + (eq_attr "type" "branch")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5388 + (if_then_else (lt (minus (match_dup 0) (pc))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5389 + (const_int MIN_SHORT_BRANCH_OFFSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5390 + (const_int LONG_BRANCH_LENGTH)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5391 + (if_then_else (gt (minus (match_dup 0) (pc))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5392 + (const_int MAX_SHORT_BRANCH_OFFSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5393 + (const_int LONG_BRANCH_LENGTH)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5394 + (const_int SHORT_BRANCH_LENGTH)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5395 + (eq_attr "type" "cbranch")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5396 + (if_then_else (lt (minus (match_dup 0) (pc))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5397 + (const_int MIN_SHORT_BRANCH_OFFSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5398 + (const_int LONG_CBRANCH_LENGTH)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5399 + (if_then_else (gt (minus (match_dup 0) (pc))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5400 + (const_int MAX_SHORT_BRANCH_OFFSET))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5401 + (const_int LONG_CBRANCH_LENGTH)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5402 + (const_int SHORT_CBRANCH_LENGTH)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5403 + ] (const_int DEFAULT_INSN_LENGTH)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5404 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5405 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5406 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5407 +;; The default attributes for 'asm' statements.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5408 +;; The default length is the longest possible single 6809 instruction,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5409 +;; which is 5 bytes. GCC will automatically multiply this by the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5410 +;; number of real insns contained in an asm statement.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5411 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5412 +(define_asm_attributes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5413 + [(set_attr "length" "5")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5414 + (set_attr "type" "unknown")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5415 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5416 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5417 +;; An attribute for the number of cycles that it takes an instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5418 +;; to execute.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5419 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5420 +(define_attr "cycles" "" (const_int DEFAULT_INSN_CYCLES))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5421 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5422 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5423 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5424 +;;- Instruction patterns. When multiple patterns apply,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5425 +;;- the first one in the file is chosen.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5426 +;;-
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5427 +;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5428 +;;-
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5429 +;;- Note: NOTICE_UPDATE_CC in m6809.h handles condition code updates
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5430 +;;- for most instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5431 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5432 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5433 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5434 +;;- Test
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5435 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5436 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5437 +;; cmpx is 3 bytes, not 4
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5438 +(define_insn "*tsthi_x"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5439 + [(set (cc0) (match_operand:HI 0 "register_operand_x" "v"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5440 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5441 + "cmpx\t#0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5442 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5443 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5444 +;; subd #0 is 3 bytes, better than cmpd #0 which is 4 bytes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5445 +(define_insn "*tsthi_d"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5446 + [(set (cc0) (match_operand:HI 0 "register_operand_d" "d"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5447 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5448 + "subd\t#0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5449 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5450 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5451 +(define_insn "*tsthi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5452 + [(set (cc0) (match_operand:HI 0 "register_operand" "a"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5453 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5454 + "cmp%0\t#0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5455 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5456 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5457 +(define_insn "*bitqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5458 + [(set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5459 + (and:QI (match_operand:QI 0 "register_operand" "%q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5460 + (match_operand:QI 1 "general_operand" "mi")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5461 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5462 + "bit%0\t%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5463 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5464 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5465 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5466 +(define_insn "tstqi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5467 + [(set (cc0) (match_operand:QI 0 "nonimmediate_operand" "q,mt"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5468 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5469 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5470 + tst%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5471 + tst\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5472 + [(set_attr "length" "1,3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5473 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5474 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5475 +;;- Compare instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5476 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5477 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5478 +;; - cmphi for register to memory or register compares
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5479 +(define_insn "cmphi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5480 + [(set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5481 + (compare
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5482 + (match_operand:HI 0 "general_operand" "da, mi, ??Ud")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5483 + (match_operand:HI 1 "general_operand" "mi, da, dU")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5484 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5485 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5486 + if ((REG_P (operands[0])) && (REG_P (operands[1]))) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5487 + output_asm_insn ("pshs\t%1\t;cmphi: R:%1 with R:%0", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5488 + return "cmp%0\t,s++\t;cmphi:";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5489 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5490 + if (GET_CODE (operands[0]) == REG)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5491 + return "cmp%0\t%1\t;cmphi:";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5492 + else {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5493 + cc_status.flags |= CC_REVERSED;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5494 + return "cmp%1\t%0\t;cmphi:(R)";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5495 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5496 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5497 + [(set_attr "length" "5,5,7")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5498 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5499 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5500 +(define_insn "cmpqi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5501 + [(set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5502 + (compare (match_operand:QI 0 "whole_general_operand" "q,q, q,O,mt,K")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5503 + (match_operand:QI 1 "whole_general_operand" "O,mt,K,q,q, q")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5504 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5505 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5506 + if (REG_P (operands[0]) && !M_REG_P (operands[0]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5507 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5508 + if (operands[1] == const0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5509 + return "tst%0\t;cmpqi:(ZERO)";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5510 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5511 + return "cmp%0\t%1\t;cmpqi:";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5512 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5513 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5514 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5515 + cc_status.flags |= CC_REVERSED;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5516 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5517 + if (operands[0] == const0_rtx)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5518 + return "tst%1\t;cmpqi:(RZERO)";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5519 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5520 + return "cmp%1\t%0\t;cmpqi:(R)";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5521 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5522 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5523 + [(set_attr "length" "1,3,2,1,3,2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5524 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5525 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5526 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5527 +;;- Compare/branch pattern
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5528 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5529 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5530 +(define_expand "cbranchhi4"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5531 + [(set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5532 + (compare
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5533 + (match_operand:HI 1 "general_operand" "da, mi, ??Ud")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5534 + (match_operand:HI 2 "general_operand" "mi, da, dU")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5535 + (set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5536 + (if_then_else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5537 + (match_operator 0 "ordered_comparison_operator" [(cc0) (const_int 0)])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5538 + (label_ref (match_operand 3 "" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5539 + (pc)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5540 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5541 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5542 +)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5543 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5544 +(define_expand "cbranchqi4"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5545 + [(set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5546 + (compare
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5547 + (match_operand:QI 1 "whole_general_operand" "q,q, q,O,mt,K")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5548 + (match_operand:QI 2 "whole_general_operand" "O,mt,K,q,q, q")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5549 + (set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5550 + (if_then_else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5551 + (match_operator 0 "ordered_comparison_operator" [(cc0) (const_int 0)])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5552 + (label_ref (match_operand 3 "" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5553 + (pc)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5554 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5555 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5556 +)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5557 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5558 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5559 +;;- Move
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5560 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5561 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5562 +; this looks good (obviously not finished) but I still see 'movsi'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5563 +; places in udivsi3 where it's broken
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5564 +; (define_insn "pushsi1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5565 +; [(set (mem:SI (pre_dec (reg:HI HARD_S_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5566 +; (match_operand:SI 0 "general_operand" "o"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5567 +; (set (reg:HI HARD_S_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5568 +; (plus:HI (reg:HI HARD_S_REGNUM) (const_int -4))) ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5569 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5570 +; "; pushsi %0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5571 +; [(set_attr "length" "12")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5572 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5573 +; (define_insn "popsi1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5574 +; [(set (match_operand:SI 0 "general_operand" "=o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5575 +; (mem:SI (post_inc (reg:HI HARD_S_REGNUM))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5576 +; (set (reg:HI HARD_S_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5577 +; (plus:HI (reg:HI HARD_S_REGNUM) (const_int 4))) ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5578 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5579 +; "; popsi %0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5580 +; [(set_attr "length" "12")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5581 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5582 +; (define_insn "movsi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5583 +; [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5584 +; (match_operand:SI 1 "general_operand" " oi"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5585 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5586 +; "; movsi %0 <- %1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5587 +; [(set_attr "length" "1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5588 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5589 +; this doesn't work
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5590 +; (define_expand "movsi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5591 +; [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5592 +; (set (match_operand:SI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5593 +; (match_operand:SI 1 "general_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5594 +; (clobber (match_scratch:HI 2 ""))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5595 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5596 +; {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5597 +; rtx insn;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5598 +; if (STACK_PUSH_P (operands[0]) || STACK_POP_P (operands[1]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5599 +; {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5600 +; REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5601 +; }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5602 +; insn = emit_move_multi_word (SImode, operands[0], operands[1]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5603 +; DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5604 +; })
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5605 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5606 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5607 +(define_expand "movhi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5608 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5609 + (match_operand:HI 1 "general_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5610 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5611 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5612 + /* One of the ops has to be in a register prior to reload */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5613 + if (!register_operand (operand0, HImode) &&
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5614 + !register_operand (operand1, HImode))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5615 + operands[1] = copy_to_mode_reg (HImode, operand1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5616 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5617 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5618 +;;; Try a splitter to handle failure cases where we try to move
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5619 +;;; an immediate constant (zero usually) directly to memory.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5620 +;;; This absolutely requires an intermediate register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5621 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5622 + [(set (match_operand:HI 0 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5623 + (match_operand:HI 1 "immediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5624 + (clobber (match_operand:HI 2 "register_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5625 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5626 + [(set (match_dup 2) (match_dup 1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5627 + (set (match_dup 0) (match_dup 2))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5628 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5629 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5630 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5631 +;;; This would be a nice method for loading from a word array,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5632 +;;; but it is never generated because the combiner cannot merge
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5633 +;;; more than 3 instructions (there are four here). This is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5634 +;;; perhaps better done via a peephole.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5635 +(define_insn "*movhi_array_load"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5636 + [(set (match_operand:HI 0 "nonimmediate_operand" "=da")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5637 + (mem:HI (plus:HI (ashift:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%B")) (const_int 1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5638 + (match_operand:HI 2 "immediate_operand" "i"))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5639 + (clobber (match_scratch:HI 3 "=X"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5640 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5641 + "ldx\t%2\;abx\;abx\;ld%0\t,x"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5642 + [(set_attr "length" "7")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5643 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5644 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5645 +;;; Optimize the move of a byte to the stack using the pshs instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5646 +;;; instead of a store with pre-increment.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5647 +(define_insn "movhi_push"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5648 + [(set (match_operand:HI 0 "push_operand" "=m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5649 + (match_operand:HI 1 "register_operand" "U"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5650 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5651 + "pshs\t%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5652 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5653 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5654 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5655 +(define_insn "*movhi_pic_symbolref"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5656 + [(set (match_operand:HI 0 "register_operand" "=a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5657 + (match_operand:HI 1 "symbolic_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5658 + "flag_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5659 + "lea%0\t%c1,pcr"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5660 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5661 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5662 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5663 +(define_insn "*movhi_1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5664 + [(set (match_operand:HI 0 "nonimmediate_operand" "=a,d,a,ad,mu")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5665 + (match_operand:HI 1 "general_operand" " a,a,d,miu,ad"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5666 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5667 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5668 + lea%0\t,%1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5669 + tfr\t%1,%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5670 + tfr\t%1,%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5671 + ld%0\t%1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5672 + st%1\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5673 + [(set_attr "length" "2,2,2,*,*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5674 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5675 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5676 +;;; Generated by the combiner to merge an address calculation with
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5677 +;;; a byte load. We can use the 'abx' instruction here.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5678 +(define_insn "*movqi_array_load"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5679 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5680 + (mem:QI (plus:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%B"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5681 + (match_operand:HI 2 "immediate_operand" "i"))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5682 + (clobber (match_scratch:HI 3 "=X"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5683 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5684 + "ldx\t%2\;abx\;ld%0\t,x"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5685 + [(set_attr "length" "6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5686 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5687 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5688 +;;; Optimize the move of a byte to the stack using the pshs instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5689 +;;; instead of a store with pre-increment.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5690 +(define_insn "movqi_push"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5691 + [(set (match_operand:QI 0 "push_operand" "=m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5692 + (match_operand:QI 1 "register_operand" " q"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5693 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5694 + "pshs\t%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5695 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5696 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5697 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5698 +;;; Optimize the move of a byte from the stack using the puls instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5699 +;;; instead of a store with post-decrement.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5700 +(define_insn "movqi_pop"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5701 + [(set (match_operand:QI 0 "register_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5702 + (match_operand:QI 1 "pop_operand" "m"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5703 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5704 + "puls\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5705 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5706 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5707 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5708 +;;- load low byte of 16-bit data into 8-bit register/memory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5709 +(define_insn "*mov_lsb"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5710 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,m,!q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5711 + (subreg:QI (match_operand:HI 1 "general_operand" "d,m,a,d, U") 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5712 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5713 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5714 + \t;movlsbqihi: D->B
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5715 + ld%0\t%L1\t;movlsbqihi: msb:%1 -> R:%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5716 + tfr\t%1,d\t;movlsbqihi: R:%1 -> R:%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5717 + stb\t%0\t;movlsbqihi: R:%1 -> %0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5718 + pshs\t%1\t;movlsbqihi: R:%1 -> R:%0\;leas\t1,s\;puls\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5719 + [(set_attr "length" "0,*,2,*,6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5720 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5721 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5722 +;;- load high byte of 16-bit data into 8-bit register/memory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5723 +(define_insn "*mov_msb"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5724 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,q,m,!q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5725 + (subreg:QI (match_operand:HI 1 "general_operand" "d,O,a,m,d, U") 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5726 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5727 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5728 + tfr\ta,b\t;movmsbqihi: D->B
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5729 + clr%0\t\t;movmsbqihi: ZERO -> R:%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5730 + tfr\t%1,d\t;movmsbqihi: R:%1 -> R:%0\;tfr\ta,b
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5731 + ld%0\t%L1\t;movmsbqihi: lsb:%1 -> R:%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5732 + sta\t%0\t;movmsbqihi: R:%1 -> %0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5733 + pshs\t%1\t;movmsbqihi: R:%1 -> R:%0\;puls\t%0\;leas\t1,s"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5734 + [(set_attr "length" "2,1,4,*,*,6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5735 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5736 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5737 +(define_insn "*movqi_boolean"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5738 + [(set (reg:QI HARD_Z_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5739 + (match_operand:QI 0 "general_operand" "q,O,i,m"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5740 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5741 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5742 + tst%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5743 + andcc\t#~4
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5744 + orcc\t#4
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5745 + tst\t%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5746 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5747 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5748 +(define_insn "movqi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5749 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,m,q,m,q,z")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5750 + (match_operand:QI 1 "general_operand" " q,O,O,mi,q,z,q"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5751 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5752 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5753 + tfr\t%1,%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5754 + clr%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5755 + clr\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5756 + ld%0\t%1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5757 + st%1\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5758 + tfr\tcc,%0\;and%0\t#4
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5759 + tst%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5760 + [(set_attr "length" "2,1,3,*,*,4,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5761 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5762 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5763 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5764 +;;- Swap registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5765 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5766 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5767 +; Note: 8-bit swap is never needed so it is not defined.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5768 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5769 +(define_insn "swaphi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5770 + [(set (match_operand:HI 0 "register_operand" "+r")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5771 + (match_operand:HI 1 "register_operand" "+r"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5772 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5773 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5774 + "exg\t%1,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5775 + [(set_attr "length" "2")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5776 + (set (attr "cycles") (const_int EXG_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5777 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5778 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5779 +(define_insn "bswaphi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5780 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5781 + (bswap:HI (match_operand:HI 1 "register_operand" "0")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5782 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5783 + "exg\ta,b"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5784 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5785 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5786 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5787 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5788 +;;- Extension and truncation insns.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5789 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5790 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5791 +(define_insn "extendqihi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5792 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5793 + (sign_extend:HI (match_operand:QI 1 "general_operand" "B")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5794 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5795 + "sex\t\t;extendqihi2: R:%1 -> R:%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5796 + [(set_attr "length" "1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5797 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5798 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5799 +(define_insn "zero_extendqihi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5800 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5801 + (zero_extend:HI (match_operand:QI 1 "general_operand" "B")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5802 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5803 + "clra\t\t;zero_extendqihi: R:%1 -> R:%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5804 + [(set_attr "length" "1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5805 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5806 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5807 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5808 +;;- All kinds of add instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5809 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5810 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5811 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5812 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5813 +;; gcc's automatic version of addsi3 doesn't know about adcb,adca
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5814 +;; so it is MUCH less efficient. Define this one ourselves.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5815 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5816 +;; TODO - can't always get 'd' for the clobber... allow other registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5817 +;; as well and use exg d,R ... exg R,d around the code sequence to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5818 +;; use others, at a price. Also consider libcall for this when
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5819 +;; optimizing for size.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5820 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5821 +(define_insn "addsi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5822 + [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5823 + (plus:SI (match_operand:SI 1 "general_operand" "%o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5824 + (match_operand:SI 2 "general_operand" " oi")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5825 + (clobber (match_scratch:HI 3 "=d"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5826 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5827 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5828 + m6809_output_addsi3 (PLUS, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5829 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5830 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5831 + [(set_attr "length" "21")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5832 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5833 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5834 +; Increment of a 16-bit MEM by 1 can be done without a register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5835 +(define_insn "*addhi_mem_1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5836 + [(set (match_operand:HI 0 "memory_operand" "=m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5837 + (plus:HI (match_dup 0) (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5838 + "GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5839 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5840 + rtx xoperands[2];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5841 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5842 + xoperands[0] = operands[0];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5843 + xoperands[1] = adjust_address (operands[0], QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5844 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5845 + output_asm_insn ("inc\t%1", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5846 + output_asm_insn ("bne\t__IL%=", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5847 + output_asm_insn ("inc\t%0\;__IL%=:", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5848 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5849 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5850 + [(set_attr "length" "7")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5851 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5852 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5853 +; Decrement of a 16-bit MEM by 1 can be done without a register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5854 +(define_insn "*addhi_mem_minus1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5855 + [(set (match_operand:HI 0 "memory_operand" "=m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5856 + (plus:HI (match_dup 0) (const_int -1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5857 + "GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5858 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5859 + rtx xoperands[2];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5860 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5861 + xoperands[0] = operands[0];
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5862 + xoperands[1] = adjust_address (operands[0], QImode, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5863 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5864 + output_asm_insn ("tst\t%1", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5865 + output_asm_insn ("bne\t__IL%=", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5866 + output_asm_insn ("dec\t%0", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5867 + output_asm_insn ("__IL%=:", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5868 + output_asm_insn ("dec\t%1", xoperands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5869 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5870 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5871 + [(set_attr "length" "7")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5872 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5873 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5874 +; Allow the addition of an 8-bit quantity to a 16-bit quantity
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5875 +; using the LEAX B,Y addressing mode, where X and Y are both
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5876 +; index registers. This will only get generated via the peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5877 +; which removes a sign extension.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5878 +(define_insn "*addhi_b"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5879 + [(set (match_operand:HI 0 "index_register_operand" "=a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5880 + (plus:HI(match_operand:HI 1 "index_register_operand" "%a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5881 + (match_operand:QI 2 "register_operand" "q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5882 + ))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5883 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5884 + "lea%0\t%2,%1\t;addhi_b: R:%0 = R:%2 + R:%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5885 + [(set_attr "length" "*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5886 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5887 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5888 +; Splitter for addhi pattern #5 below
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5889 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5890 + [(set (match_operand:HI 0 "index_register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5891 + (plus:HI (match_dup 0) (match_operand:HI 1 "memory_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5892 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5893 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5894 + (parallel [(set (match_dup 0) (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5895 + (set (reg:HI HARD_D_REGNUM) (match_dup 0))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5896 + (set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5897 + (plus:HI (reg:HI HARD_D_REGNUM) (match_dup 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5898 + (parallel [(set (match_dup 0) (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5899 + (set (reg:HI HARD_D_REGNUM) (match_dup 0))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5900 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5901 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5902 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5903 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5904 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5905 +; Splitter for addhi pattern #7 below
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5906 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5907 + [(set (match_operand:HI 0 "index_register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5908 + (plus:HI (match_dup 0) (match_operand:HI 1 "index_register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5909 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5910 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5911 + (parallel [(set (match_dup 1) (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5912 + (set (reg:HI HARD_D_REGNUM) (match_dup 1))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5913 + (set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5914 + (plus:HI (reg:HI HARD_D_REGNUM) (match_dup 0)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5915 + (parallel [(set (match_dup 1) (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5916 + (set (reg:HI HARD_D_REGNUM) (match_dup 1))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5917 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5918 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5919 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5920 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5921 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5922 +; TODO - this is ugly. During RTL generation, we don't know what registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5923 +; are available, so the multiple-insn sequences can only be solved
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5924 +; via 'define_split's during matching. See andhi3 for an example.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5925 +; Keep the constraints with ? modifiers to help reload pick the right
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5926 +; registers.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5927 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5928 +; The forms are:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5929 +; 1. D += D, expand this into a shift instead. (rtx costs should be corrected
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5930 +; to avoid this even happening...)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5931 +; 2. D += U, require U to be pushed to memory. (Lots of patterns do this
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5932 +; now, is this a better way?)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5933 +; 3. Best choice: 'addd'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5934 +; 4. Next best choice: 'lea'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5935 +; 5. Hybrid of 3 and 4
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5936 +; 6. Same as 4, not bad
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5937 +; 7. BAD, no D register at all
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5938 +; 8. 'lea', as good as 4.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5939 +(define_insn "addhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5940 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d, d, d, a,?a, a,???T,a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5941 + (plus:HI(match_operand:HI 1 "add_general_operand" "%0, 0, 0, d, 0, a, 0, a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5942 + (match_operand:HI 2 "general_operand" " 0, !U, mi, a, m, d, T, i")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5943 + ))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5944 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5945 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5946 + lslb\t\t;addhi: R:%0 += R:%2\;rola\t\t;also R:%0 *= 2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5947 + pshs\t%2\t;addhi: R:%0 += R:%2\;add%0\t,s++
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5948 + add%0\t%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5949 + lea%0\t%1,%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5950 + #
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5951 + lea%0\t%2,%1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5952 + #
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5953 + lea%0\t%a2,%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5954 + [(set_attr "length" "2,6,*,*,7,*,7,*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5955 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5956 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5957 +(define_insn "addqi3_carry"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5958 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5959 + (unspec:QI [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5960 + (match_operand:QI 1 "whole_general_operand" "%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5961 + (match_operand:QI 2 "whole_general_operand" "tmi")] UNSPEC_ADD_CARRY))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5962 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5963 + "adc%0\t%2\t;addqi_carry: R:%0 += %2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5964 + [(set_attr "length" "*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5965 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5966 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5967 +; TODO: specifying 'A' for the first constraint, to force into the A register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5968 +; is not working because of the way registers are currently set up. This will
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5969 +; take some work to get right. Thus the second alternative as a backup.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5970 +(define_insn "addqi3_decimal"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5971 + [(set (match_operand:QI 0 "nonimmediate_operand" "=A,?q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5972 + (unspec:QI [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5973 + (match_operand:QI 1 "general_operand" "%0,0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5974 + (match_operand:QI 2 "general_operand" "mi,mi")] UNSPEC_ADD_DECIMAL))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5975 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5976 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5977 + adda\t%2\;daa
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5978 + tfr\t%0,a\;adda\t%2\;daa\;tfr\ta,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5979 + [(set_attr "length" "5,9")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5980 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5981 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5982 +(define_insn "addqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5983 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,q,q,m,m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5984 + (plus:QI (match_operand:QI 1 "whole_general_operand" "%0,0,0,0,0,0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5985 + (match_operand:QI 2 "whole_general_operand" " 0,I,N,I,N,mi")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5986 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5987 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5988 + asl%0\t\t;addqi: R:%0 = R:%0 + R:%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5989 + inc%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5990 + dec%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5991 + inc\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5992 + dec\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5993 + add%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5994 + [(set_attr "length" "1,1,1,3,3,*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5995 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5996 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5997 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5998 +;;- Subtract instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
5999 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6000 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6001 +(define_insn "subsi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6002 + [(set (match_operand:SI 0 "nonimmediate_operand" "=o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6003 + (minus:SI (match_operand:SI 1 "general_operand" " o")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6004 + (match_operand:SI 2 "general_operand" " oi")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6005 + (clobber (match_scratch:HI 3 "=d"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6006 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6007 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6008 + m6809_output_addsi3 (MINUS, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6009 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6010 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6011 + [(set_attr "length" "21")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6012 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6013 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6014 +(define_insn "subhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6015 + [(set (match_operand:HI 0 "register_operand" "=d, d, a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6016 + (minus:HI (match_operand:HI 1 "register_operand" "0, 0, 0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6017 + (match_operand:HI 2 "general_operand" "mi, ?U,n")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6018 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6019 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6020 + sub%0\t%2\t;subhi: R:%0 -= %2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6021 + pshs\t%2\t;subhi: R:%0 -= R:%2\;sub%0\t,s++
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6022 + lea%0\t%n2,%1\t;subhi: R:%0 = R:%1 + %n2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6023 + [(set_attr "length" "*,5,3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6024 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6025 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6026 +(define_insn "subqi3_carry"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6027 + [(set (match_operand:QI 0 "register_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6028 + (unspec:QI [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6029 + (match_operand:QI 1 "whole_general_operand" "%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6030 + (match_operand:QI 2 "whole_general_operand" "tmi")] UNSPEC_SUB_CARRY))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6031 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6032 + "sbc%0\t%2\t;subqi_carry: R:%0 += %2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6033 + [(set_attr "length" "*")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6034 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6035 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6036 +(define_insn "subqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6037 + [(set (match_operand:QI 0 "register_operand" "=q, q, !q, q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6038 + (minus:QI (match_operand:QI 1 "whole_register_operand" "0, 0, I, 0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6039 + (match_operand:QI 2 "whole_general_operand" "I, mi, 0, t")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6040 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6041 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6042 + dec%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6043 + sub%0\t%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6044 + dec%0\;neg%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6045 + sub%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6046 + [(set_attr "length" "1,3,2,3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6047 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6048 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6049 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6050 +;;- Multiply instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6051 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6052 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6053 +; TODO - merge these two instructions, using 'extend_operator' to match
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6054 +; either signed or zero extension. Everything else is the same.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6055 +(define_insn "mulqihi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6056 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6057 + (mult:HI (sign_extend:HI (match_operand:QI 1 "general_operand" "%q"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6058 + (match_operand:QI 2 "general_operand" "tmK")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6059 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6060 + "lda\t%2\t;mulqihi3\;mul"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6061 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6062 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6063 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6064 +(define_insn "umulqihi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6065 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6066 + (mult:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "%q"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6067 + (match_operand:QI 2 "general_operand" "tmK")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6068 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6069 + "lda\t%2\t;umulqihi3\;mul"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6070 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6071 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6072 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6073 +; Expand a 16x16 multiplication into either a libcall or a shift.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6074 +; If the second operand is a small constant, use the above form.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6075 +; Otherwise, do a libcall.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6076 +(define_expand "mulhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6077 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6078 + (mult:HI (match_operand:HI 1 "general_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6079 + (match_operand:HI 2 "nonmemory_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6080 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6081 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6082 + emit_libcall_insns (HImode, "mulhi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6083 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6084 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6085 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6086 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6087 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6088 +;;- Divide instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6089 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6090 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6091 +(define_expand "divhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6092 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6093 + (div:HI (match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6094 + (match_operand:HI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6095 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6096 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6097 + emit_libcall_insns (HImode, "divhi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6098 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6099 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6100 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6101 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6102 +(define_expand "divqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6103 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6104 + (div:QI (match_operand:QI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6105 + (match_operand:QI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6106 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6107 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6108 + emit_libcall_insns (QImode, "divqi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6109 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6110 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6111 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6112 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6113 +(define_expand "udivhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6114 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6115 + (udiv:HI (match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6116 + (match_operand:HI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6117 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6118 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6119 + emit_libcall_insns (HImode, "udivhi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6120 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6121 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6122 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6123 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6124 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6125 +;;- mod
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6126 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6127 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6128 +(define_expand "modhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6129 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6130 + (mod:HI (match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6131 + (match_operand:HI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6132 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6133 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6134 + emit_libcall_insns (HImode, "modhi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6135 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6136 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6137 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6138 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6139 +(define_expand "modqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6140 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6141 + (mod:QI (match_operand:QI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6142 + (match_operand:QI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6143 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6144 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6145 + emit_libcall_insns (QImode, "modqi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6146 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6147 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6148 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6149 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6150 +(define_expand "umodhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6151 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6152 + (umod:HI (match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6153 + (match_operand:HI 2 "register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6154 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6155 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6156 + emit_libcall_insns (HImode, "umodhi3", operands, 2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6157 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6158 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6159 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6160 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6161 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6162 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6163 +;;- and, or, xor common patterns
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6164 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6165 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6166 +; Split a bitwise HImode into two QImode instructions, with one of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6167 +; the sources in a pushable register. The register is pushed onto
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6168 +; the stack and memory pop operands (,s+) are used in the QI forms.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6169 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6170 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6171 + (match_operator:HI 3 "logical_bit_operator"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6172 + [(match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6173 + (match_operand:HI 2 "register_operand" "")]))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6174 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6175 + [(set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 2))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6176 + (set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6177 + [(reg:QI HARD_A_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6178 + (mem:QI (post_inc:QI (reg:HI HARD_S_REGNUM)))]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6179 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6180 + [(reg:QI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6181 + (mem:QI (post_inc:QI (reg:HI HARD_S_REGNUM)))]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6182 + (use (reg:QI HARD_A_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6183 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6184 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6185 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6186 +; Split a bitwise HImode into two QImode instructions, with one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6187 +; of the sources being a (MEM (MEM (...)); i.e. an indirect memory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6188 +; reference. This requires dereferencing the pointer into a
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6189 +; temporary register (X), which must be saved/restored around the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6190 +; compute instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6191 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6192 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6193 + (match_operator:HI 3 "logical_bit_operator"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6194 + [(match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6195 + (mem:HI (match_operand:HI 2 "memory_operand" ""))]))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6196 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6197 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6198 + (set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 4))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6199 + (set (match_dup 4) (match_dup 2))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6200 + (set (match_dup 4) (mem:HI (match_dup 4)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6201 + (set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6202 + [(reg:QI HARD_A_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6203 + (mem:QI (post_inc:QI (match_dup 4)))]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6204 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6205 + [(reg:QI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6206 + (mem:QI (post_inc:QI (match_dup 4)))]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6207 + (use (reg:QI HARD_A_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6208 + (set (match_dup 4) (mem:HI (post_inc:HI (reg:HI HARD_S_REGNUM))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6209 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6210 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6211 + /* Use X for a temporary index register */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6212 + operands[4] = gen_rtx_REG (HImode, HARD_X_REGNUM);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6213 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6214 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6215 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6216 +; Split a bitwise HImode into two QImode instructions. This is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6217 +; the common case. This handles splitting when neither of the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6218 +; above two cases applies.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6219 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6220 + [(set (match_operand:HI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6221 + (match_operator:HI 3 "logical_bit_operator"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6222 + [(match_operand:HI 1 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6223 + (match_operand:HI 2 "general_operand" "")]))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6224 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6225 + [(set (reg:QI HARD_A_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6226 + [(reg:QI HARD_A_REGNUM) (match_dup 4)]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6227 + (set (reg:QI HARD_D_REGNUM) (match_op_dup:QI 3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6228 + [(reg:QI HARD_D_REGNUM) (match_dup 5)]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6229 + (use (reg:QI HARD_A_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6230 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6231 + if (GET_CODE (operands[2]) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6232 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6233 + operands[4] = gen_rtx_const_high (operands[2]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6234 + operands[5] = gen_rtx_const_low (operands[2]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6235 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6236 + else if ((GET_CODE (operands[2]) == MEM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6237 + && (GET_CODE (XEXP (operands[2], 0)) == MEM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6238 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6239 + FAIL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6240 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6241 + else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6242 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6243 + operands[4] = gen_highpart (QImode, operands[2]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6244 + operands[5] = gen_lowpart (QImode, operands[2]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6245 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6246 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6247 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6248 +; Below are the specific cases for each of the operators.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6249 +; The QImode versions are the simplest and can be implemented
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6250 +; directly on the hardware. The HImode cases are all output
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6251 +; using one of the above splitting techniques.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6252 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6253 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6254 +;;- and
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6255 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6256 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6257 +(define_insn "andhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6258 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6259 + (and:HI (match_operand:HI 1 "register_operand" "%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6260 + (match_operand:HI 2 "general_operand" "mnU")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6261 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6262 + "#")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6263 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6264 +;; it is not clear that this is correct
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6265 +(define_insn "*andqi_2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6266 + [(set
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6267 + (match_operand:QI 0 "register_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6268 + (and:QI (match_operand:QI 1 "register_operand" "q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6269 + (match_operand 2 "const_int_operand" "i")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6270 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6271 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6272 + if (GET_CODE (operands[2]) == CONST_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6273 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6274 + operands[3] = GEN_INT(INTVAL(operands[2]) & 0xff);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6275 + return "and%0 %3";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6276 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6277 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6278 + return "and%0 %2";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6279 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6280 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6281 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6282 +(define_insn "andqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6283 + [(set (match_operand:QI 0 "register_operand" "=q,q,q,qc")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6284 + (and:QI (match_operand:QI 1 "whole_register_operand" "%0,0,0,0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6285 + (match_operand:QI 2 "whole_general_operand" " O,N,m,i")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6286 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6287 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6288 + clr%0\t;andqi(ZERO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6289 + \t;andqi(-1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6290 + and%0\t%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6291 + and%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6292 + [(set_attr "length" "1,0,3,2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6293 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6294 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6295 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6296 +;;- or
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6297 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6298 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6299 +(define_insn "iorhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6300 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6301 + (ior:HI (match_operand:HI 1 "register_operand" "%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6302 + (match_operand:HI 2 "general_operand" "mnU")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6303 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6304 + "#")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6305 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6306 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6307 +(define_insn "iorqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6308 + [(set (match_operand:QI 0 "register_operand" "=q,q, qc")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6309 + (ior:QI (match_operand:QI 1 "whole_register_operand" "%0,0, 0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6310 + (match_operand:QI 2 "whole_general_operand" " O,m,i")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6311 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6312 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6313 + \t;iorqi(ZERO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6314 + or%0\t%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6315 + or%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6316 + [(set_attr "length" "0,3,2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6317 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6318 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6319 +;;- xor
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6320 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6321 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6322 +(define_insn "xorhi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6323 + [(set (match_operand:HI 0 "register_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6324 + (xor:HI (match_operand:HI 1 "register_operand" "%0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6325 + (match_operand:HI 2 "general_operand" "mnU")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6326 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6327 + "#")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6328 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6329 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6330 +(define_insn "xorqi3"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6331 + [(set (match_operand:QI 0 "register_operand" "=q,q,q,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6332 + (xor:QI (match_operand:QI 1 "whole_register_operand" "%0,0,0,0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6333 + (match_operand:QI 2 "whole_general_operand" " O,N,m,i")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6334 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6335 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6336 + \t;xorqi(ZERO)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6337 + com%0\t;xorqi(-1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6338 + eor%0\t%2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6339 + eor%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6340 + [(set_attr "length" "0,1,3,2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6341 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6342 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6343 +;;- Two's Complements
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6344 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6345 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6346 +(define_insn "neghi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6347 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,!a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6348 + (neg:HI (match_operand:HI 1 "general_operand" "0, 0")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6349 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6350 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6351 + nega\;negb\;sbca\t#0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6352 + exg\td,%0\;nega\;negb\;sbca\t#0\;exg\td,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6353 + [(set_attr "length" "5,9")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6354 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6355 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6356 +(define_insn "negqi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6357 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6358 + (neg:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6359 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6360 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6361 + neg%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6362 + neg\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6363 + [(set_attr "length" "1,3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6364 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6365 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6366 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6367 +;;- One's Complements
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6368 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6369 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6370 +(define_insn "one_cmplhi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6371 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,?tm,???a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6372 + (not:HI (match_operand:HI 1 "general_operand" "0, 0, 0")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6373 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6374 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6375 + coma\;comb
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6376 + com\t%0\;com\t%L0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6377 + exg\td,%0\;coma\;comb\;exg\td,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6378 + [(set_attr "length" "2,6,6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6379 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6380 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6381 +(define_insn "one_cmplqi2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6382 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6383 + (not:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6384 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6385 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6386 + com%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6387 + com\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6388 + [(set_attr "length" "1,3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6389 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6390 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6391 +;;- Shifts/rotates
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6392 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6393 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6394 +(define_code_iterator bit_code [ashift ashiftrt lshiftrt])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6395 +(define_code_attr bit_code_name [(ashift "ashl") (ashiftrt "ashr") (lshiftrt "lshr")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6396 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6397 +(define_mode_iterator bit_mode [QI HI])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6398 +(define_mode_attr bit_mode_name [(QI "qi3") (HI "hi3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6399 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6400 +;; Emit RTL for any shift (handles all 3 opcodes and 2 mode sizes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6401 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6402 +(define_expand "<bit_code:bit_code_name><bit_mode:bit_mode_name>"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6403 + [(set (match_operand:bit_mode 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6404 + (bit_code:bit_mode (match_operand:bit_mode 1 "general_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6405 + (match_operand:bit_mode 2 "nonmemory_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6406 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6407 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6408 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6409 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6410 +; Individual instructions implemented in the CPU.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6411 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6412 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6413 +(define_insn "*ashift1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6414 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6415 + (ashift:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6416 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6417 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6418 + asl\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6419 + asl%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6420 + [(set_attr "length" "3,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6421 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6422 +(define_insn "*lshiftrt1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6423 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6424 + (lshiftrt:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6425 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6426 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6427 + lsr\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6428 + lsr%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6429 + [(set_attr "length" "3,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6430 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6431 +(define_insn "*ashiftrt1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6432 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6433 + (ashiftrt:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6434 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6435 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6436 + asr\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6437 + asr%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6438 + [(set_attr "length" "3,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6439 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6440 +(define_insn "*rotate1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6441 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6442 + (rotate:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6443 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6444 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6445 + rol\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6446 + rol%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6447 + [(set_attr "length" "3,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6448 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6449 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6450 +(define_insn "*rotatert1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6451 + [(set (match_operand:QI 0 "nonimmediate_operand" "=m,q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6452 + (rotatert:QI (match_operand:QI 1 "general_operand" "0,0") (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6453 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6454 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6455 + ror\t%0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6456 + ror%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6457 + [(set_attr "length" "3,1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6458 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6459 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6460 +; A shift by 8 for D reg can be optimized by just moving
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6461 +; between the A/B halves, and then zero/sign extending or
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6462 +; filling in zeroes.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6463 +; Because GCC does not understand that 'A' and 'D' refer to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6464 +; the same storage location, we must use 'USE' throughout
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6465 +; to prevent deletion of 'unnecessary' instructions.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6466 +; Similar optimization for MEM would require a scratch register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6467 +; so is not done here.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6468 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6469 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6470 + [(set (reg:HI HARD_D_REGNUM) (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6471 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6472 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6473 + (use (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6474 + (set (reg:QI HARD_A_REGNUM) (reg:QI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6475 + (use (reg:QI HARD_A_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6476 + (set (reg:QI HARD_D_REGNUM) (const_int 0))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6477 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6478 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6479 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6480 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6481 + [(set (reg:HI HARD_D_REGNUM) (lshiftrt:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6482 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6483 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6484 + (use (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6485 + (set (reg:QI HARD_D_REGNUM) (reg:QI HARD_A_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6486 + (use (reg:QI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6487 + (set (reg:HI HARD_D_REGNUM) (zero_extend:HI (reg:QI HARD_D_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6488 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6489 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6490 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6491 +(define_split
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6492 + [(set (reg:HI HARD_D_REGNUM) (ashiftrt:HI (reg:HI HARD_D_REGNUM) (const_int 8)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6493 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6494 + [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6495 + (use (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6496 + (set (reg:QI HARD_D_REGNUM) (reg:QI HARD_A_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6497 + (use (reg:QI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6498 + (set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6499 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6500 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6501 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6502 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6503 +; On the WPC hardware, there is a shift register that can be used
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6504 +; to compute (1<<n) efficiently in two instructions. Note that this
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6505 +; form only works when using -mint8 though, because C will promote
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6506 +; to 'int' when doing this operation. TODO : we need a 16-bit form too.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6507 +(define_insn "ashlqi3_wpc"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6508 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6509 + (ashift:QI (match_operand:QI 1 "immediate_operand" "I")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6510 + (match_operand:QI 2 "general_operand" "q")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6511 + "TARGET_WPC"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6512 + "st%2\t0x3FF7\;ld%0\t0x3FF7"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6513 + [(set_attr "length" "6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6514 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6515 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6516 +; Internal instructions for shifting by a constant.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6517 +; Two forms are provided, one for QImode, one for HImode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6518 +; These are always split into the above instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6519 +; (except for QImode forms that directly match one of the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6520 +; above instructions, in which the condition will not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6521 +; allow the splitter to match).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6522 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6523 +(define_insn_and_split "<bit_code:bit_code_name>hi3_const"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6524 + [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6525 + (bit_code:HI (match_operand:HI 1 "general_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6526 + (match_operand:HI 2 "immediate_operand" "n")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6527 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6528 + "#"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6529 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6530 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6531 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6532 + m6809_split_shift (<bit_code:CODE>, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6533 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6534 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6535 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6536 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6537 +(define_insn_and_split "<bit_code:bit_code_name>qi3_const"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6538 + [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6539 + (bit_code:QI (match_operand:QI 1 "general_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6540 + (match_operand:QI 2 "immediate_operand" "n")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6541 + "INTVAL (operands[2]) > 1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6542 + "#"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6543 + "&& reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6544 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6545 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6546 + m6809_split_shift (<bit_code:CODE>, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6547 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6548 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6549 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6550 +; Internal instructions for shifting by a nonconstant.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6551 +; These expand into complex assembly.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6552 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6553 +(define_insn "<bit_code:bit_code_name>hi3_reg"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6554 + [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6555 + (bit_code:HI (match_operand:HI 1 "general_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6556 + (match_operand:HI 2 "nonimmediate_operand" "v")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6557 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6558 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6559 + m6809_output_shift_insn (<bit_code:CODE>, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6560 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6561 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6562 + [(set_attr "length" "20")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6563 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6564 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6565 +(define_insn "<bit_code:bit_code_name>qi3_reg"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6566 + [(set (match_operand:QI 0 "nonimmediate_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6567 + (bit_code:QI (match_operand:QI 1 "general_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6568 + (match_operand:QI 2 "nonimmediate_operand" "v")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6569 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6570 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6571 + m6809_output_shift_insn (<bit_code:CODE>, operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6572 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6573 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6574 + [(set_attr "length" "16")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6575 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6576 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6577 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6578 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6579 +;;- Jumps and transfers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6580 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6581 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6582 +;;; The casesi pattern is normally *not* defined; see 'tablejump' instead.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6583 +(define_expand "casesi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6584 + [(match_operand:HI 0 "register_operand" "") ; index to jump on
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6585 + (match_operand:HI 1 "immediate_operand" "") ; lower bound
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6586 + (match_operand:HI 2 "immediate_operand" "") ; total range
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6587 + (match_operand 3 "" "") ; table label
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6588 + (match_operand 4 "" "")] ; out of range label
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6589 + "TARGET_BYTE_INT && TARGET_CASESI"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6590 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6591 + m6809_do_casesi (operands[0], operands[1], operands[2],
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6592 + operands[3], operands[4]);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6593 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6594 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6595 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6596 +(define_insn "tablejump_short_offset"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6597 + [(set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6598 + (mem:HI (plus:HI (match_operand:HI 1 "register_operand" "U")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6599 + (zero_extend:HI (match_operand:QI 0 "register_operand" "q")))))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6600 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6601 + "jmp\t[b,x]\t;tablejump_short_offset"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6602 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6603 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6604 +(define_insn "tablejump_long_offset"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6605 + [(set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6606 + (mem:HI (plus:HI (match_operand:HI 1 "register_operand" "U")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6607 + (match_operand:HI 0 "register_operand" "d"))))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6608 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6609 + "jmp\t[d,x]\t;tablejump_long_offset"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6610 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6611 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6612 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6613 + ;; A tablejump operation gives the address in operand 0, with the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6614 + ;; CODE_LABEL for the table in operand 1. The 'define_expand'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6615 + ;; shows the arguments as GCC presents them. For a register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6616 + ;; operand, the assembly code is straightforward. For a MEM,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6617 + ;; assumed to be a SYMBOL_REF, two forms are given, one normal
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6618 + ;; and one for PIC mode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6619 + (define_expand "tablejump"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6620 + [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6621 + (set (pc) (match_operand:HI 0 "" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6622 + (use (label_ref (match_operand 1 "" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6623 + (clobber (match_scratch:HI 2 ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6624 + ])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6625 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6626 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6627 + })
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6628 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6629 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6630 +(define_insn "*tablejump_reg"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6631 + [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6632 + (set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6633 + (match_operand:HI 0 "register_operand" "a"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6634 + (use (label_ref (match_operand 1 "" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6635 + (clobber (match_scratch:HI 2 ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6636 + ])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6637 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6638 + "jmp\t,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6639 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6640 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6641 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6642 +(define_insn "*tablejump_symbol"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6643 + [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6644 + (set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6645 + (mem:HI
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6646 + (plus:HI (match_operand:HI 0 "register_operand" "a")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6647 + (label_ref (match_operand 1 "" "")))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6648 + (use (label_ref (match_dup 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6649 + (clobber (match_scratch:HI 2 ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6650 + ])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6651 + "!flag_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6652 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6653 + output_asm_insn ("jmp\t[%a1,%0]", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6654 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6655 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6656 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6657 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6658 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6659 +(define_insn "*tablejump_symbol_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6660 + [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6661 + (set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6662 + (mem:HI
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6663 + (plus:HI (match_operand:HI 0 "register_operand" "d")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6664 + (label_ref (match_operand 1 "" "")))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6665 + (use (label_ref (match_dup 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6666 + (clobber (match_scratch:HI 2 "=&a"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6667 + ])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6668 + "flag_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6669 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6670 + output_asm_insn ("lea%2\t%a1,pcr", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6671 + output_asm_insn ("ld%0\t%0,%2", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6672 + output_asm_insn ("jmp\t%0,%2", operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6673 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6674 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6675 + [(set_attr "length" "8")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6676 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6677 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6678 +(define_insn "indirect_jump"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6679 + [(set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6680 + (match_operand:HI 0 "register_operand" "a"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6681 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6682 + "jmp\t,%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6683 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6684 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6685 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6686 +(define_insn "jump"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6687 + [(set (pc) (label_ref (match_operand 0 "" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6688 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6689 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6690 + return output_branch_insn ( LABEL_REF, operands, get_attr_length (insn));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6691 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6692 + [(set (attr "type") (const_string "branch"))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6693 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6694 +; Output assembly for a condition branch instruction.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6695 +(define_insn "*cond_branch"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6696 + [(set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6697 + (if_then_else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6698 + (match_operator 1 "comparison_operator" [(cc0) (const_int 0)])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6699 + (label_ref (match_operand 0 "" "")) (pc)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6700 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6701 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6702 + return output_branch_insn ( GET_CODE(operands[1]),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6703 + operands, get_attr_length (insn));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6704 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6705 + [(set (attr "type") (const_string "cbranch"))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6706 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6707 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6708 +; Similar to above, but for a condition branch instruction that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6709 +; had its operands reversed at some point.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6710 +(define_insn "*cond_branch_reverse"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6711 + [(set (pc)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6712 + (if_then_else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6713 + (match_operator 1 "comparison_operator" [(cc0) (const_int 0)])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6714 + (pc) (label_ref (match_operand 0 "" ""))))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6715 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6716 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6717 + return output_branch_insn ( reverse_condition (GET_CODE(operands[1])),
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6718 + operands, get_attr_length (insn));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6719 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6720 + [(set (attr "type") (const_string "cbranch"))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6721 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6722 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6723 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6724 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6725 +;;- Calls
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6726 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6727 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6728 +;; Generate a call instruction for a function that does not
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6729 +;; return a value. The expander is used during RTL generation.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6730 +;; The instructions below are used during matching; only one
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6731 +;; of them will be used, depending on the type of function
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6732 +;; being called. The different conditions are:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6733 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6734 +;; 1) far_functionp - is this a far function? Those need
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6735 +;; to be output as indirect calls through a far-function
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6736 +;; handler.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6737 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6738 +;; 2) noreturn_functionp - if the function does not return,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6739 +;; we can use a 'jmp' instead of a 'jsr' to call it.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6740 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6741 +;; 3) is PIC mode enabled? If so, we'll always use
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6742 +;; relative calls (lbsr or lbra).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6743 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6744 +;; Note: not all combinations are fully supported, especially
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6745 +;; relating to PIC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6746 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6747 +;; The 'bsr' instruction is never generated.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6748 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6749 +(define_expand "call"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6750 + [(call (match_operand:HI 0 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6751 + (match_operand:HI 1 "general_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6752 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6753 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6754 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6755 +(define_insn "*call_nopic_far"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6756 + [(call (match_operand:HI 0 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6757 + (match_operand:HI 1 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6758 + "far_functionp (operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6759 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6760 + output_far_call_insn (operands, 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6761 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6762 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6763 + [(set_attr "length" "6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6764 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6765 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6766 +; PIC forms come first, and should only match
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6767 +; (MEM (SYMBOL_REF)). Other MEM forms are treated as usual.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6768 +(define_insn "*call_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6769 + [(call (mem:HI (match_operand:HI 0 "symbolic_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6770 + (match_operand:HI 1 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6771 + "flag_pic && !noreturn_functionp (operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6772 + "lbsr\t%C0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6773 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6774 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6775 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6776 +(define_insn "*call_nopic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6777 + [(call (match_operand:HI 0 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6778 + (match_operand:HI 1 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6779 + "!noreturn_functionp (operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6780 + "jsr\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6781 + [(set_attr "length" "3")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6782 + (set (attr "cycles") (const_int JSR_EXTENDED_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6783 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6784 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6785 +(define_insn "*call_noreturn_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6786 + [(call (mem:HI (match_operand:HI 0 "symbolic_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6787 + (match_operand:HI 1 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6788 + "flag_pic && noreturn_functionp (operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6789 + "lbra\t%C0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6790 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6791 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6792 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6793 +(define_insn "*call_noreturn_nopic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6794 + [(call (match_operand:HI 0 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6795 + (match_operand:HI 1 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6796 + "noreturn_functionp (operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6797 + "jmp\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6798 + [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6799 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6800 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6801 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6802 +;; Same as above, but for functions that do return a value.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6803 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6804 +(define_expand "call_value"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6805 + [(set (match_operand 0 "" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6806 + (call (match_operand:HI 1 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6807 + (match_operand:HI 2 "general_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6808 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6809 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6810 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6811 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6812 +(define_insn "*call_value_far"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6813 + [(set (match_operand 0 "" "=gz")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6814 + (call (match_operand:HI 1 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6815 + (match_operand:HI 2 "general_operand" "g")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6816 + "far_functionp (operands[1])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6817 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6818 + output_far_call_insn (operands, 1);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6819 + return "";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6820 +}
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6821 + [(set_attr "length" "6")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6822 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6823 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6824 +(define_insn "*call_value_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6825 + [(set (match_operand 0 "" "=gz")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6826 + (call (mem:HI (match_operand:HI 1 "symbolic_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6827 + (match_operand:HI 2 "general_operand" "g")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6828 + "flag_pic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6829 + "lbsr\t%C1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6830 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6831 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6832 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6833 +(define_insn "*call_value_nopic"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6834 + [(set (match_operand 0 "" "=gz")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6835 + (call (match_operand:HI 1 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6836 + (match_operand:HI 2 "general_operand" "g")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6837 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6838 + "jsr\t%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6839 + [(set_attr "length" "3")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6840 + (set (attr "cycles") (const_int JSR_EXTENDED_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6841 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6842 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6843 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6844 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6845 +;; How to generate an untyped call.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6846 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6847 +(define_expand "untyped_call"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6848 + [(parallel [(call (match_operand 0 "" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6849 + (const_int 0))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6850 + (match_operand 1 "" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6851 + (match_operand 2 "" "")])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6852 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6853 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6854 + int i;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6855 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6856 + emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6857 + for (i=0; i < XVECLEN (operands[2], 0); i++)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6858 + {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6859 + rtx set = XVECEXP (operands[2], 0, i);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6860 + emit_move_insn (SET_DEST (set), SET_SRC (set));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6861 + }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6862 + emit_insn (gen_blockage ());
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6863 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6864 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6865 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6866 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6867 +(define_expand "sibcall"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6868 + [(parallel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6869 + [(call (match_operand:HI 0 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6870 + (match_operand:HI 1 "immediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6871 + (use (reg:HI HARD_PC_REGNUM))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6872 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6873 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6874 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6875 +(define_insn "*sibcall_1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6876 + [(parallel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6877 + [(call (match_operand:HI 0 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6878 + (match_operand:HI 1 "immediate_operand" "i"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6879 + (use (reg:HI HARD_PC_REGNUM))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6880 + "SIBLING_CALL_P(insn)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6881 + "jmp\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6882 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6883 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6884 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6885 +(define_expand "sibcall_value"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6886 + [(parallel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6887 + [(set (match_operand 0 "" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6888 + (call (match_operand:HI 1 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6889 + (match_operand:HI 2 "immediate_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6890 + (use (reg:HI HARD_PC_REGNUM))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6891 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6892 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6893 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6894 +(define_insn "*sibcall_value_1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6895 + [(parallel
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6896 + [(set (match_operand 0 "" "=gz")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6897 + (call (match_operand:HI 1 "memory_operand" "m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6898 + (match_operand:HI 2 "immediate_operand" "i")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6899 + (use (reg:HI HARD_PC_REGNUM))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6900 + "SIBLING_CALL_P(insn)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6901 + "jmp\t%1"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6902 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6903 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6904 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6905 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6906 +;;- Function Entry and Exit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6907 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6908 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6909 +;; On entry to a function, the stack frame looks as follows:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6910 +;; - return address (pushed by the caller)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6911 +;; - saved registers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6912 +;; - local variable storage
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6913 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6914 +;; If the function does not modify the stack after that, then
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6915 +;; any of these can be accessed directly as an offset from
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6916 +;; STACK_POINTER_REGNUM. Otherwise, a frame pointer is required.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6917 +;; In that case, the prologue must also initialize HARD_FRAME_POINTER_REGNUM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6918 +;; and all references to the stack frame will use that as a base instead.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6919 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6920 +(define_expand "prologue"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6921 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6922 + "prologue_epilogue_required ()"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6923 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6924 + emit_prologue_insns ();
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6925 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6926 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6927 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6928 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6929 +;; The function epilogue does exactly the reverse of the prologue,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6930 +;; deallocating local variable space, restoring saved registers,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6931 +;; and returning.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6932 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6933 +;; For the 6809, the return may be 'rti' if the function was
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6934 +;; declared as an interrupt function, but is normally 'rts'.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6935 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6936 +;; Also, as an optimization, the register restore and the 'rts'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6937 +;; can be combined into a single instruction, by adding 'PC' to the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6938 +;; list of registers to be restored. This is only done if there are
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6939 +;; any saved registers, as 'rts' is more efficient by itself.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6940 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6941 +(define_expand "epilogue"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6942 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6943 + "prologue_epilogue_required ()"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6944 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6945 + emit_epilogue_insns (false);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6946 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6947 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6948 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6949 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6950 +(define_expand "sibcall_epilogue"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6951 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6952 + "prologue_epilogue_required ()"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6953 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6954 + emit_epilogue_insns (true);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6955 + DONE;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6956 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6957 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6958 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6959 +;; The RTS instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6960 +(define_insn "return_rts"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6961 + [(return)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6962 + (use (reg:HI HARD_PC_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6963 + "!m6809_current_function_has_type_attr_p (\"interrupt\")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6964 + && m6809_get_live_regs () == 0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6965 + "rts"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6966 + [(set_attr "length" "1")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6967 + (set (attr "cycles") (const_int RTS_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6968 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6969 +(define_insn "return_puls_pc"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6970 + [(return)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6971 + (use (reg:HI HARD_PC_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6972 + "!m6809_current_function_has_type_attr_p (\"interrupt\")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6973 + && m6809_get_live_regs () != 0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6974 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6975 + [(set_attr "length" "1")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6976 + (set (attr "cycles") (const_int RTS_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6977 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6978 +;; The RTI instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6979 +(define_insn "return_rti"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6980 + [(return)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6981 + (use (reg:HI HARD_PC_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6982 + "m6809_current_function_has_type_attr_p (\"interrupt\")"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6983 + "rti"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6984 + [(set_attr "length" "1")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6985 + (set (attr "cycles") (const_int RTI_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6986 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6987 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6988 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6989 +;;- Unspecified instructions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6990 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6991 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6992 +;; An instruction that has the effect of an unspec_volatile, but
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6993 +;; which doesn't require emitting any assembly code.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6994 +(define_insn "blockage"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6995 + [(unspec_volatile [(const_int 0)] UNSPEC_BLOCKAGE)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6996 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6997 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6998 + [(set_attr "length" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
6999 + (set (attr "cycles") (const_int 0))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7000 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7001 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7002 +;; Say how to push multiple registers onto the stack, using
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7003 +;; the 6809 'pshs' instruction. The operand is a regset
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7004 +;; specifying which registers to push.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7005 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7006 +;; The operand mode is not given intentionally, so as to allow
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7007 +;; any possible integer mode for the regset.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7008 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7009 +;; See below for a peephole that can combine consecutive push
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7010 +;; instructions that qualify for merging.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7011 +(define_insn "register_push"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7012 + [(use (reg:HI HARD_S_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7013 + (unspec_volatile
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7014 + [(match_operand 0 "immediate_operand" "")] UNSPEC_PUSH_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7015 + (clobber (reg:HI HARD_S_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7016 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7017 + "pshs\t%R0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7018 + [(set_attr "length" "2")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7019 + (set (attr "cycles") (const_int PSH_PUL_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7020 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7021 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7022 +;; Say how to pop multiple registers from the stack, using
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7023 +;; the 6809 'puls' instruction. The operand is the register
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7024 +;; bitset value.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7025 +(define_insn "register_pop"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7026 + [(use (reg:HI HARD_S_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7027 + (unspec_volatile
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7028 + [(match_operand 0 "immediate_operand" "")] UNSPEC_POP_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7029 + (clobber (reg:HI HARD_S_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7030 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7031 + "puls\t%R0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7032 + [(set_attr "length" "2")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7033 + (set (attr "cycles") (const_int PSH_PUL_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7034 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7035 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7036 +(define_insn "m6809_swi"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7037 + [(unspec_volatile
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7038 + [(match_operand:QI 0 "immediate_operand" "I,n")] UNSPEC_SWI)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7039 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7040 + "@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7041 + swi
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7042 + swi%c0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7043 + [(set_attr "length" "1,2")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7044 + (set (attr "cycles") (const_int SWI_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7045 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7046 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7047 +;; Generate the CWAI instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7048 +(define_insn "m6809_cwai"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7049 + [(unspec_volatile
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7050 + [(match_operand:QI 0 "immediate_operand" "")] UNSPEC_CWAI)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7051 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7052 + "cwai\t%0"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7053 + [(set_attr "length" "2")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7054 + (set (attr "cycles") (const_int CWAI_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7055 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7056 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7057 +;; Generate the SYNC instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7058 +(define_insn "m6809_sync"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7059 + [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7060 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7061 + "sync"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7062 + [(set_attr "length" "1")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7063 + (set (attr "cycles") (const_int SYNC_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7064 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7065 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7066 +;; Generate the NOP instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7067 +(define_insn "nop"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7068 + [(const_int 0)]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7069 + ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7070 + "nop"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7071 + [(set_attr "length" "1")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7072 + (set (attr "cycles") (const_int NOP_CYCLES))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7073 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7074 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7075 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7076 +;;- Peepholes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7077 +;;--------------------------------------------------------------------
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7078 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7079 +;;; Each peephole has an ID that is used for debugging.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7080 +;;; Each peephole condition is bracketed by calls to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7081 +;;; m6809_match_peephole2() also for debugging.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7082 +(define_constants [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7083 + (PEEP_END 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7084 + (PEEP_COND 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7085 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7086 + (PEEP_STACK_STORE_INC 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7087 + (PEEP_STACK_CLEAR_INC 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7088 + (PEEP_LSRB_ADCB 2)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7089 + (PEEP_ABX 3)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7090 + (PEEP_ABX2 4)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7091 + (PEEP_INDEXED_INC 5)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7092 + (PEEP_MEM_DEC 6)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7093 + (PEEP_MEM_INC 7)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7094 + (PEEP_MEM_DEC_CMP 8)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7095 + (PEEP_PUSH2 9)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7096 + (PEEP_STORE_IMPLIES_CC 10)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7097 + (PEEP_DEC_IMPLIES_CC 11)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7098 + (PEEP_LEAB 12)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7099 + (PEEP_LDX_INDIRECT 13)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7100 + (PEEP_POP_JUNK 14)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7101 +])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7102 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7103 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7104 +;;; Optimize 'leas -1,s' followed by 'stb ,s'. This can happen if the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7105 +;;; function prologue needs to allocate stack space and 'b' is placed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7106 +;;; into that local right away. Combine the stack allocation with the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7107 +;;; store using preincrement mode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7108 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7109 + [(set (reg:HI HARD_S_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7110 + (plus:HI (reg:HI HARD_S_REGNUM) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7111 + (set (mem:QI (reg:HI HARD_S_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7112 + (match_operand:QI 0 "register_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7113 + "m6809_match_peephole2 (PEEP_STACK_STORE_INC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7114 + [(set (mem:QI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7115 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7116 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7117 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7118 +;;; Same as above, but for a 'clr ,s' that follows the prologue.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7119 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7120 + [(set (reg:HI HARD_S_REGNUM) (plus:HI (reg:HI HARD_S_REGNUM) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7121 + (set (mem:QI (reg:HI HARD_S_REGNUM)) (const_int 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7122 + "m6809_match_peephole2 (PEEP_STACK_CLEAR_INC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7123 + [(set (mem:QI (pre_dec:HI (reg:HI HARD_S_REGNUM))) (const_int 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7124 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7125 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7126 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7127 +;;; Merge two consecutive push instructions into a single register_push.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7128 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7129 + [(set (match_operand 0 "push_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7130 + (match_operand 1 "register_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7131 + (set (match_operand 2 "push_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7132 + (match_operand 3 "register_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7133 + "m6809_match_peephole2 (PEEP_PUSH2, PEEP_COND)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7134 + && reload_completed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7135 + && GET_MODE (operands[1]) == GET_MODE (operands[3])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7136 + && m6809_can_merge_pushpop_p (UNSPEC_PUSH_RS, 1 << REGNO (operands[1]), 1 << REGNO (operands[3]))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7137 + && m6809_match_peephole2 (PEEP_PUSH2, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7138 + [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7139 + (use (reg:HI HARD_S_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7140 + (unspec_volatile [(match_dup 4)] UNSPEC_PUSH_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7141 + (clobber (reg:HI HARD_S_REGNUM))])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7142 + (use (match_dup 1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7143 + (use (match_dup 3))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7144 +{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7145 + operands[4] = gen_rtx_CONST_INT (QImode,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7146 + (1 << REGNO (operands[1])) | (1 << REGNO (operands[3])));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7147 +})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7148 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7149 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7150 +;;; Convert 'stX ,--s' into a push instruction. Use the regset
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7151 +;;; notation, so that it may be combined with an adjacent regset.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7152 +;;; TBD - this doesn't compile some code cleanly.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7153 +;(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7154 +; [(set (mem:HI (pre_dec:HI (reg:HI HARD_S_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7155 +; (reg:HI HARD_X_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7156 +; "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7157 +; [(parallel [
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7158 +; (use (reg:HI HARD_S_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7159 +; (unspec_volatile [(match_dup 0)] UNSPEC_PUSH_RS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7160 +; (clobber (reg:HI HARD_S_REGNUM))])]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7161 +;{
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7162 +; operands[0] = gen_rtx_CONST_INT (HImode, X_REGBIT);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7163 +;})
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7164 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7165 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7166 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7167 +;;; q = (q+1)/2 can be optimized as "lsrb; adcb". This also
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7168 +;;; won't overflow when q=0xFF.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7169 +;;; TODO : this form isn't accounting for promotion when
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7170 +;;; using 16-bit ints.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7171 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7172 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7173 + [(set (reg:QI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7174 + (lshiftrt:QI (plus:HI (match_dup 0) (const_int 1)) (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7175 + "m6809_match_peephole2 (PEEP_LSRB_ADCB, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7176 + "lsrb\;adcb\t#0; peephole"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7177 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7178 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7179 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7180 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7181 +;; Optimize the case of following a register store with a test
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7182 +;; of reg or mem just moved.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7183 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7184 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7185 + [(set (match_operand:HI 0 "memory_operand" "=m")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7186 + (match_operand:HI 1 "register_operand" "r"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7187 + (set (cc0) (match_operand:HI 2 "general_operand" "g"))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7188 + "m6809_match_peephole2 (PEEP_STORE_IMPLIES_CC, PEEP_COND)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7189 + && (operands[2] == operands[0] || operands[2] == operands[1])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7190 + && m6809_match_peephole2 (PEEP_STORE_IMPLIES_CC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7191 + "st%1\t%0\t;movhi: R:%1 -> %0 w/ implied test of %2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7192 + [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7193 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7194 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7195 +;; Optimize a pair of SET instructions in which the second insn
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7196 +;; is the reverse of the first one. I.e.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7197 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7198 +;; A = B
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7199 +;; ----> A = B
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7200 +;; B = A
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7201 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7202 +;; The second insn is redundant. Define two patterns, one for QI, one for HI.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7203 +;; But don't do this if either is a VOLATILE MEM.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7204 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7205 + [(set (match_operand:HI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7206 + (match_operand:HI 1 "nonimmediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7207 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7208 + "!MEM_P (operands[0]) || !MEM_P (operands[1]) || (!MEM_VOLATILE_P (operands[0]) && !MEM_VOLATILE_P (operands[1]))"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7209 + [(set (match_dup 0) (match_dup 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7210 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7211 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7212 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7213 + [(set (match_operand:QI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7214 + (match_operand:QI 1 "nonimmediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7215 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7216 + "!MEM_P (operands[0]) || !MEM_P (operands[1]) || (!MEM_VOLATILE_P (operands[0]) && !MEM_VOLATILE_P (operands[1]))"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7217 + [(set (match_dup 0) (match_dup 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7218 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7219 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7220 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7221 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7222 +;; Optimize the sum of an 8-bit and 16-bit using the 'abx' instruction
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7223 +;; if B and X can be used. Two patterns are provided to catch both
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7224 +;; X=X+D and X=D+X.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7225 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7226 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7227 + [(set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7228 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7229 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7230 + (plus:HI (reg:HI HARD_D_REGNUM) (reg:HI HARD_X_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7231 + "m6809_match_peephole2 (PEEP_ABX, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7232 + "abx"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7233 + [(set_attr "length" "1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7234 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7235 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7236 + [(set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7237 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7238 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7239 + (plus:HI (reg:HI HARD_X_REGNUM) (reg:HI HARD_D_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7240 + "m6809_match_peephole2 (PEEP_ABX, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7241 + "abx"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7242 + [(set_attr "length" "1")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7243 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7244 +;;; Likewise, handle when B is scaled by 2 prior to the add.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7245 +;;; Instead of shifting B in 4 cycles, just do the ABX a second
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7246 +;;; time, in only 3 cycles.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7247 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7248 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7249 + [(set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7250 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7251 + (set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7252 + (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7253 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7254 + (plus:HI (reg:HI HARD_D_REGNUM) (reg:HI HARD_X_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7255 + "m6809_match_peephole2 (PEEP_ABX2, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7256 + "abx\;abx"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7257 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7258 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7259 +(define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7260 + [(set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7261 + (zero_extend:HI (match_operand:QI 0 "general_operand" "q")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7262 + (set (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7263 + (ashift:HI (reg:HI HARD_D_REGNUM) (const_int 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7264 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7265 + (plus:HI (reg:HI HARD_X_REGNUM) (reg:HI HARD_D_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7266 + "m6809_match_peephole2 (PEEP_ABX2, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7267 + "abx\;abx"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7268 + [(set_attr "length" "2")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7269 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7270 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7271 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7272 +;; Work around a compiler bug that generates bad code when copying
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7273 +;; between 32-bit memory addresses after a libcall. The problem seen is
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7274 +;; that the source is MEM (REG X), but X is used as the reload register.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7275 +;; The second half of the copy therefore fails.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7276 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7277 +;; The solution is to switch the reload register to D, since that is guaranteed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7278 +;; not to be in use right after a libcall.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7279 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7280 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7281 + [(set (reg:HI HARD_X_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7282 + (set (match_operand:HI 0 "nonimmediate_operand" "") (reg:HI HARD_X_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7283 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7284 + (mem:HI (plus:HI (reg:HI HARD_X_REGNUM) (const_int 2))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7285 + (set (match_operand:HI 1 "nonimmediate_operand" "") (reg:HI HARD_X_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7286 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7287 + [(set (reg:HI HARD_D_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7288 + (set (match_dup 0) (reg:HI HARD_D_REGNUM))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7289 + (set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7290 + (mem:HI (plus:HI (reg:HI HARD_X_REGNUM) (const_int 2))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7291 + (set (match_dup 1) (reg:HI HARD_X_REGNUM))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7292 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7293 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7294 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7295 +;; Turn "and then test" into a "bit test" operation.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7296 +;; Provide variants for immediate and memory sources
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7297 +;; This is the most used peephople.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7298 +; (define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7299 +; [(set (match_operand:QI 0 "register_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7300 +; (and:QI (match_operand:QI 1 "register_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7301 +; (match_operand:QI 2 "immediate_operand" "i")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7302 +; (set (cc0) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7303 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7304 +; "bit%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7305 +; [(set_attr "length" "3")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7306 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7307 +; (define_peephole
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7308 +; [(set (match_operand:QI 0 "register_operand" "=q")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7309 +; (and:QI (match_operand:QI 1 "register_operand" "0")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7310 +; (match_operand:QI 2 "memory_operand" "m")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7311 +; (set (cc0) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7312 +; ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7313 +; "bit%0\t%2"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7314 +; [(set_attr "length" "4")])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7315 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7316 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7317 +;; Turn a "decrement, then test" sequence into just a "decrement".
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7318 +;; The test can be omitted, since it is implicitly done.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7319 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7320 + [(set (match_operand:QI 0 "nonimmediate_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7321 + (plus:QI (match_operand:QI 1 "whole_general_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7322 + (match_operand:QI 2 "immediate_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7323 + (set (cc0) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7324 + "m6809_match_peephole2 (PEEP_DEC_IMPLIES_CC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7325 + [(set (match_dup 0) (plus:QI (match_dup 1) (match_dup 2)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7326 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7327 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7328 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7329 +;; Merge an indexed register increment with a previous usage.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7330 +;; This is usually done automatically, but not always
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7331 +;; The 'use' should be optional; in all cases where this has been
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7332 +;; seen, it is required though.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7333 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7334 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7335 + (mem:QI (match_operand:HI 1 "index_register_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7336 + (use (match_dup 0))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7337 + (set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7338 + "m6809_match_peephole2 (PEEP_INDEXED_INC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7339 + [(set (match_dup 0) (mem:QI (post_inc:HI (match_dup 1))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7340 + (use (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7341 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7342 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7343 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7344 +;;; Merge "ldX MEM; ldX ,X" into a single instruction using
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7345 +;;; the indirect mode.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7346 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7347 + [(set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7348 + (mem:HI (match_operand:HI 0 "general_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7349 + (set (reg:HI HARD_X_REGNUM) (mem:HI (reg:HI HARD_X_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7350 + "reload_completed && m6809_match_peephole2 (PEEP_LDX_INDIRECT, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7351 + [(set (reg:HI HARD_X_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7352 + (mem:HI (mem:HI (match_dup 0))))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7353 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7354 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7355 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7356 +;;; Reorder a store followed by a unary operation on that memory
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7357 +;;; so that the unary is performed and then the store. Consider
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7358 +;;; a binary shift operation, which will be decomposed into
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7359 +;;; identical single shifts, also.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7360 +;;; TODO - recognize more than just 'ashift' here.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7361 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7362 + [(set (match_operand:QI 0 "memory_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7363 + (match_operand:QI 1 "register_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7364 + (set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7365 + (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7366 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7367 + [(set (match_dup 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7368 + (ashift:QI (match_dup 1) (match_operand:QI 2 "immediate_operand")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7369 + (set (match_dup 0) (match_dup 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7370 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7371 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7372 +;;; Likewise, reorder a unary MEM followed by a load, so that the load
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7373 +;;; is done first, then use the REG instead of the MEM.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7374 +;;;(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7375 +;;; [(set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7376 +;;; (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7377 +;;; (set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7378 +;;; (match_operand:QI 1 "memory_operand" ""))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7379 +;;; "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7380 +;;; [(set (match_dup 0) (match_dup 1))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7381 +;;; (set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7382 +;;; (ashift:QI (match_dup 0) (match_operand:QI 2 "immediate_operand")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7383 +;;; "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7384 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7385 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7386 +;;; Replace sex; leaX d,Y with leaX b,Y.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7387 +;;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7388 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7389 + [(set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7390 + (set (match_operand:HI 0 "index_register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7391 + (plus:HI (match_operand:HI 1 "index_register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7392 + (reg:HI HARD_D_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7393 + "reload_completed && m6809_match_peephole2 (PEEP_LEAB, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7394 + [(set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7395 + (plus:HI (match_dup 1) (reg:QI HARD_D_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7396 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7397 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7398 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7399 + [(set (reg:HI HARD_D_REGNUM) (sign_extend:HI (reg:QI HARD_D_REGNUM)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7400 + (set (match_operand:HI 0 "index_register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7401 + (plus:HI (reg:HI HARD_D_REGNUM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7402 + (match_operand:HI 1 "index_register_operand" "")))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7403 + "reload_completed && m6809_match_peephole2 (PEEP_LEAB, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7404 + [(set (match_dup 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7405 + (plus:HI (match_dup 1) (reg:QI HARD_D_REGNUM)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7406 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7407 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7408 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7409 +;;; Replace ldb; decb; stb; tstb with dec(mem). If the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7410 +;;; register is not needed, then the load will get deleted
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7411 +;;; automatically, but it may be needed for comparisons.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7412 +;;; Same for incb/inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7413 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7414 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7415 + (match_operand:QI 1 "nonimmediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7416 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7417 + (set (match_dup 1) (match_dup 0))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7418 + (set (cc0) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7419 + "m6809_match_peephole2 (PEEP_MEM_DEC_CMP, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7420 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int -1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7421 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7422 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7423 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7424 +;;; Replace ldb; decb; stb with dec(mem); ldb. If the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7425 +;;; register is not needed, then the load will get deleted
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7426 +;;; automatically, but it may be needed for comparisons.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7427 +;;; Same for incb/inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7428 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7429 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7430 + (match_operand:QI 1 "nonimmediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7431 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7432 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7433 + "m6809_match_peephole2 (PEEP_MEM_DEC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7434 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7435 + (set (match_dup 0) (match_dup 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7436 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7437 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7438 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7439 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7440 + (match_operand:QI 1 "nonimmediate_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7441 + (set (match_dup 0) (plus:QI (match_dup 0) (const_int 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7442 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7443 + "m6809_match_peephole2 (PEEP_MEM_INC, PEEP_END)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7444 + [(set (match_dup 1) (plus:QI (match_dup 1) (const_int 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7445 + (set (match_dup 0) (match_dup 1))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7446 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7447 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7448 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7449 +;;; Replace "andb #N; cmpb #N; bhi" with "andb #N", if it can be proven
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7450 +;;; that the branch can never occur because of the limited range of B.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7451 +;;; N must be a power of two for this to make sense. This helps with
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7452 +;;; the default cases of switch statements on a value (x & N).
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7453 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7454 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7455 + (and:QI (match_dup 0) (match_operand:QI 1 "immediate_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7456 + (set (cc0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7457 + (compare (match_dup 0) (match_dup 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7458 + (set (pc) (if_then_else (gtu (cc0) (const_int 0)) (match_operand 2 "" "") (match_operand 3 "" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7459 + ]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7460 + "reload_completed && power_of_two_p (INTVAL (operands[1]) + 1)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7461 + [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7462 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7463 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7464 +;;; Replace ldd <mem>; addd #1; std <mem> with 16-bit increment
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7465 +;;; of the mem, but only if D is dead. Same for 16-bit decrement.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7466 +;;; <mem> must be offsettable for the instruction to match.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7467 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7468 + [(set (match_operand:HI 0 "register_operand" "") (match_operand:HI 1 "memory_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7469 + (set (match_dup 0) (plus:HI (match_dup 0) (const_int 1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7470 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7471 + "reload_completed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7472 + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7473 + && peep2_reg_dead_p (3, operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7474 + [(set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7475 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7476 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7477 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7478 + [(set (match_operand:HI 0 "register_operand" "") (match_operand:HI 1 "memory_operand" ""))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7479 + (set (match_dup 0) (plus:HI (match_dup 0) (const_int -1)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7480 + (set (match_dup 1) (match_dup 0))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7481 + "reload_completed
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7482 + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7483 + && peep2_reg_dead_p (3, operands[0])"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7484 + [(set (match_dup 1) (plus:HI (match_dup 1) (const_int -1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7485 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7486 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7487 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7488 +;;; Replace a load or store using an indexed register, followed by an increment of that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7489 +;;; register, with the combined form using autoincrement.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7490 +(define_peephole2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7491 + [(set (match_operand:QI 0 "register_operand" "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7492 + (mem:QI (match_operand:HI 1 "index_register_operand" "")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7493 + (set (match_dup 1) (plus:HI (match_dup 1) (const_int 1)))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7494 + "reload_completed"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7495 + [(set (match_dup 0) (mem:QI (post_inc (match_dup 1))))]
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7496 + "")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7497 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7498 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7499 +;;- mode:emacs-lisp
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7500 +;;- comment-start: ";;- "
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7501 +;;- eval: (set-syntax-table (copy-sequence (syntax-table)))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7502 +;;- eval: (modify-syntax-entry ?[ "(]")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7503 +;;- eval: (modify-syntax-entry ?] ")[")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7504 +;;- eval: (modify-syntax-entry ?{ "(}")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7505 +;;- eval: (modify-syntax-entry ?} "){")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7506 +;-; vim: set ts=2:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7507 +;-; vim: set expandtab:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7508 +;-; vim: set filetype=lisp:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7509 +;;- End:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7510 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.opt gcc-4.6.4/gcc/config/m6809/m6809.opt
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7511 --- gcc-4.6.4-clean/gcc/config/m6809/m6809.opt 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7512 +++ gcc-4.6.4/gcc/config/m6809/m6809.opt 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7513 @@ -0,0 +1,98 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7514 +; Options for the M6809 port of the compiler
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7515 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7516 +; Copyright (C) 2005 Free Software Foundation, Inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7517 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7518 +; This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7519 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7520 +; GCC is free software; you can redistribute it and/or modify it under
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7521 +; the terms of the GNU General Public License as published by the Free
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7522 +; Software Foundation; either version 2, or (at your option) any later
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7523 +; version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7524 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7525 +; GCC is distributed in the hope that it will be useful, but WITHOUT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7526 +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7527 +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7528 +; License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7529 +;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7530 +; You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7531 +; along with GCC; see the file COPYING. If not, write to the Free
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7532 +; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7533 +; 02110-1301, USA.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7534 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7535 +margcount
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7536 +Target Mask(ARGCOUNT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7537 +Push argument count
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7538 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7539 +mint8
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7540 +Target RejectNegative Mask(BYTE_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7541 +Use 8-bit integers
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7542 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7543 +mint16
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7544 +Target RejectNegative
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7545 +Use 16-bit integers InverseMask(BYTE_INT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7546 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7547 +mreg-args
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7548 +Target Mask(REG_ARGS)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7549 +Use registers for function arguments
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7550 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7551 +mshort_size
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7552 +Target RejectNegative Mask(SMALL_SIZE_T)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7553 +Use 8-bit size_t
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7554 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7555 +mlong_size
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7556 +Target RejectNegative InverseMask(SMALL_SIZE_T)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7557 +Use 16-bit size_t
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7558 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7559 +mdirect
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7560 +Target Mask(DIRECT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7561 +Enable direct addressing
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7562 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7563 +mwpc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7564 +Target RejectNegative Mask(WPC)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7565 +Enable WPC platform extensions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7566 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7567 +mexperiment
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7568 +Target RejectNegative Mask(EXPERIMENT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7569 +Enable current experimental feature
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7570 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7571 +m6309
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7572 +Target RejectNegative Mask(6309)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7573 +Enable Hitachi 6309 extensions
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7574 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7575 +mcasesi
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7576 +Target RejectNegative Mask(CASESI)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7577 +Enable the casesi pattern
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7578 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7579 +mfar-code-page=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7580 +Target RejectNegative Joined Var(far_code_page_option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7581 +Sets the far code page value for this compilation unit
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7582 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7583 +mcode-section=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7584 +Target RejectNegative Joined Var(code_section_ptr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7585 +Sets the name of the section for code
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7586 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7587 +mdata-section=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7588 +Target RejectNegative Joined Var(data_section_ptr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7589 +Sets the name of the section for initialized data
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7590 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7591 +mbss-section=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7592 +Target RejectNegative Joined Var(bss_section_ptr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7593 +Sets the name of the section for uninitialized data
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7594 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7595 +mabi_version=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7596 +Target RejectNegative Joined Var(m6809_abi_version_ptr)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7597 +Sets the calling convention
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7598 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7599 +msoft-reg-count=
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7600 +Target RejectNegative Joined Var(m6809_soft_reg_count)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7601 +Sets the number of soft registers that can be used
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7602 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7603 +mdret
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7604 +Target RejectNegative Mask(DRET)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7605 +Put function call results in D, not X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7606 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7607 +mfar-stack-param
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7608 +Target Mask(FAR_STACK_PARAM)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7609 +Enable stack parameters to a farcall
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7610 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7611 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7612 diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h gcc-4.6.4/gcc/config/m6809/m6809-protos.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7613 --- gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7614 +++ gcc-4.6.4/gcc/config/m6809/m6809-protos.h 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7615 @@ -0,0 +1,94 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7616 +/* GCC for 6809 : machine-specific function prototypes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7617 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7618 +This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7619 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7620 +GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7621 +it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7622 +the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7623 +any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7624 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7625 +GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7626 +but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7627 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7628 +GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7629 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7630 +You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7631 +along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7632 +<http://www.gnu.org/licenses/>. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7633 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7634 +#ifndef __M6809_PROTOS_H__
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7635 +#define __M6809_PROTOS_H__
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7636 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7637 +void print_options (FILE *file);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7638 +void m6809_cpu_cpp_builtins (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7639 +void m6809_override_options (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7640 +void m6809_init_builtins (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7641 +unsigned int m6809_get_live_regs (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7642 +const char * m6809_get_regs_printable (unsigned int regs);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7643 +unsigned int m6809_get_regs_size (unsigned int regs);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7644 +int m6809_function_has_type_attr_p (tree decl, const char *);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7645 +int m6809_current_function_has_type_attr_p (const char *);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7646 +int prologue_epilogue_required (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7647 +int noreturn_functionp (rtx x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7648 +void output_function_prologue (FILE *file, int size);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7649 +void output_function_epilogue (FILE *file, int size);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7650 +int check_float_value (enum machine_mode mode, double *d, int overflow);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7651 +void m6809_asm_named_section (const char *name, unsigned int flags, tree decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7652 +void m6809_asm_file_start (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7653 +void m6809_output_ascii (FILE *fp, const char *str, unsigned long size);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7654 +void m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7655 +void m6809_reorg (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7656 +int m6809_current_function_is_void (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7657 +int m6809_can_merge_pushpop_p (int op, int regs1, int regs2);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7658 +int m6809_function_value_regno_p (unsigned int regno);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7659 +void emit_prologue_insns (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7660 +void emit_epilogue_insns (bool);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7661 +void m6809_conditional_register_usage (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7662 +void m6809_output_quoted_string (FILE *asm_file, const char *string);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7663 +int m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7664 +int m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7665 +int power_of_two_p (unsigned int n);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7666 +void m6809_do_casesi (rtx index, rtx lower_bound, rtx range, rtx table_label, rtx default_label);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7667 +void m6809_output_addsi3 (int rtx_code, rtx *operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7668 +rtx m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7669 +void expand_constant_shift (int code, rtx dst, rtx src, rtx count);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7670 +int m6809_single_operand_operator (rtx exp);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7671 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7672 +#ifdef TREE_CODE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7673 +int m6809_init_cumulative_args (CUMULATIVE_ARGS cum, tree fntype, rtx libname);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7674 +#endif /* TREE_CODE */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7675 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7676 +#ifdef RTX_CODE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7677 +void print_direct_prefix (FILE *file, rtx addr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7678 +void print_operand (FILE *file, rtx x, int code);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7679 +void print_operand_address (FILE *file, rtx addr);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7680 +void notice_update_cc (rtx exp, rtx insn);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7681 +enum reg_class m6809_preferred_reload_class (rtx x, enum reg_class regclass);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7682 +rtx gen_rtx_const_high (rtx r);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7683 +rtx gen_rtx_const_low (rtx r);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7684 +rtx gen_rtx_register_pushpop (int pop_flag, int regs);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7685 +void emit_libcall_insns (enum machine_mode mode, const char *name, rtx *operands, int count);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7686 +const char * output_branch_insn (enum rtx_code code, rtx *operands, int length);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7687 +void output_far_call_insn (rtx *operands, int has_return);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7688 +void m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7689 +rtx m6809_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7690 +const char * far_functionp (rtx x);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7691 +rtx m6809_function_value (const tree valtype, const tree func);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7692 +void m6809_output_shift_insn (int rtx_code, rtx *operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7693 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7694 +const char * m6809_get_decl_bank (tree decl);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7695 +void output_branch_insn1 (const char *opcode, rtx *operands, int long_p);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7696 +rtx m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7697 +const char * far_function_type_p (tree type);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7698 +void m6809_asm_trampoline_template(FILE *f);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7699 +bool m6809_frame_pointer_required (void);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7700 +int m6809_can_eliminate (int from, int to);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7701 +int m6809_initial_elimination_offset (int from, int to);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7702 +void m6809_emit_move_insn (rtx dst, rtx src);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7703 +void m6809_split_shift (enum rtx_code code, rtx *operands);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7704 +bool m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7705 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7706 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7707 +#endif /* RTX_CODE */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7708 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7709 +#endif /* __M6809_PROTOS_H__ */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7710 diff -urN gcc-4.6.4-clean/gcc/config/m6809/predicates.md gcc-4.6.4/gcc/config/m6809/predicates.md
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7711 --- gcc-4.6.4-clean/gcc/config/m6809/predicates.md 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7712 +++ gcc-4.6.4/gcc/config/m6809/predicates.md 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7713 @@ -0,0 +1,78 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7714 +;; Predicate definitions for Motorola 6809
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7715 +;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7716 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7717 +;; This file is part of GCC.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7718 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7719 +;; GCC is free software; you can redistribute it and/or modify
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7720 +;; it under the terms of the GNU General Public License as published by
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7721 +;; the Free Software Foundation; either version 3, or (at your option)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7722 +;; any later version.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7723 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7724 +;; GCC is distributed in the hope that it will be useful,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7725 +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7726 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7727 +;; GNU General Public License for more details.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7728 +;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7729 +;; You should have received a copy of the GNU General Public License
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7730 +;; along with GCC; see the file COPYING3. If not see
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7731 +;; <http://www.gnu.org/licenses/>.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7732 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7733 +;; whole_register_operand is like register_operand, but it
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7734 +;; does not allow SUBREGs.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7735 +(define_predicate "whole_register_operand"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7736 + (and (match_code "reg")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7737 + (match_operand 0 "register_operand")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7738 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7739 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7740 +;; A predicate that matches any index register. This can be used in nameless
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7741 +;; patterns and peepholes which need a 16-bit reg, but not D.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7742 +(define_predicate "index_register_operand"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7743 + (and (match_code "reg")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7744 + (match_test "REGNO (op) == HARD_X_REGNUM || REGNO (op) == HARD_Y_REGNUM || REGNO (op) == HARD_U_REGNUM")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7745 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7746 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7747 +;; match only X
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7748 +(define_predicate "register_operand_x"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7749 + (and (match_code "reg")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7750 + (match_test "REGNO (op) == HARD_X_REGNUM")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7751 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7752 +;; match only D
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7753 +(define_predicate "register_operand_d"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7754 + (and (match_code "reg")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7755 + (match_test "REGNO (op) == HARD_D_REGNUM")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7756 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7757 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7758 +;; Likwise, a replacement for general_operand which excludes
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7759 +;; SUBREGs.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7760 +(define_predicate "whole_general_operand"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7761 + (and (match_code "const_int,const_double,const,symbol_ref,label_ref,reg,mem")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7762 + (match_operand 0 "general_operand")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7763 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7764 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7765 +(define_predicate "add_general_operand"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7766 + (and (match_code "const_int,const_double,const,symbol_ref,label_ref,reg,mem")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7767 + (match_operand 0 "general_operand")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7768 + (match_test "REGNO (op) != SOFT_AP_REGNUM")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7769 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7770 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7771 +(define_predicate "shift_count_operand"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7772 + (and (match_code "const_int")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7773 + (and (match_operand 0 "const_int_operand")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7774 + (match_test "INTVAL (op) == 1 || INTVAL (op) == 8"))))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7775 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7776 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7777 +;; A predicate that matches any bitwise logical operator. This
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7778 +;; allows for a single RTL pattern to be used for multiple operations.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7779 +(define_predicate "logical_bit_operator"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7780 + (ior (match_code "and") (match_code "ior") (match_code "xor")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7781 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7782 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7783 +;; A predicate that matches any shift or rotate operator. This
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7784 +;; allows for a single RTL pattern to be used for multiple operations.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7785 +(define_predicate "shift_rotate_operator"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7786 + (ior (match_code "ashift") (match_code "ashiftrt") (match_code "lshiftrt")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7787 + (match_code "rotate") (match_code "rotatert")))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7788 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7789 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7790 +(define_predicate "symbolic_operand" (match_code "symbol_ref"))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7791 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7792 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-coco gcc-4.6.4/gcc/config/m6809/t-coco
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7793 --- gcc-4.6.4-clean/gcc/config/m6809/t-coco 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7794 +++ gcc-4.6.4/gcc/config/m6809/t-coco 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7795 @@ -0,0 +1,6 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7796 +# For a few minor differences in code generation on the CoCo...
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7797 +T_CFLAGS = -DTARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7798 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7799 +# For doing the startup differently on the CoCo...
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7800 +CRT0STUFF_T_CFLAGS += -Wa,--globalize-symbols -DTARGET_COCO
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7801 +# vim: set filetype=make:
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7802 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-m6809 gcc-4.6.4/gcc/config/m6809/t-m6809
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7803 --- gcc-4.6.4-clean/gcc/config/m6809/t-m6809 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7804 +++ gcc-4.6.4/gcc/config/m6809/t-m6809 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7805 @@ -0,0 +1,64 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7806 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7807 +# ranlib doesn't exist, so define it to 'true' to make it a no-op
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7808 +RANLIB_FOR_TARGET = true
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7809 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7810 +# Stubs for libgcc defined by m6809 are here
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7811 +LIB1ASMSRC = m6809/libgcc1.s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7812 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7813 +# Here are the functions that are implemented within libgcc1.s
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7814 +LIB1ASMFUNCS = _mulhi3 _divhi3 _modhi3 _udivhi3 _umodhi3 \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7815 + _euclid _seuclid _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _softregs \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7816 + _ashlhi3 _ashrhi3 _lshrhi3
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7817 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7818 +# Flags to use when building libgcc. IN_GCC does not seem necessary,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7819 +# although the compile breaks without it. -DDF=SF is required to set
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7820 +# the size of "double" to the same as the size of a "float".
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7821 +TARGET_LIBGCC2_CFLAGS =-DIN_GCC -Dinhibit_libc -DDF=SF -DLIBGCC2_HAS_SF_MODE=0 -DLIBGCC2_HAS_DF_MODE=0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7822 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7823 +LIB2ADDEH =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7824 +LIB2ADDEHSTATIC =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7825 +LIB2ADDEHSHARED =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7826 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7827 +LIBGCC2_DEBUG_CFLAGS =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7828 +LIBGCC2_CFLAGS = -Os $(LIBGCC2_INCLUDES) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7829 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7830 +# Multilib information
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7831 +# This creates multiple versions of libgcc.a for each set of incompatible
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7832 +# -mxxx options.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7833 +MULTILIB_OPTIONS = fpic mdret
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7834 +MULTILIB_DIRNAMES =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7835 +MULTILIB_MATCHES =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7836 +MULTILIB_EXCEPTIONS =
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7837 +EXTRA_MULTILIB_PARTS = crt0.o
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7838 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7839 +LIBGCC = stmp-multilib
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7840 +INSTALL_LIBGCC = install-multilib
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7841 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7842 +# We want fine grained libraries, so use the new code to build the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7843 +# floating point emulation libraries.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7844 +FPBIT = fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7845 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7846 +fp-bit.c: $(srcdir)/config/fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7847 + echo '#define FLOAT' > fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7848 + echo '#define FLOAT_ONLY' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7849 + echo '#define CMPtype HItype' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7850 + echo '#define SMALL_MACHINE' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7851 + echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7852 + echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7853 + echo '#endif' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7854 + echo '#define DI SI' >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7855 + cat $(srcdir)/config/fp-bit.c >> fp-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7856 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7857 +# crt0.o is built from the following source file
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7858 +CRT0_S = $(srcdir)/config/m6809/crt0.S
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7859 +MCRT0_S = $(srcdir)/config/m6809/crt0.S
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7860 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7861 +# Flags to use when building crt0.o
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7862 +CRT0STUFF_T_CFLAGS += -fno-builtin -nostartfiles -nostdlib
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7863 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7864 +# Assemble startup files.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7865 +$(T)crt0.o: $(CRT0_S) $(GCC_PASSES)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7866 + $(GCC_FOR_TARGET) $(CRT0STUFF_T_CFLAGS) $(MULTILIB_CFLAGS) -c -o $(T)crt0.o -x assembler-with-cpp $(CRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7867 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7868 +$(T)mcrt0.o: $(MCRT0_S) $(GCC_PASSES)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7869 + $(GCC_FOR_TARGET) $(CRT0STUFF_T_CFLAGS) $(MULTILIB_CFLAGS) -c -o $(T)mcrt0.o -x assembler-with-cpp $(MCRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7870 diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-sim gcc-4.6.4/gcc/config/m6809/t-sim
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7871 --- gcc-4.6.4-clean/gcc/config/m6809/t-sim 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7872 +++ gcc-4.6.4/gcc/config/m6809/t-sim 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7873 @@ -0,0 +1 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7874 +CRT0STUFF_T_CFLAGS += -DTARGET_SIM
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7875 diff -urN gcc-4.6.4-clean/gcc/config.gcc gcc-4.6.4/gcc/config.gcc
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7876 --- gcc-4.6.4-clean/gcc/config.gcc 2013-03-06 10:40:07.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7877 +++ gcc-4.6.4/gcc/config.gcc 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7878 @@ -375,6 +375,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7879 cpu_type=m32r
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7880 extra_options="${extra_options} g.opt"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7881 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7882 +m6809-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7883 + cpu_type=m6809
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7884 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7885 m68k-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7886 extra_headers=math-68881.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7887 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7888 @@ -1706,6 +1709,12 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7889 thread_file='posix'
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7890 fi
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7891 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7892 +m6809-coco-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7893 + tmake_file="${tmake_file} m6809/t-m6809 m6809/t-coco"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7894 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7895 +m6809-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7896 + tmake_file="${tmake_file} m6809/t-m6809 m6809/t-sim"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7897 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7898 # m68hc11 and m68hc12 share the same machine description.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7899 m68hc11-*-*|m6811-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7900 tm_file="dbxelf.h elfos.h usegas.h newlib-stdint.h m68hc11/m68hc11.h"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7901 diff -urN gcc-4.6.4-clean/gcc/gcse.c gcc-4.6.4/gcc/gcse.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7902 --- gcc-4.6.4-clean/gcc/gcse.c 2011-02-02 23:04:04.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7903 +++ gcc-4.6.4/gcc/gcse.c 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7904 @@ -833,7 +833,6 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7905 max_distance = (GCSE_COST_DISTANCE_RATIO * cost) / 10;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7906 if (max_distance == 0)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7907 return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7908 -
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7909 gcc_assert (max_distance > 0);
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7910 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7911 else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7912 diff -urN gcc-4.6.4-clean/gcc/libgcc2.c gcc-4.6.4/gcc/libgcc2.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7913 --- gcc-4.6.4-clean/gcc/libgcc2.c 2011-01-03 13:52:22.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7914 +++ gcc-4.6.4/gcc/libgcc2.c 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7915 @@ -485,6 +485,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7916 #endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7917
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7918 #ifdef L_bswapsi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7919 +#if MIN_UNITS_PER_WORD > 1
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7920 SItype
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7921 __bswapsi2 (SItype u)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7922 {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7923 @@ -494,7 +495,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7924 | (((u) & 0x000000ff) << 24));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7925 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7926 #endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7927 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7928 #ifdef L_bswapdi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7929 +#if LONG_LONG_TYPE_SIZE > 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7930 DItype
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7931 __bswapdi2 (DItype u)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7932 {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7933 @@ -508,6 +511,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7934 | (((u) & 0x00000000000000ffull) << 56));
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7935 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7936 #endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7937 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7938 #ifdef L_ffssi2
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7939 #undef int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7940 int
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7941 @@ -1280,7 +1284,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7942 UDWtype
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7943 __fixunssfDI (SFtype a)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7944 {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7945 -#if LIBGCC2_HAS_DF_MODE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7946 +#if LIBGCC2_HAS_DF_MODE || (FLT_MANT_DIG >= W_TYPE_SIZE)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7947 /* Convert the SFtype to a DFtype, because that is surely not going
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7948 to lose any bits. Some day someone else can write a faster version
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7949 that avoids converting to DFtype, and verify it really works right. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7950 @@ -1298,7 +1302,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7951
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7952 /* Assemble result from the two parts. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7953 return ((UDWtype) hi << W_TYPE_SIZE) | lo;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7954 -#elif FLT_MANT_DIG < W_TYPE_SIZE
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7955 +#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7956 if (a < 1)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7957 return 0;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7958 if (a < Wtype_MAXp1_F)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7959 @@ -1334,8 +1338,6 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7960 return (DWtype)counter << shift;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7961 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7962 return -1;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7963 -#else
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7964 -# error
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7965 #endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7966 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7967 #endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7968 diff -urN gcc-4.6.4-clean/gcc/longlong.h gcc-4.6.4/gcc/longlong.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7969 --- gcc-4.6.4-clean/gcc/longlong.h 2011-10-04 01:28:50.000000000 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7970 +++ gcc-4.6.4/gcc/longlong.h 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7971 @@ -528,6 +528,11 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7972 : "cbit")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7973 #endif /* __M32R__ */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7974
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7975 +#if defined (__m6309__) || defined (__m6809__)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7976 +#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7977 +#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctz (X))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7978 +#endif
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7979 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7980 #if defined (__mc68000__) && W_TYPE_SIZE == 32
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7981 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7982 __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7983 diff -urN gcc-4.6.4-clean/gcc/Makefile.in gcc-4.6.4/gcc/Makefile.in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7984 --- gcc-4.6.4-clean/gcc/Makefile.in 2013-04-01 02:32:34.000000000 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7985 +++ gcc-4.6.4/gcc/Makefile.in 2015-07-20 19:44:52.770843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7986 @@ -2003,14 +2003,14 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7987
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7988 # Compile the start modules crt0.o and mcrt0.o that are linked with
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7989 # every program
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7990 -$(T)crt0.o: s-crt0 ; @true
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7991 -$(T)mcrt0.o: s-crt0; @true
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7992 +crt0.o: s-crt0 ; @true
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7993 +mcrt0.o: s-crt0; @true
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7994
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7995 s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7996 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7997 - -o $(T)crt0.o -c $(CRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7998 + -o crt0.o -c $(CRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
7999 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8000 - -o $(T)mcrt0.o -c $(MCRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8001 + -o mcrt0.o -c $(MCRT0_S)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8002 $(STAMP) s-crt0
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8003 #
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8004 # Compiling object files from source files.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8005 diff -urN gcc-4.6.4-clean/gcc/opth-gen.awk gcc-4.6.4/gcc/opth-gen.awk
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8006 --- gcc-4.6.4-clean/gcc/opth-gen.awk 2011-02-08 10:41:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8007 +++ gcc-4.6.4/gcc/opth-gen.awk 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8008 @@ -121,7 +121,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8009 END {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8010 print "/* This file is auto-generated by opth-gen.awk. */"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8011 print ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8012 -print "#ifndef OPTIONS_H"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8013 +print "#if !defined(OPTIONS_H) && !defined(IN_LIBGCC2)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8014 print "#define OPTIONS_H"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8015 print ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8016 print "#include \"flag-types.h\""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8017 @@ -432,18 +432,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8018
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8019 for (i = 0; i < n_opts; i++) {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8020 opt = opt_args("InverseMask", flags[i])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8021 - if (opt ~ ",") {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8022 - vname = var_name(flags[i])
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8023 - macro = "OPTION_"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8024 - mask = "OPTION_MASK_"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8025 - if (vname == "") {
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8026 - vname = "target_flags"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8027 - macro = "TARGET_"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8028 - mask = "MASK_"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8029 - }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8030 - print "#define " macro nth_arg(1, opt) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8031 - " ((" vname " & " mask nth_arg(0, opt) ") == 0)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8032 - }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8033 + if (opt ~ ",")
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8034 + print "#define TARGET_" nth_arg(1, opt) \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8035 + " ((target_flags & MASK_" nth_arg(0, opt) ") == 0)"
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8036 }
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8037 print ""
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8038
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8039 diff -urN gcc-4.6.4-clean/gcc/tree.h gcc-4.6.4/gcc/tree.h
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8040 --- gcc-4.6.4-clean/gcc/tree.h 2011-10-06 13:57:52.000000000 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8041 +++ gcc-4.6.4/gcc/tree.h 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8042 @@ -3563,6 +3563,8 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8043 TI_UINTDI_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8044 TI_UINTTI_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8045
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8046 + TI_UINT8_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8047 + TI_UINT16_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8048 TI_UINT32_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8049 TI_UINT64_TYPE,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8050
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8051 diff -urN gcc-4.6.4-clean/gcc/version.c gcc-4.6.4/gcc/version.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8052 --- gcc-4.6.4-clean/gcc/version.c 2009-04-21 13:03:23.000000000 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8053 +++ gcc-4.6.4/gcc/version.c 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8054 @@ -21,16 +21,16 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8055
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8056 /* This is the location of the online document giving instructions for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8057 reporting bugs. If you distribute a modified version of GCC,
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8058 - please configure with --with-bugurl pointing to a document giving
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8059 - instructions for reporting bugs to you, not us. (You are of course
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8060 - welcome to forward us bugs reported to you, if you determine that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8061 - they are not bugs in your modifications.) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8062 + please change this to refer to a document giving instructions for
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8063 + reporting bugs to you, not us. (You are of course welcome to
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8064 + forward us bugs reported to you, if you determine that they are
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8065 + not bugs in your modifications.) */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8066
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8067 -const char bug_report_url[] = BUGURL;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8068 +const char bug_report_url[] = "<URL:http://lost.l-w.ca/coco/lwtools/>";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8069
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8070 /* The complete version string, assembled from several pieces.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8071 BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8072 Makefile. */
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8073
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8074 -const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8075 +const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION " (gcc6809lw pl6)";
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8076 const char pkgversion_string[] = PKGVERSION;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8077 diff -urN gcc-4.6.4-clean/libgcc/config.host gcc-4.6.4/libgcc/config.host
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8078 --- gcc-4.6.4-clean/libgcc/config.host 2011-11-23 15:15:54.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8079 +++ gcc-4.6.4/libgcc/config.host 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8080 @@ -371,6 +371,8 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8081 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8082 m32rle-*-linux*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8083 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8084 +m6809*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8085 + ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8086 m68hc11-*-*|m6811-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8087 ;;
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8088 m68hc12-*-*|m6812-*-*)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8089 diff -urN gcc-4.6.4-clean/libgcc/fixed-obj.mk gcc-4.6.4/libgcc/fixed-obj.mk
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8090 --- gcc-4.6.4-clean/libgcc/fixed-obj.mk 2007-09-17 16:18:13.000000000 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8091 +++ gcc-4.6.4/libgcc/fixed-obj.mk 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8092 @@ -23,7 +23,7 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8093 #$(info $o$(objext): -DL$($o-label) $($o-opt))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8094
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8095 $o$(objext): %$(objext): $(gcc_srcdir)/config/fixed-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8096 - $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8097 + $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) -save-temps
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8098
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8099 ifeq ($(enable_shared),yes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8100 $(o)_s$(objext): %_s$(objext): $(gcc_srcdir)/config/fixed-bit.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8101 diff -urN gcc-4.6.4-clean/libgcc/Makefile.in gcc-4.6.4/libgcc/Makefile.in
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8102 --- gcc-4.6.4-clean/libgcc/Makefile.in 2012-12-04 12:11:33.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8103 +++ gcc-4.6.4/libgcc/Makefile.in 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8104 @@ -374,8 +374,8 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8105 # Build lib2funcs. For the static library also include LIB2FUNCS_ST.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8106 lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8107 $(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8108 - $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8109 - $(vis_hide)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8110 + ln -sf $(gcc_srcdir)/libgcc2.c $*.c && \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8111 + $(gcc_compile) -DL$* -c $*.c $(vis_hide) -save-temps
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8112 libgcc-objects += $(lib2funcs-o)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8113
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8114 ifeq ($(enable_shared),yes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8115 @@ -410,8 +410,9 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8116 # Build LIB2_DIVMOD_FUNCS.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8117 lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8118 $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8119 - $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8120 - -fexceptions -fnon-call-exceptions $(vis_hide)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8121 + ln -sf $(gcc_srcdir)/libgcc2.c $*.c && \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8122 + $(gcc_compile) -DL$* -c $*.c \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8123 + -fexceptions -fnon-call-exceptions $(vis_hide) -save-temps
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8124 libgcc-objects += $(lib2-divmod-o)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8125
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8126 ifeq ($(enable_shared),yes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8127 @@ -443,7 +444,8 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8128 ifneq ($(FPBIT),)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8129 fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8130 $(fpbit-o): %$(objext): $(FPBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8131 - $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) $(vis_hide)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8132 + ln -sf $(FPBIT) $*.c && \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8133 + $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $*.c $(vis_hide) -save-temps
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8134 libgcc-objects += $(fpbit-o)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8135
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8136 ifeq ($(enable_shared),yes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8137 @@ -458,7 +460,8 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8138 ifneq ($(DPBIT),)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8139 dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8140 $(dpbit-o): %$(objext): $(DPBIT)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8141 - $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) $(vis_hide)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8142 + ln -sf $(DPBIT) $*.c && \
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8143 + $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $*.c $(vis_hide) -save-temps
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8144 libgcc-objects += $(dpbit-o)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8145
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8146 ifeq ($(enable_shared),yes)
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8147 diff -urN gcc-4.6.4-clean/README.LW gcc-4.6.4/README.LW
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8148 --- gcc-4.6.4-clean/README.LW 1969-12-31 17:00:00.000000000 -0700
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8149 +++ gcc-4.6.4/README.LW 2015-07-20 19:44:52.774843181 -0600
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8150 @@ -0,0 +1,14 @@
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8151 +This is a port of gcc6809 which is designed to work with the lwtools
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8152 +cross-assembler and linker package. You will need several scripts from that
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8153 +package, available at http://lost.l-w.ca/coco/lwtools/, in order to use
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8154 +this. Instructions for building are present in the lwtools package.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8155 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8156 +This work is based extensively on the gcc6809 4.3.4-3 release by Brian
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8157 +Dominy (brian@oddchange.com) with some significant renovations to make it
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8158 +work with gcc 4.6.1.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8159 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8160 +There is no guarantee that it will work for any particular purpose you
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8161 +choose to put it to.
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8162 +
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8163 +If you run into any problems, contact William Astle (lost@l-w.ca). DO NOT
3832a68d83ef Fix internal compiler error on "var2 = var1 + 1" patterns
William Astle <lost@l-w.ca>
parents:
diff changeset
8164 +contact the main GCC developers!