xref: /csrg-svn/sys/vax/inline/machpats.c (revision 24382)
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
8 static char sccsid[] = "@(#)machpats.c	1.5 (Berkeley) 08/21/85";
9 #endif not lint
10 
11 #include "inline.h"
12 
13 /*
14  * Pattern table for special VAX instructions.
15  */
16 struct pats machine_ptab[] = {
17 
18 #ifdef vax
19 	{ 3, "_blkcpy\n",
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 
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\
49 1:\n\
50 	subl2	r0,(sp)\n\
51 	cmpc3	r0,(r1),(r3)\n\
52 	bneq	3f\n\
53 2:\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\
59 3:\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\
70 1:\n\
71 	subl2	r0,(sp)\n\
72 	movc5	$0,(r3),$0,r0,(r3)\n\
73 2:\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\
89 1:\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\
98 1:\n\
99 	locc	r4,r5,(r1)\n\
100 2:\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" },
129 #endif vax
130 
131 #ifdef mc68000
132 /* someday... */
133 #endif mc68000
134 
135 	{ 0, "", "" }
136 };
137