xref: /netbsd/lib/libm/arch/m68060/makeas.sh (revision 73773205)
1#!/bin/sh
2
3# $NetBSD: makeas.sh,v 1.8 2010/01/06 14:10:57 phx Exp $
4
5# Copyright (c) 1999, 2000 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#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
29
30REALCODE=fplsp_wrap.S
31FILELIST=Makefile.list
32
33dummy () {
34while [ X$1 != X ]; do
35/bin/cat > $1.S << EOM
36/* \$NetBSD\$ */
37
38/*
39 * Dummy file. Real code is elsewhere.
40 *
41 * DO NOT EDIT - this file is automatically generated.
42 *
43 */
44EOM
45echo -n " " $1.S >> $FILELIST
46shift
47done
48}
49
50linebreak () {
51	echo " \\" >> ${FILELIST}
52	echo -n "	" >> ${FILELIST}
53}
54
55mk () {
56NAME=$1
57OFFS=$2
58THESRC=$3.S
59shift; shift; shift
60
61echo -n " " ${THESRC} >> $FILELIST
62/bin/cat > ${THESRC} << EOJ
63/* \$NetBSD\$ */
64
65/*
66 * FPLSP wrapper for $NAME
67 * DO NOT EDIT - this file is automatically generated.
68 */
69
70#include <machine/asm.h>
71
72ENTRY($NAME)
73#ifdef __SVR4_ABI__
74	bral PIC_PLT(_C_LABEL(__fplsp060_$OFFS))
75#else
76	movel %sp@(8),%sp@-
77	movel %sp@(8),%sp@-
78	bsrl PIC_PLT(_C_LABEL(__fplsp060_$OFFS))
79	fmoved %fp0,%sp@
80	movel %sp@+,%d0
81	movel %sp@+,%d1
82	rts
83#endif
84EOJ
85dummy $*
86}
87
88mks () {
89NAME=$1
90OFFS=$2
91THESRC=$3.S
92shift; shift; shift
93
94echo -n " " ${THESRC} >> $FILELIST
95/bin/cat > ${THESRC} << EOJ
96/* \$NetBSD\$ */
97
98/*
99 * FPLSP wrapper for $NAME
100 * DO NOT EDIT - this file is automatically generated.
101 */
102
103#include <machine/asm.h>
104
105ENTRY($NAME)
106#ifdef __SVR4_ABI__
107	bral PIC_PLT(_C_LABEL(__fplsp060_$OFFS))
108#else
109	movel %sp@(4),%sp@-
110	bsrl PIC_PLT(_C_LABEL(__fplsp060_$OFFS))
111	fmoves %fp0,%sp@
112	movel %sp@+,%d0
113	rts
114#endif
115EOJ
116dummy $*
117}
118
119/bin/cat > ${REALCODE} << EOJ
120/* \$NetBSD\$ */
121
122/*
123 * FPLSP wrapper.
124 *
125 * DO NOT EDIT - this file is automatically generated!
126 */
127
128#include <machine/asm.h>
129
130EOJ
131
132/bin/cat > ${FILELIST} << EOJ
133# \$NetBSD\$
134
135#
136# list of M68060 architecture dependent files for libm.
137#
138# Created by a script. Do not edit manually!
139#
140
141EOJ
142
143echo -n ARCH_SRCS = >> $FILELIST
144
145mks	__ieee754_acosf		0000	e_acosf
146mk	__ieee754_acos		0008	e_acos
147mks	__ieee754_asinf		0018	e_asinf
148mk	__ieee754_asin		0020	e_asin
149linebreak
150mks	atanf			0030	s_atanf
151mk	atan			0038	s_atan
152mks	__ieee754_atanhf	0048	e_atanhf
153mk	__ieee754_atanh		0050	e_atanh
154linebreak
155mks	cosf			0060	s_cosf
156mk	cos			0068	s_cos
157mks	__ieee754_coshf		0078	e_coshf
158mk	__ieee754_cosh		0080	e_cosh
159linebreak
160mks	__ieee754_expf		0090	e_expf
161mk	__ieee754_exp		0098	e_exp
162mks	expm1f			00a8	s_expm1f
163mk	expm1			00b0	s_expm1
164linebreak
165mks	__ieee754_log10f	00f0	e_log10f
166mk	__ieee754_log10		00f8	e_log10
167mks	logbf			0108	s_logbf
168mk	logb			0110	s_logb
169linebreak
170mks	__ieee754_logf		0120	e_logf
171mk	__ieee754_log		0128	e_log
172mks	log1pf			0138	s_log1pf
173mk	log1p			0140	s_log1p
174linebreak
175mks	sinf			0198	s_sinf
176mk	sin			01a0	s_sin
177mks	__ieee754_sinhf		01c8	e_sinhf
178mk	__ieee754_sinh		01d0	e_sinh
179linebreak
180mks	tanf			01e0	s_tanf k_tanf
181mk	tan			01e8	s_tan k_tan
182mks	tanhf			01f8	s_tanhf
183mk	tanh			0200	s_tanh
184linebreak
185mks	__ieee754_sqrtf		02e8	e_sqrtf
186mk	__ieee754_sqrt		02f0	e_sqrt
187
188/bin/cat >> ${REALCODE} << EOJ
189
190L060FPLSP_BASE:
191#include "fplsp.hex"
192EOJ
193
194echo ""	>> ${FILELIST}
195echo ARCH_ADDS = ${REALCODE} >> ${FILELIST}
196