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