makeas.sh revision 1.3.4.1 1 #!/bin/sh
2
3 # $NetBSD: makeas.sh,v 1.3.4.1 1999/12/27 18:30:00 wrstuden 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 linebreak () {
57 echo " \\" >> ${FILELIST}
58 echo -n " " >> ${FILELIST}
59 }
60
61 mk () {
62 NAME=$1
63 OFFS=$2
64 shift; shift
65
66 /bin/cat >> ${REALCODE} << EOJ
67
68 ENTRY($NAME)
69 #ifdef __SVR4_ABI__
70 jbra L060FPLSP$OFFS
71 #else
72 movel %sp@(8),%sp@-
73 movel %sp@(8),%sp@-
74 jbsr L060FPLSP$OFFS
75 fmoved %fp0,%sp@
76 movel %sp@+,%d0
77 movel %sp@+,%d1
78 rts
79 #endif
80 EOJ
81 dummy $*
82 }
83
84 mks () {
85 NAME=$1
86 OFFS=$2
87 shift; shift
88
89 /bin/cat >> ${REALCODE} << EOJ
90
91 ENTRY($NAME)
92 #ifdef __SVR4_ABI__
93 jbra L060FPLSP$OFFS
94 #else
95 movel %sp@(4),%sp@-
96 jbsr L060FPLSP$OFFS
97 fmoves %fp0,%sp@
98 movel %sp@+,%d0
99 rts
100 #endif
101 EOJ
102 dummy $*
103 }
104
105 /bin/cat > ${REALCODE} << EOJ
106 /* \$NetBSD\$ */
107
108 /*
109 * FPLSP wrapper.
110 *
111 * DO NOT EDIT - this file is automatically generated!
112 */
113
114 #include <machine/asm.h>
115
116 EOJ
117
118 /bin/cat > ${FILELIST} << EOJ
119 # \$NetBSD\$
120
121 #
122 # list of M68060 architecture dependent files for libm.
123 #
124 # Created by a script. Do not edit manually!
125 #
126
127 EOJ
128
129 echo -n ARCH_SRCS = >> $FILELIST
130
131 mks __ieee754_acosf 0000 e_acosf
132 mk __ieee754_acos 0008 e_acos
133 mks __ieee754_asinf 0018 e_asinf
134 mk __ieee754_asin 0020 e_asin
135 linebreak
136 mks atanf 0030 s_atanf
137 mk atan 0038 s_atan
138 mks __ieee754_atanhf 0048 e_atanhf
139 mk __ieee754_atanh 0050 e_atanh
140 linebreak
141 mks cosf 0060 s_cosf
142 mk cos 0068 s_cos
143 mks __ieee754_coshf 0078 e_coshf
144 mk __ieee754_cosh 0080 e_cosh
145 linebreak
146 mks __ieee754_expf 0090 e_expf
147 mk __ieee754_exp 0098 e_exp
148 mks expm1f 00a8 s_expm1f
149 mk expm1 00b0 s_expm1
150 linebreak
151 mks __ieee754_log10f 00f0 e_log10f
152 mk __ieee754_log10 00f8 e_log10
153 mks logbf 0108 s_logbf
154 mk logb 0110 s_logb
155 linebreak
156 mks __ieee754_logf 0120 e_logf
157 mk __ieee754_log 0128 e_log
158 mks log1pf 0138 s_log1pf
159 mk log1p 0140 s_log1p
160 linebreak
161 mks sinf 0198 s_sinf
162 mk sin 01a0 s_sin
163 mks __ieee754_sinhf 01c8 e_sinhf
164 mk __ieee754_sinh 01d0 e_sinh
165 linebreak
166 mks tanf 01e0 s_tanf k_tanf
167 mk tan 01e8 s_tan k_tan
168 mks tanhf 01f8 s_tanhf
169 mk tanh 0200 s_tanh
170 linebreak
171 mks __ieee754_sqrtf 02e8 e_sqrtf
172 mk __ieee754_sqrt 02f0 e_sqrt
173
174 /bin/cat >> ${REALCODE} << EOJ
175
176 L060FPLSP_BASE:
177 #include "fplsp.hex"
178 EOJ
179
180 echo "" >> ${FILELIST}
181 echo ARCH_ADDS = ${REALCODE} >> ${FILELIST}
182