xref: /original-bsd/sys/tahoe/inline/langpats.c (revision c6ddb5f9)
1 /*-
2  * Copyright (c) 1984 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)langpats.c	1.8 (Berkeley) 05/08/91";
10 #endif /* not lint */
11 
12 #include "inline.h"
13 
14 /*
15  * Pattern table for kernel specific routines.
16  * These patterns are based on the old asm.sed script.
17  */
18 struct pats language_ptab[] = {
19 
20 	{ 0, "_spl0\n",
21 "	mfpr	$8,r0\n\
22 	mtpr	$0,$8\n" },
23 
24 	{ 0, "_spl1\n",
25 "	mfpr	$8,r0\n\
26 	mtpr	$0x11,$8\n" },
27 
28 	{ 0, "_spl3\n",
29 "	mfpr	$8,r0\n\
30 	mtpr	$0x13,$8\n" },
31 
32 	{ 0, "_spl4\n",
33 "	mfpr	$8,r0\n\
34 	mtpr	$0x14,$8\n" },
35 
36 	{ 0, "_spl5\n",
37 "	mfpr	$8,r0\n\
38 	mtpr	$0x15,$8\n" },
39 
40 	{ 0, "_spl7\n",
41 "	mfpr	$8,r0\n\
42 	mtpr	$0x17,$8\n" },
43 
44 	{ 0, "_spl8\n",
45 "	mfpr	$8,r0\n\
46 	mtpr	$0x18,$8\n" },
47 
48 	{ 0, "_splimp\n",
49 "	mfpr	$8,r0\n\
50 	mtpr	$0x18,$8\n" },
51 
52 	{ 0, "_splsoftclock\n",
53 "	mfpr	$8,r0\n\
54 	mtpr	$0x8,$8\n" },
55 
56 	{ 0, "_splnet\n",
57 "	mfpr	$8,r0\n\
58 	mtpr	$0xc,$8\n" },
59 
60 	{ 0, "_splbio\n",
61 "	mfpr	$8,r0\n\
62 	mtpr	$0x18,$8\n" },
63 
64 	{ 0, "_spltty\n",
65 "	mfpr	$8,r0\n\
66 	mtpr	$0x18,$8\n" },
67 
68 	{ 0, "_splclock\n",
69 "	mfpr	$8,r0\n\
70 	mtpr	$0x18,$8\n" },
71 
72 	{ 0, "_splhigh\n",
73 "	mfpr	$8,r0\n\
74 	mtpr	$0x18,$8\n" },
75 
76 	{ 1, "_splx\n",
77 "	movl	(sp)+,r1\n\
78 	mfpr	$8,r0\n\
79 	mtpr	r1,$8\n" },
80 
81 	{ 1, "_mfpr\n",
82 "	movl	(sp)+,r1\n\
83 	mfpr	r1,r0\n" },
84 
85 	{ 2, "_mtpr\n",
86 "	movl	(sp)+,r1\n\
87 	movl	(sp)+,r0\n\
88 	mtpr	r0,r1\n" },
89 
90 #ifdef notdef
91 	{ 1, "_uncache\n",
92 "	movl	(sp)+,r1\n\
93 	mtpr	r1,$0x1c\n" },
94 #endif
95 
96 	{ 0, "_setsoftclock\n",
97 "	mtpr	$0x8,$0x10\n" },
98 
99 	{ 1, "_fuibyte\n",
100 "	callf	$8,_fubyte\n" },
101 
102 	{ 1, "_fuiword\n",
103 "	callf	$8,_fuword\n" },
104 
105 	{ 2, "_suibyte\n",
106 "	callf	$12,_subyte\n" },
107 
108 	{ 2, "_suiword\n",
109 "	callf	$12,_suword\n" },
110 
111 	{ 1, "_ffs\n",
112 "	movl	(sp)+,r1\n\
113 	ffs	r1,r0\n\
114 	bgeq	1f\n\
115 	mnegl	$1,r0\n\
116 1:\n\
117 	incl	r0\n" },
118 
119 	{ 2, "__insque\n",
120 "	movl	(sp)+,r0\n\
121 	movl	(sp)+,r1\n\
122 	insque	(r0),(r1)\n" },
123 
124 	{ 1, "__remque\n",
125 "	movl	(sp)+,r1\n\
126 	remque	(r1)\n" },
127 
128 	{ 2, "_imin\n",
129 "	movl	(sp)+,r0\n\
130 	movl	(sp)+,r1\n\
131 	cmpl	r0,r1\n\
132 	bleq	1f\n\
133 	movl	r1,r0\n\
134 1:\n" },
135 
136 	{ 2, "_imax\n",
137 "	movl	(sp)+,r0\n\
138 	movl	(sp)+,r1\n\
139 	cmpl	r0,r1\n\
140 	bgeq	1f\n\
141 	movl	r1,r0\n\
142 1:\n" },
143 
144 	{ 2, "_min\n",
145 "	movl	(sp)+,r0\n\
146 	movl	(sp)+,r1\n\
147 	cmpl	r0,r1\n\
148 	blequ	1f\n\
149 	movl	r1,r0\n\
150 1:\n" },
151 
152 	{ 2, "_max\n",
153 "	movl	(sp)+,r0\n\
154 	movl	(sp)+,r1\n\
155 	cmpl	r0,r1\n\
156 	bgequ	1f\n\
157 	movl	r1,r0\n\
158 1:\n" },
159 
160 	{ 2, "__movow\n",
161 "	movl	(sp)+,r1\n\
162 	movl	(sp)+,r0\n\
163 	movow	r0,(r1)\n" },
164 
165 	{ 2, "__movob\n",
166 "	movl	(sp)+,r1\n\
167 	movl	(sp)+,r0\n\
168 	movob	r0,(r1)\n" },
169 
170 	{ 0, "_movpsl\n",
171 "	movpsl	r0\n" },
172 
173 	{ 0, "", "" }
174 };
175