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