source: trunk/third/gmp/tune/Makefile.am @ 18191

Revision 18191, 6.2 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18190, which included commits to RCS files with non-trunk default branches.
Line 
1## Process this file with automake to generate Makefile.in
2
3# Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
4#
5# This file is part of the GNU MP Library.
6#
7# The GNU MP Library is free software; you can redistribute it and/or modify
8# it under the terms of the GNU Lesser General Public License as published by
9# the Free Software Foundation; either version 2.1 of the License, or (at your
10# option) any later version.
11#
12# The GNU MP Library is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15# License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public License
18# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
19# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20# MA 02111-1307, USA.
21
22
23AUTOMAKE_OPTIONS = gnu no-dependencies $(top_builddir)/ansi2knr
24
25INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/tests
26
27EXTRA_DIST = alpha.asm pentium.asm sparcv9.asm hppa.asm hppa2.asm hppa2w.asm ia64.asm many.pl
28noinst_HEADERS = speed.h
29
30
31EXTRA_LTLIBRARIES = libspeed.la
32
33libspeed_la_SOURCES =                                                   \
34  common.c divrem1div.c divrem1inv.c divrem2div.c divrem2inv.c          \
35  freq.c gcd_bin.c gcd_finda_gen.c                                      \
36  gcdext_single.c gcdext_double.c gcdextod.c gcdextos.c                 \
37  jacbase1.c jacbase2.c jacbase3.c                                      \
38  mod_1_div.c mod_1_inv.c modlinv.c mul_n_mpn.c mul_n_open.c            \
39  noop.c powm_mod.c powm_redc.c pre_divrem_1.c                          \
40  set_strb.c set_strs.c time.c                                          \
41  sb_div.c sb_inv.c
42
43libspeed_la_DEPENDENCIES = $(SPEED_CYCLECOUNTER_OBJ) \
44  $(top_builddir)/tests/libtests.la $(top_builddir)/libgmp.la
45libspeed_la_LIBADD = $(libspeed_la_DEPENDENCIES) $(LIBM)
46libspeed_la_LDFLAGS = -static
47
48$(top_builddir)/tests/libtests.la:
49        cd $(top_builddir)/tests; $(MAKE) $(AM_MAKEFLAGS) libtests.la
50
51
52# The library code is faster static than shared on some systems, so do
53# tuning and measuring with static, since users who care about maximizing
54# speed will be using that.  speed-dynamic exists to show the difference.
55#
56# On Solaris 8, gcc 2.95.2 -static is somehow broken (it creates executables
57# that immediately seg fault), so -all-static is not used.  The only thing
58# -all-static does is make libc static linked as well as libgmp, and that
59# makes a difference only when measuring malloc and friends in the speed
60# program.  This can always be forced with "make speed_LDFLAGS=-all-static
61# ..." if desired, see tune/README.
62
63EXTRA_PROGRAMS = speed speed-dynamic speed-ext tuneup
64
65DEPENDENCIES = libspeed.la
66LDADD = $(DEPENDENCIES)
67
68speed_SOURCES = speed.c
69speed_LDFLAGS = -static
70
71speed_dynamic_SOURCES = speed.c
72
73speed_ext_SOURCES = speed-ext.c
74speed_ext_LDFLAGS = -static
75
76tuneup_SOURCES = tuneup.c
77nodist_tuneup_SOURCES = sqr_basecase.c $(TUNE_MPN_SRCS)
78tuneup_DEPENDENCIES = $(TUNE_SQR_OBJ) libspeed.la
79tuneup_LDADD = $(tuneup_DEPENDENCIES)
80tuneup_LDFLAGS = -static
81
82
83tune:
84        $(MAKE) $(AM_MAKEFLAGS) tuneup$(EXEEXT)
85        ./tuneup
86
87allprogs: $(EXTRA_PROGRAMS)
88
89# $(MANY_CLEAN) and $(MANY_DISTCLEAN) are hooks for many.pl
90CLEANFILES = $(EXTRA_PROGRAMS) $(EXTRA_LTLIBRARIES) \
91        $(TUNE_MPN_SRCS) sqr_asm.asm \
92        stg.gnuplot stg.data \
93        mtg.gnuplot mtg.data \
94        fibg.gnuplot fibg.data \
95        graph.gnuplot graph.data \
96        $(MANY_CLEAN)
97DISTCLEANFILES = sqr_basecase.c  $(MANY_DISTCLEAN)
98
99
100# Generating these little files at build time seems better than including
101# them in the distribution, since the list can be changed more easily.
102#
103# mpn/generic/tdiv_qr.c uses mpn_divrem_1 and mpn_divrem_2, but only for 1
104# and 2 limb divisors, which are never used during tuning, so it doesn't
105# matter whether it picks up a tuned or untuned version of those.
106#
107# divrem_1 and mod_1 are recompiled renamed to "_tune" to avoid a linking
108# problem.  If a native divrem_1 provides an mpn_divrem_1c entrypoint then
109# common.c will want that, but the generic divrem_1 doesn't provide it,
110# likewise for mod_1.  The simplest way around this is to have the tune
111# build versions renamed suitably.
112#
113# FIXME: Would like say mul_n.c to depend on $(top_builddir)/mul_n.c so the
114# recompiled object will be rebuilt if that file changes.
115
116TUNE_MPN_SRCS = $(TUNE_MPN_SRCS_BASIC) divrem_1.c mod_1.c
117TUNE_MPN_SRCS_BASIC = dc_divrem_n.c divrem_2.c gcd.c get_str.c \
118  mul_n.c mul_fft.c mul.c sb_divrem_mn.c tdiv_qr.c
119
120$(TUNE_MPN_SRCS_BASIC):
121        for i in $(TUNE_MPN_SRCS_BASIC); do \
122          echo "#define TUNE_PROGRAM_BUILD 1" >$$i; \
123          echo "#include \"mpn/generic/$$i\"" >>$$i; \
124        done
125
126divrem_1.c:
127        echo "#define TUNE_PROGRAM_BUILD 1"                >divrem_1.c
128        echo "#define __gmpn_divrem_1  mpn_divrem_1_tune" >>divrem_1.c
129        echo "#include \"mpn/generic/divrem_1.c\""        >>divrem_1.c
130
131mod_1.c:
132        echo "#define TUNE_PROGRAM_BUILD 1"          >mod_1.c
133        echo "#define __gmpn_mod_1  mpn_mod_1_tune" >>mod_1.c
134        echo "#include \"mpn/generic/mod_1.c\""     >>mod_1.c
135
136sqr_asm.asm: $(top_builddir)/mpn/sqr_basecase.asm
137        echo 'define(SQR_KARATSUBA_THRESHOLD_OVERRIDE,SQR_KARATSUBA_THRESHOLD_MAX)' >sqr_asm.asm
138        echo 'include(../mpn/sqr_basecase.asm)' >>sqr_asm.asm
139
140
141include ../mpn/Makeasm.am
142
143
144# "mk" is multiplication in the karatsuba range
145# "st" is squaring in the toom-cook range, etc
146# "g" forms produce graphs
147
148mk:
149        ./speed -s 5-40 -c mpn_mul_basecase mpn_kara_mul_n
150
151MTS = -s 50-150 -c
152mt:
153        ./speed $(MTS) mpn_kara_mul_n mpn_toom3_mul_n
154mtg:
155        ./speed $(MTS) -P mtg mpn_kara_mul_n mpn_toom3_mul_n
156
157sk:
158        ./speed -s 5-40 -c mpn_sqr_basecase mpn_kara_sqr_n
159
160STS = -s 50-150 -c
161st:
162        ./speed $(STS) mpn_kara_sqr_n mpn_toom3_sqr_n
163stg:
164        ./speed $(STS) -P stg mpn_kara_sqr_n mpn_toom3_sqr_n
165
166dc:
167        ./speed -s 5-40 -c mpn_dc_divrem_sb mpn_dc_divrem_n mpn_dc_tdiv_qr
168
169fib:
170        ./speed -s 40-60 -c mpz_fib_ui
171fibg:
172        ./speed -s 10-300 -P fibg mpz_fib_ui
173
174
175gcd:
176        ./speed -s 1-20 -c mpn_gcd
177
178udiv:
179        ./speed -s 1 -c udiv_qrnnd udiv_qrnnd_preinv udiv_qrnnd_preinv2norm invert_limb udiv_qrnnd_c
180
181divn:
182        ./speed -s 1-30 -c mpn_divrem_1_div.-1 mpn_divrem_1_inv.-1
183divun:
184        ./speed -s 1-30 -c mpn_divrem_1_div.12345 mpn_divrem_1_inv.12345
185modn:
186        ./speed -s 1-30 -c mpn_mod_1_div.-1 mpn_mod_1_inv.-1
187modun:
188        ./speed -s 1-30 -c mpn_mod_1_div.12345 mpn_mod_1_inv.12345
189
190
191graph:
192        ./speed -s 1-5000 -f 1.02 -P graph mpn_mul_n mpn_sqr
193        gnuplot graph.gnuplot
Note: See TracBrowser for help on using the repository browser.