1st working version (mostly)
[unix-history] / usr / src / sys / tahoe / inline / machpats.c
CommitLineData
f7287050
SL
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 */
6
7#ifndef lint
bd1e6d2e
SL
8static char sccsid[] = "@(#)machpats.c 1.2 (Berkeley) %G%";
9#endif
f7287050
SL
10
11#include "inline.h"
12
13/*
bd1e6d2e 14 * Pattern table for special instructions.
f7287050
SL
15 */
16struct pats machine_ptab[] = {
17
bd1e6d2e 18#if defined(vax)
f7287050
SL
19 { "3,_blkcpy\n",
20" movl (sp)+,r1\n\
21 movl (sp)+,r3\n\
22 jbr 2f\n\
231:\n\
24 subl2 r0,(sp)\n\
25 movc3 r0,(r1),(r3)\n\
262:\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
33 { "3,_bcopy\n",
34" movl (sp)+,r1\n\
35 movl (sp)+,r3\n\
36 movl (sp)+,r5\n\
37 movc3 r5,(r1),(r3)\n" },
38
39 { "3,_ovbcopy\n",
40" movl (sp)+,r3\n\
41 movl (sp)+,r4\n\
42 movl (sp)+,r5\n\
43 movc3 r5,(r3),(r4)\n" },
44
45 { "3,_blkcmp\n",
46" movl (sp)+,r1\n\
47 movl (sp)+,r3\n\
48 jbr 2f\n\
491:\n\
50 subl2 r0,(sp)\n\
51 cmpc3 r0,(r1),(r3)\n\
52 bneq 3f\n\
532:\n\
54 movzwl $65535,r0\n\
55 cmpl (sp),r0\n\
56 jgtr 1b\n\
57 movl (sp)+,r0\n\
58 cmpc3 r0,(r1),(r3)\n\
593:\n" },
60
61 { "3,_bcmp\n",
62" movl (sp)+,r1\n\
63 movl (sp)+,r3\n\
64 movl (sp)+,r5\n\
65 cmpc3 r5,(r1),(r3)\n" },
66
67 { "2,_blkclr\n",
68" movl (sp)+,r3\n\
69 jbr 2f\n\
701:\n\
71 subl2 r0,(sp)\n\
72 movc5 $0,(r3),$0,r0,(r3)\n\
732:\n\
74 movzwl $65535,r0\n\
75 cmpl (sp),r0\n\
76 jgtr 1b\n\
77 movl (sp)+,r0\n\
78 movc5 $0,(r3),$0,r0,(r3)\n" },
79
80 { "2,_bzero\n",
81" movl (sp)+,r3\n\
82 movl (sp)+,r5\n\
83 movc5 $0,(r3),$0,r5,(r3)\n" },
84
85 { "3,_llocc\n",
86" movl (sp)+,r4\n\
87 movl (sp)+,r5\n\
88 movl (sp)+,r1\n\
891:\n\
90 movzwl $65535,r0\n\
91 cmpl r5,r0\n\
92 jleq 1f\n\
93 subl2 r0,r5\n\
94 locc r4,r0,(r1)\n\
95 jeql 1b\n\
96 addl2 r5,r0\n\
97 jbr 2f\n\
981:\n\
99 locc r4,r5,(r1)\n\
1002:\n" },
101
102 { "3,_locc\n",
103" movl (sp)+,r3\n\
104 movl (sp)+,r4\n\
105 movl (sp)+,r5\n\
106 locc r3,r4,(r5)\n" },
107
108 { "4,_scanc\n",
109" movl (sp)+,r2\n\
110 movl (sp)+,r3\n\
111 movl (sp)+,r4\n\
112 movl (sp)+,r5\n\
113 scanc r2,(r3),(r4),r5\n" },
114
115 { "3,_skpc\n",
116" movl (sp)+,r3\n\
117 movl (sp)+,r4\n\
118 movl (sp)+,r5\n\
119 skpc r3,r4,(r5)\n" },
120
121 { "2,_insque\n",
122" movl (sp)+,r4\n\
123 movl (sp)+,r5\n\
124 insque (r4),(r5)\n" },
125
126 { "1,_remque\n",
127" movl (sp)+,r5\n\
128 remque (r5),r0\n" },
bd1e6d2e 129#endif
f7287050 130
bd1e6d2e
SL
131#if defined(tahoe)
132 { "16,_blkcpy\n",
133" movl (sp)+,r0\n\
134 movl (sp)+,r1\n\
135 movl (sp)+,r2\n\
136 movblk\n" },
137
138 { "16,_bcopy\n",
139" movl (sp)+,r0\n\
140 movl (sp)+,r1\n\
141 movl (sp)+,r2\n\
142 movblk\n" },
143
144 { "12,_bzero\n",
145" movl (sp)+,r1\n\
146 movl (sp)+,r2\n\
147 movab 1f,r0\n\
148 movs3\n\
149 .data\n\
1501: .byte 0\n\
151 .text\n" },
152
153 { "12,_blkclr\n",
154" movl (sp)+,r1\n\
155 movl (sp)+,r2\n\
156 movab 1f,r0\n\
157 movs3\n\
158 .data\n\
1591: .byte 0\n\
160 .text\n" },
161#endif
162
163#if defined(mc68000)
f7287050 164/* someday... */
bd1e6d2e 165#endif
f7287050
SL
166
167 { "", "" }
168};