mpir/build.vc9/tune/tune_prebuild.py
gladman 694af0fc34 Major Windows Commit:
1. Add tune/speed build capability
2. Add JM's Core2 code
2009-02-27 14:24:25 +00:00

30 lines
964 B
Python

from os.path import exists
names = ['dc_divrem_n.c', 'divrem_2.c', 'gcd.c', 'gcdext.c',
'get_str.c', 'mul_n.c', 'mullow_n.c', 'mul_fft.c',
'mul.c', 'sb_divrem_mn.c', 'tdiv_qr.c' ]
for n in names :
if not exists(n) :
with open(n, "wb") as f :
lines = ['#define TUNE_PROGRAM_BUILD 1\r\n']
lines += ['#include "..\\..\\mpn\\generic\\' + n + '"\r\n']
f.writelines(lines)
n = 'divrem_1.c'
if not exists(n) :
with open(n, "wb") as f :
lines = ['#define TUNE_PROGRAM_BUILD 1\r\n']
lines += ['#define __gmpn_divrem_1 mpn_divrem_1_tune\r\n']
lines += ['#include "..\\..\\mpn\\generic\\' + n + '"\r\n']
f.writelines(lines)
n = 'mod_1.c'
if not exists(n) :
with open(n, "wb") as f :
lines = ['#define TUNE_PROGRAM_BUILD 1\r\n']
lines += ['#define __gmpn_mod_1 mpn_mod_1_tune\r\n']
lines += ['#include "..\\..\\mpn\\generic\\' + n + '"\r\n']
f.writelines(lines)