Commit | Line | Data |
---|---|---|
80992c50 KB |
1 | /*- |
2 | * Copyright (c) 1984, 1986 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
da7c5cc6 | 6 | */ |
1b58aa0a KM |
7 | |
8 | #ifndef lint | |
80992c50 KB |
9 | static char sccsid[] = "@(#)machpats.c 7.4 (Berkeley) %G%"; |
10 | #endif /* not lint */ | |
1b58aa0a | 11 | |
ea1f375a | 12 | #include "inline.h" |
1b58aa0a KM |
13 | |
14 | /* | |
15 | * Pattern table for special VAX instructions. | |
16 | */ | |
17 | struct pats machine_ptab[] = { | |
18 | ||
19 | #ifdef vax | |
c8869d53 | 20 | { 3, "_blkcpy\n", |
1b58aa0a KM |
21 | " movl (sp)+,r1\n\ |
22 | movl (sp)+,r3\n\ | |
23 | jbr 2f\n\ | |
24 | 1:\n\ | |
25 | subl2 r0,(sp)\n\ | |
26 | movc3 r0,(r1),(r3)\n\ | |
27 | 2:\n\ | |
28 | movzwl $65535,r0\n\ | |
29 | cmpl (sp),r0\n\ | |
30 | jgtr 1b\n\ | |
31 | movl (sp)+,r0\n\ | |
32 | movc3 r0,(r1),(r3)\n" }, | |
33 | ||
c8869d53 | 34 | { 3, "_bcopy\n", |
1b58aa0a KM |
35 | " movl (sp)+,r1\n\ |
36 | movl (sp)+,r3\n\ | |
37 | movl (sp)+,r5\n\ | |
38 | movc3 r5,(r1),(r3)\n" }, | |
39 | ||
c8869d53 | 40 | { 3, "_ovbcopy\n", |
1b58aa0a KM |
41 | " movl (sp)+,r3\n\ |
42 | movl (sp)+,r4\n\ | |
43 | movl (sp)+,r5\n\ | |
44 | movc3 r5,(r3),(r4)\n" }, | |
45 | ||
7a971c52 MK |
46 | { 2, "_blkclr\n", |
47 | " movl (sp)+,r3\n\ | |
1b58aa0a KM |
48 | jbr 2f\n\ |
49 | 1:\n\ | |
50 | subl2 r0,(sp)\n\ | |
7a971c52 | 51 | movc5 $0,(r3),$0,r0,(r3)\n\ |
1b58aa0a KM |
52 | 2:\n\ |
53 | movzwl $65535,r0\n\ | |
54 | cmpl (sp),r0\n\ | |
55 | jgtr 1b\n\ | |
56 | movl (sp)+,r0\n\ | |
7a971c52 | 57 | movc5 $0,(r3),$0,r0,(r3)\n" }, |
1b58aa0a | 58 | |
7a971c52 MK |
59 | { 2, "_bzero\n", |
60 | " movl (sp)+,r3\n\ | |
1b58aa0a | 61 | movl (sp)+,r5\n\ |
7a971c52 | 62 | movc5 $0,(r3),$0,r5,(r3)\n" }, |
1b58aa0a | 63 | |
7a971c52 MK |
64 | { 2, "_insque\n", |
65 | " movl (sp)+,r4\n\ | |
66 | movl (sp)+,r5\n\ | |
67 | insque (r4),(r5)\n" }, | |
68 | ||
69 | { 1, "_remque\n", | |
70 | " movl (sp)+,r5\n\ | |
71 | remque (r5),r0\n" }, | |
72 | #endif vax | |
73 | ||
74 | #ifdef mc68000 | |
75 | /* someday... */ | |
76 | #endif mc68000 | |
77 | ||
78 | { 0, "", "" } | |
79 | }; | |
80 | ||
81 | #ifdef vax | |
82 | ||
83 | struct pats vax_ptab[] = { | |
84 | ||
85 | { 3, "_blkcmp\n", | |
86 | " movl (sp)+,r1\n\ | |
87 | movl (sp)+,r3\n\ | |
1b58aa0a KM |
88 | jbr 2f\n\ |
89 | 1:\n\ | |
90 | subl2 r0,(sp)\n\ | |
7a971c52 MK |
91 | cmpc3 r0,(r1),(r3)\n\ |
92 | bneq 3f\n\ | |
1b58aa0a KM |
93 | 2:\n\ |
94 | movzwl $65535,r0\n\ | |
95 | cmpl (sp),r0\n\ | |
96 | jgtr 1b\n\ | |
97 | movl (sp)+,r0\n\ | |
7a971c52 MK |
98 | cmpc3 r0,(r1),(r3)\n\ |
99 | 3:\n" }, | |
1b58aa0a | 100 | |
7a971c52 MK |
101 | { 3, "_bcmp\n", |
102 | " movl (sp)+,r1\n\ | |
103 | movl (sp)+,r3\n\ | |
1b58aa0a | 104 | movl (sp)+,r5\n\ |
7a971c52 | 105 | cmpc3 r5,(r1),(r3)\n" }, |
1b58aa0a | 106 | |
c8869d53 | 107 | { 3, "_llocc\n", |
1b58aa0a KM |
108 | " movl (sp)+,r4\n\ |
109 | movl (sp)+,r5\n\ | |
110 | movl (sp)+,r1\n\ | |
111 | 1:\n\ | |
112 | movzwl $65535,r0\n\ | |
113 | cmpl r5,r0\n\ | |
114 | jleq 1f\n\ | |
115 | subl2 r0,r5\n\ | |
116 | locc r4,r0,(r1)\n\ | |
117 | jeql 1b\n\ | |
118 | addl2 r5,r0\n\ | |
119 | jbr 2f\n\ | |
120 | 1:\n\ | |
121 | locc r4,r5,(r1)\n\ | |
122 | 2:\n" }, | |
123 | ||
c8869d53 | 124 | { 3, "_locc\n", |
1b58aa0a KM |
125 | " movl (sp)+,r3\n\ |
126 | movl (sp)+,r4\n\ | |
127 | movl (sp)+,r5\n\ | |
128 | locc r3,r4,(r5)\n" }, | |
129 | ||
c8869d53 | 130 | { 4, "_scanc\n", |
1b58aa0a KM |
131 | " movl (sp)+,r2\n\ |
132 | movl (sp)+,r3\n\ | |
133 | movl (sp)+,r4\n\ | |
134 | movl (sp)+,r5\n\ | |
135 | scanc r2,(r3),(r4),r5\n" }, | |
136 | ||
c8869d53 | 137 | { 3, "_skpc\n", |
1b58aa0a KM |
138 | " movl (sp)+,r3\n\ |
139 | movl (sp)+,r4\n\ | |
140 | movl (sp)+,r5\n\ | |
141 | skpc r3,r4,(r5)\n" }, | |
142 | ||
7a971c52 MK |
143 | { 0, "", "" } |
144 | }; | |
145 | ||
146 | struct pats vaxsubset_ptab[] = { | |
147 | ||
148 | { 3, "_blkcmp\n", | |
149 | " movl (sp)+,r1\n\ | |
150 | movl (sp)+,r3\n\ | |
151 | movl (sp)+,r0\n\ | |
152 | 2:\n\ | |
153 | cmpb (r1)+,(r3)+\n\ | |
154 | jneq 3f\n\ | |
155 | sobgtr r0,2b\n\ | |
156 | 3:\n" }, | |
157 | ||
158 | { 3, "_bcmp\n", | |
159 | " movl (sp)+,r1\n\ | |
160 | movl (sp)+,r3\n\ | |
e7777217 | 161 | movl (sp)+,r0\n\ |
a6a22697 | 162 | tstl r0\n\ |
e7777217 | 163 | jeql 1f\n\ |
7a971c52 MK |
164 | 2:\n\ |
165 | cmpb (r1)+,(r3)+\n\ | |
166 | jneq 1f\n\ | |
167 | sobgtr r0,2b\n\ | |
168 | 1:\n" }, | |
169 | ||
170 | { 3, "_llocc\n", | |
1b58aa0a | 171 | " movl (sp)+,r4\n\ |
e7777217 | 172 | movl (sp)+,r0\n\ |
a6a22697 | 173 | tstl r0\n\ |
e7777217 | 174 | jeql 1f\n\ |
7a971c52 | 175 | movl (sp)+,r1\n\ |
7a971c52 MK |
176 | 2:\n\ |
177 | cmpb r4,(r1)+\n\ | |
178 | jeql 1f\n\ | |
179 | sobgtr r0,2b\n\ | |
180 | 1:\n" }, | |
1b58aa0a | 181 | |
7a971c52 MK |
182 | { 3, "_locc\n", |
183 | " movl (sp)+,r3\n\ | |
e7777217 | 184 | movl (sp)+,r0\n\ |
a6a22697 | 185 | tstl r0\n\ |
e7777217 | 186 | jeql 1f\n\ |
7a971c52 | 187 | movl (sp)+,r5\n\ |
7a971c52 MK |
188 | 2:\n\ |
189 | cmpb r3,(r5)+\n\ | |
190 | jeql 1f\n\ | |
191 | sobgtr r0,2b\n\ | |
192 | 1:\n" }, | |
1b58aa0a | 193 | |
7a971c52 MK |
194 | { 3, "_skpc\n", |
195 | " movl (sp)+,r3\n\ | |
e7777217 | 196 | movl (sp)+,r0\n\ |
a6a22697 | 197 | tstl r0\n\ |
e7777217 | 198 | jeql 1f\n\ |
7a971c52 | 199 | movl (sp)+,r5\n\ |
7a971c52 MK |
200 | 2:\n\ |
201 | cmpb r3,(r5)+\n\ | |
202 | jneq 1f\n\ | |
203 | sobgtr r0,2b\n\ | |
204 | 1:\n" }, | |
1b58aa0a | 205 | |
c8869d53 | 206 | { 0, "", "" } |
1b58aa0a | 207 | }; |
7a971c52 | 208 | #endif |