xref: /original-bsd/sys/vax/inline/libcpats.c (revision ca98dac2)
1 /*-
2  * Copyright (c) 1984, 1986 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[] = "@(#)libcpats.c	7.3 (Berkeley) 11/13/91";
10 #endif /* not lint */
11 
12 #include "inline.h"
13 
14 /*
15  * Pattern table for the C library.
16  */
17 struct pats libc_ptab[] = {
18 
19 #if defined(NOTDEF) && defined(vax)
20 	{ 1, "_fgetc\n",
21 "	sobgeq	*(sp),1f\n\
22 	calls	$1,__filbuf\n\
23 	jbr     2f\n\
24 1:\n\
25 	addl3	$4,(sp)+,r1\n\
26 	movzbl	*(r1),r0\n\
27 	incl	(r1)\n\
28 2:\n" },
29 
30 	{ 2, "_fputc\n",
31 "	sobgeq	*4(sp),1f\n\
32 	calls	$2,__flsbuf\n\
33 	jbr	2f\n\
34 1:\n\
35 	movq	(sp)+,r0\n\
36 	movb	r0,*4(r1)\n\
37 	incl	4(r1)\n\
38 2:\n" },
39 #endif
40 
41 #ifdef mc68000
42 /* someday... */
43 #endif mc68000
44 
45 	{ 0, "", "" }
46 };
47 
48 struct pats vaxsubset_libc_ptab[] = {
49 
50 	{ 1, "_strlen\n",
51 "	movl	(sp)+,r5\n\
52 	movl	r5,r1\n\
53 1:\n\
54 	tstb	(r1)+\n\
55 	jneq	1b\n\
56 	decl	r1\n\
57 	subl3	r5,r1,r0\n" },
58 
59 	{ 0, "", "" }
60 };
61 
62 struct pats vax_libc_ptab[] = {
63 
64 	{ 1, "_strlen\n",
65 "	movl	(sp)+,r5\n\
66 	movl	r5,r1\n\
67 1:\n\
68 	locc	$0,$65535,(r1)\n\
69 	jeql	1b\n\
70 	subl3	r5,r1,r0\n" },
71 
72 	{ 0, "", "" }
73 };
74