makeas.sh revision 1.1.1.1 1 #!/bin/sh
2
3 # $NetBSD: makeas.sh,v 1.1.1.1 1999/08/19 21:41:35 is Exp $
4
5 # Copyright (c) 1999 Ignatios Souvatzis
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
16 # 3. All advertising materials mentioning features or use of this software
17 # must display the following acknowledgement:
18 # This product includes software developed for the NetBSD Project
19 # by Ignatios Souvatzis.
20 # 4. The name of the author may not be used to endorse or promote products
21 # derived from this software without specific prior written permission
22 #
23 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34
35
36 REALCODE=fplsp_wrap.S
37 FILELIST=Makefile.list
38
39 dummy () {
40 while [ X$1 != X ]; do
41 /bin/cat > $1.S << EOM
42 /* \$NetBSD\$ */
43
44 /*
45 * Dummy file. Real code is in ${REALCODE}.
46 *
47 * DO NOT EDIT - this file is automatically generated.
48 *
49 */
50 EOM
51 echo -n " " $1.S >> $FILELIST
52 shift
53 done
54 }
55
56 mk () {
57 NAME=$1
58 OFFS=$2
59 shift; shift
60
61 /bin/cat >> ${REALCODE} << EOJ
62
63 ENTRY($NAME)
64 #ifdef __SVR4_ABI__
65 jbra L060FPLSP$OFFS
66 #else
67 movel sp@(8),sp@-
68 movel sp@(8),sp@-
69 jbsr L060FPLSP$OFFS
70 fmoved fp0,sp@
71 movel sp@+,d0
72 movel sp@+,d1
73 rts
74 #endif
75 EOJ
76 dummy $*
77 }
78
79 mks () {
80 NAME=$1
81 OFFS=$2
82 shift; shift
83
84 /bin/cat >> ${REALCODE} << EOJ
85
86 ENTRY($NAME)
87 #ifdef __SVR4_ABI__
88 jbra L060FPLSP$OFFS
89 #else
90 movel sp@(4),sp@-
91 jbsr L060FPLSP$OFFS
92 fmoves fp0,sp@
93 movel sp@+,d0
94 rts
95 #endif
96 EOJ
97 dummy $*
98 }
99
100 /bin/cat > ${REALCODE} << EOJ
101 /* \$NetBSD\$ */
102
103 /*
104 * FPLSP wrapper.
105 *
106 * DO NOT EDIT - this file is automatically generated!
107 */
108
109 #include <machine/asm.h>
110
111 EOJ
112
113 /bin/cat > ${FILELIST} << EOJ
114 # \$NetBSD\$
115
116 #
117 # list of M68060 architecture dependent files for libm.
118 #
119 # Created by a script. Do not edit manually!
120 #
121
122 EOJ
123
124 echo -n ARCH_SRCS = >> $FILELIST
125
126 mks __ieee754_acosf 0000 e_acosf
127 mk __ieee754_acos 0008 e_acos
128 mks __ieee754_asinf 0018 e_asinf
129 mk __ieee754_asin 0020 e_asin
130 mks atanf 0030 s_atanf
131 mk atan 0038 s_atan
132 mks __ieee754_atanhf 0048 e_atanhf
133 mk __ieee754_atanh 0050 e_atanh
134 mks cosf 0060 s_cosf k_cosf
135 mk cos 0068 s_cos k_cos
136 mks __ieee754_coshf 0078 e_coshf
137 mk __ieee754_cosh 0080 e_cosh
138 mks __ieee754_expf 0090 e_expf
139 mk __ieee754_exp 0098 e_exp
140 mks expm1f 00a8 s_expm1f
141 mk expm1 00b0 s_expm1
142 mks __ieee754_log10f 00f0 e_log10f
143 mk __ieee754_log10 00f8 e_log10
144 mks logbf 0108 s_logbf
145 mk logb 0110 s_logb
146 mks __ieee754_logf 0120 e_logf
147 mk __ieee754_log 0128 e_log
148 mks log1pf 0138 s_log1pf
149 mk log1p 0140 s_log1p
150 mks sinf 0198 s_sinf k_sinf
151 mk sin 01a0 s_sin k_sin
152 mks __ieee754_sinhf 01c8 e_sinhf
153 mk __ieee754_sinh 01d0 e_sinh
154 mks tanf 01e0 s_tanf k_tanf
155 mk tan 01e8 s_tan k_tan
156 mks tanhf 01f8 s_tanhf
157 mk tanh 0200 s_tanh
158 mks __ieee754_sqrtf 02e8 e_sqrtf
159 mk __ieee754_sqrt 02f0 e_sqrt
160
161 /bin/cat >> ${REALCODE} << EOJ
162
163 L060FPLSP_BASE:
164 #include "fplsp.hex"
165 EOJ
166
167 echo "" >> ${FILELIST}
168 echo ARCH_ADDS = ${REALCODE} >> ${FILELIST}
169