merge in NFS code from Rick Macklem
[unix-history] / usr / src / sys / vax / inline / libcpats.c
CommitLineData
da7c5cc6 1/*
0880b18e 2 * Copyright (c) 1984, 1986 Regents of the University of California.
da7c5cc6
KM
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
f69579ab
KM
6
7#ifndef lint
0880b18e 8static char sccsid[] = "@(#)libcpats.c 7.1 (Berkeley) %G%";
f69579ab
KM
9#endif not lint
10
ea1f375a 11#include "inline.h"
f69579ab
KM
12
13/*
14 * Pattern table for the C library.
15 */
16struct pats libc_ptab[] = {
17
18#ifdef vax
c8869d53 19 { 1, "_fgetc\n",
f69579ab
KM
20" sobgeq *(sp),1f\n\
21 calls $1,__filbuf\n\
22 jbr 2f\n\
231:\n\
24 addl3 $4,(sp)+,r1\n\
25 movzbl *(r1),r0\n\
26 incl (r1)\n\
272:\n" },
28
c8869d53 29 { 2, "_fputc\n",
f69579ab
KM
30" sobgeq *4(sp),1f\n\
31 calls $2,__flsbuf\n\
32 jbr 2f\n\
331:\n\
34 movq (sp)+,r0\n\
35 movb r0,*4(r1)\n\
36 incl 4(r1)\n\
372:\n" },
7a971c52
MK
38#endif vax
39
40#ifdef mc68000
41/* someday... */
42#endif mc68000
43
44 { 0, "", "" }
45};
46
47struct pats vaxsubset_libc_ptab[] = {
48
49 { 1, "_strlen\n",
50" movl (sp)+,r5\n\
51 movl r5,r1\n\
521:\n\
53 tstb (r1)+\n\
54 jneq 1b\n\
55 decl r1\n\
56 subl3 r5,r1,r0\n" },
57
58 { 0, "", "" }
59};
60
61struct pats vax_libc_ptab[] = {
f69579ab 62
c8869d53 63 { 1, "_strlen\n",
f69579ab
KM
64" movl (sp)+,r5\n\
65 movl r5,r1\n\
661:\n\
67 locc $0,$65535,(r1)\n\
68 jeql 1b\n\
69 subl3 r5,r1,r0\n" },
f69579ab 70
c8869d53 71 { 0, "", "" }
f69579ab 72};