1. Update g2y.py, the GAS to YASM Python script

2. Provide tuning for new FFT code
3. Add some documentation to YASM assembler macros for Windows
This commit is contained in:
gladman 2009-05-06 18:20:52 +00:00
parent 2ad5066cea
commit bd34c0bfc5
4 changed files with 244 additions and 118 deletions

View File

@ -6,58 +6,84 @@ import string, re, os, sys, shutil
debug = False
dot_labels = False
is_linux = False
# translate 64 bit registers to 8 bit form
r08 = { 'rax' : 'al', 'rbx' : 'bl', 'rcx' : 'cl', 'rdx' : 'dl',
'rsi' : 'sil', 'rdi' : 'dil', 'rbp' : 'bpl',
'r8' : 'r8b', 'r9' : 'r9b', 'r10' : 'r10b', 'r11' : 'r11b',
'r12' : 'r12b', 'r13' : 'r13b', 'r14' : 'r14b', 'r15' : 'r15b' }
# translate 64 bit registers to 32 bit form
r32 = { 'rax' : 'eax', 'rbx' : 'ebx', 'rcx' : 'ecx', 'rdx' : 'edx',
'rsi' : 'esi', 'rdi' : 'edi', 'rbp' : 'ebp',
'r8' : 'r8d', 'r9' : 'r9d', 'r10' : 'r10d', 'r11' : 'r11d',
'r12' : 'r12d', 'r13' : 'r13d', 'r14' : 'r14d', 'r15' : 'r15d' }
# regular expression for registers
r_q = r"(?:r[abcd]x|r[sd]i|r[bsi]p)|(?:r8|r9|r1[012345])|"
r_d = r"(?:e[abcd]x|e[sd]i|e[bsi]p|r[89]d|r1[012345]d)|"
r_w = r"(?:[abcd]x|[sd]i|[bsi]p|r[89]w|r1[012345]w)|"
r_b = r"(?:[abcd]l|[ds]il|[bsi]pl|r[89]l|r1[012345]l)|"
r_x = r"(?:x?mm\d|x?mm1[0-5])|(?:mmx\d|mmx1[0-5])|(?:st\([0-7]\))"
r_q = r'(?:r[abcd]x|r[sd]i|r[bsi]p)|(?:r8|r9|r1[0-5])' # 64 bit
r_d = r'(?:e[abcd]x|e[sd]i|e[bsi]p|r[89]d|r1[0-5]d)|' # 32 bit
r_w = r'(?:[abcd]x|[sd]i|[bsi]p|r[89]w|r1[0-5]w)|' # 16 bit
r_b = r'(?:[abcd]l|[ds]il|[bsi]pl|r[89]b|r1[0-5]b)|' # 8 bit
r_x = r'(?:x?mm\d|x?mm1[0-5])|(?:mmx\d|mmx1[0-5])|(?:st\([0-7]\))'
p_rg = r"(?:\s*%(" + r_b + r_w + r_d + r_q + r_x + r"))"
p_rg = r'(?:\s*%(' + r_b + r_w + r_d + r_q + '|' + r_x + r'))'
# regular expression for dis(r1, r2, mul) forms
p_mu = r"(?:\s*,\s*([1248])){0,1}\s*(?=\))"
p_di = r"(?:\s*([\+\-]{0,1}[0-9]*)(?=\()){0,1}"
p_t1 = p_di + r"\s*\(" + p_rg + r"(?:\s*\)|\s*,*" + p_rg + p_mu + r"\s*\))"
p_di = r'(?:\s*([-+]?[0-9]*)(?=\())?' # numeric displacement
p_mu = r'(?:\s*,\s*([1248]))?\s*(?=\))' # multiplier (1, 2, 4, 8)
p_t1 = p_di + r'\s*\(' + p_rg + r'(?:\s*\)|\s*,' + p_rg + p_mu + r'\s*\))'
# regular expression for immediate (numeric, not symbolic)
p_im = r"\s+\`{0,1}\$\'{0,1}([\+\-]{0,1}[0-9]+|0x[a-zA-Z0-9]+)"
p_im = r'\s+\`?\$\'?([\+\-]?[0-9]+|0x[a-zA-Z0-9]+)'
# regular expression for labels
# regular expressions for labels
p_la = r"\s*([a-zA-Z$_][a-zA-Z0-9\$_]*|\.[0-9]+)(:)"
p_lr = r"\s+([a-zA-Z$_][a-zA-Z0-9\$_]*|\.[0-9]+)"
if True :
p_lr = r'\s*([a-zA-Z$_][a-zA-Z0-9\$_]*|\.[0-9]+)'
else :
p_lr = r'\s*L\(([a-zA-Z0-9\$_]+)\)'
p_la = p_lr + r'(:)'
p_ri = p_lr + r'\(\%rip\)'
p_jt = r'\s+\.long\s+' + p_lr + r'\-' + p_lr
# regular expression for instructions
p_in = r"\s*([a-zA-Z][a-zA-Z0-9]*)"
p_in = r'\s*([a-zA-Z][a-zA-Z0-9]*)'
m_f1 = re.compile(p_in + p_rg + r"\s*," + p_t1)
m_f2 = re.compile(p_in + p_t1 + r"\s*," + p_rg)
p_def = r'define\s*\(\s*\`([a-zA-Z_][a-zA-Z0-9_]*)\'\s*\,\s*\`' + p_rg + '\'\s*\)'
m_f1 = re.compile(p_in + p_rg + r'\s*,' + p_t1)
m_f2 = re.compile(p_in + p_t1 + r'\s*,' + p_rg)
m_f3 = re.compile(p_in + p_t1)
m_f4 = re.compile(p_in + p_im + r"\s*," + p_t1)
m_f5 = re.compile(p_in + p_im + r"\s*," + p_rg)
m_f6 = re.compile(p_in + p_rg + r"\s*," + p_rg)
m_f4 = re.compile(p_in + p_im + r'\s*,' + p_t1)
m_f5 = re.compile(p_in + p_im + r'\s*,' + p_rg)
m_f6 = re.compile(p_in + p_rg + r'\s*,' + p_rg)
m_f7 = re.compile(p_in + p_rg)
m_g7 = re.compile(p_in + r'\s+\*' + p_rg)
m_f8 = re.compile(p_in + p_im)
m_f9 = re.compile(p_in + p_lr)
m_fa = re.compile(p_in + p_im + r"\s*," + p_rg + r"\s*," + p_rg)
m_fa = re.compile(p_in + '(?:' + p_im + '|' + p_rg + r')\s*,' + p_rg + r'\s*,' + p_rg)
m_la = re.compile(p_la)
m_jt = re.compile(p_jt)
m_ri = re.compile(p_in + p_ri)
r_mac = re.compile(r"^\s*(?:define|DEFINE)\s*\(\s*`"
"([A-Z$_][A-Z0-9$_]*)'\s*,\s*`\s*$")
r_mnd = re.compile(r"^\s*'\s*\)\s*$")
r_dlr = re.compile(r"\$([0-9]+)")
r_dlr = re.compile(r'\$([0-9]+)')
r_def = re.compile(p_def)
r1 = r"\s*(\%{0,1}[0-9]+){0,1}\s*"
r2 = r"(?:,\s*(\%{0,1}[0-9]+))?\s*"
r_mrf = re.compile(r"([A-Z$_][A-Z0-9$_]*)\s*\(" + r1 + r2 +
r2 + r2 + r2 + r2 + r2 + r2 + r2 + r2 + r"\)")
r1 = r'\s*(\%{0,1}[0-9]+){0,1}\s*'
r2 = r'(?:,\s*(\%{0,1}[0-9]+))?\s*'
r_mrf = re.compile(r'([A-Z$_][A-Z0-9$_]*)\s*\(' + r1 + r2 +
r2 + r2 + r2 + r2 + r2 + r2 + r2 + r2 + r'\)')
def pass_one(code) :
labels = []
@ -131,7 +157,7 @@ def pass_three(code, labels, macros, level) :
if m.group(1) in macros[mac_name][3] :
ii = macros[mac_name][3][m.group(1)]
else :
print("internal error")
print('internal error')
else :
ii = labels.index(m.group(1))
lab = re.sub('\$', '%', m.group(1))
@ -141,7 +167,7 @@ def pass_three(code, labels, macros, level) :
elif dot_labels :
lo += ['\n.{0}:'.format(ii)]
else :
lo += ['\n{0}:'.format(lab)]
lo += ['\nL_{0}:'.format(lab)]
continue
else :
if mac_name :
@ -149,26 +175,31 @@ def pass_three(code, labels, macros, level) :
elif dot_labels :
lp = '\n.{0}:'.format(ii)
else :
lp = '\n{0}:'.format(lab)
lp = '\nL_{0}:'.format(lab)
m = re.search(r"(\s*)#\s*(.*)", l)
m = re.search(r'(\s*)#\s*(.*)', l)
if m :
v = list(m.groups())
lo += [lp + '{0[0]}; {0[1]}'.format(v)]
continue
m = re.search(r"dnl(.*)", l)
m = re.search(r'dnl(.*)', l)
if m :
lo += [lp + ';{0}'.format(m.group(1))]
continue
# three operand instructions
m = m_fa.search(l)
if m :
v = list(m.groups())
if debug :
print(l, end = '')
lo += [lp + '\t{0[0]:7s} {0[3]}, {0[2]}, {0[1]}'.format(v)]
continue
if v[1] == None or v[2] == None :
if v[1] == None :
lo += [lp + '\t{0[0]:7s} {0[4]}, {0[3]}, {0[2]}'.format(v)]
else :
lo += [lp + '\t{0[0]:7s} {0[4]}, {0[3]}, {0[1]}'.format(v)]
continue
# ins reg, dis(reg, reg, off)
m = m_f1.search(l)
@ -233,6 +264,15 @@ def pass_three(code, labels, macros, level) :
lo += [lp + '\t{0[0]:7s} {0[1]}'.format(v)]
continue
# ins *reg
m = m_g7.search(l)
if m :
v = list(m.groups())
if debug :
print(l, end = '')
lo += [lp + '\t{0[0]:7s} {0[1]}'.format(v)]
continue
# ins imm
m = m_f8.search(l)
if m :
@ -242,6 +282,53 @@ def pass_three(code, labels, macros, level) :
lo += [lp + '\t{0[0]:7s} {0[1]}'.format(v)]
continue
# jump table
m = m_jt.search(l)
if m :
v = list(m.groups())
if v[1] in labels :
if debug :
print(l, end = '')
if mac_name and v[0] in macros[mac_name][3] :
ii = macros[mac_name][3][v[0]]
st1 = '%%{0}'.format(ii)
elif dot_labels :
ii = labels.index(v[0])
st1 = '.{0}'.format(ii)
else :
lab = re.sub('\$', '%', v[0])
st1 = 'L_{0}'.format(lab)
if mac_name and v[1] in macros[mac_name][3] :
ii = macros[mac_name][3][v[1]]
st2 = '%%{1}'.format(ii)
elif dot_labels :
ii = labels.index(v[1])
st2 = '.{1}'.format(ii)
else :
lab = re.sub('\$', '%', v[1])
st2 = 'L_{0}'.format(lab)
lo += [lp + '\tdd ' + st1 + ' - ' + st2]
continue
# RIP relative jump
m = m_ri.search(l)
if m :
v = list(m.groups())
if v[1] in labels :
if debug :
print(l, end = '')
if mac_name and v[1] in macros[mac_name][3] :
ii = macros[mac_name][3][v[1]]
lo += [lp + '\t{0[0]:7s} %%{1}[rip]'.format(v, ii)]
continue
if dot_labels :
ii = labels.index(v[1])
lo += [lp + '\t{0[0]:7s} .{1}[rip]'.format(v, ii)]
else :
lab = re.sub('\$', '%', v[1])
lo += [lp + '\t{0[0]:7s} L_{1}[rip]'.format(v, lab)]
continue
# jump label
m = m_f9.search(l)
if m :
@ -258,10 +345,10 @@ def pass_three(code, labels, macros, level) :
lo += [lp + '\t{0[0]:7s} .{1}'.format(v, ii)]
else :
lab = re.sub('\$', '%', v[1])
lo += [lp + '\t{0[0]:7s} {1}'.format(v, lab)]
lo += [lp + '\t{0[0]:7s} L_{1}'.format(v, lab)]
continue
m = re.search(r"\s*\.byte\s+((?:0x|0X)[0-9a-fA-F]+|[0-9]+)\s*", l)
m = re.search(r'\s*\.byte\s+((?:0x|0X)[0-9a-fA-F]+|[0-9]+)\s*', l)
if m :
v = list(m.groups())
lo += [lp + '\tdb {0[0]}'.format(v)]
@ -280,27 +367,27 @@ def pass_three(code, labels, macros, level) :
if m and mac_name :
mac_name = ''
lab_ofs = 0
lo += [lp + "%endmacro"]
lo += [lp + '%endmacro']
continue
m = r_dlr.findall(l)
if m :
l = re.sub(r"\$([0-9]+)", r"%\1", l)
l = re.sub(r'\$([0-9]+)', r'%\1', l)
m = re.search("PROLOGUE\(([a-zA-Z$_][a-zA-Z0-9$_]*)\)", l)
m = re.search('PROLOGUE\(([a-zA-Z$_][a-zA-Z0-9$_]*)\)', l)
if m :
if is_linux :
lo += [lp + "\tGLOBAL_FUNC {0}".format(m.group(1))]
lo += [lp + '\tGLOBAL_FUNC {0}'.format(m.group(1))]
else :
lo += [lp + "\tWIN64_GCC_PROC {0}".format(m.group(1))]
lo += [lp + '\tWIN64_GCC_PROC {0}'.format(m.group(1))]
continue
m = re.search("EPILOGUE\(\)", l)
m = re.search('EPILOGUE\(\)', l)
if m :
if is_linux :
lo += [lp + "\tend"]
lo += [lp + '\tend']
else :
lo += [lp + "\tWIN64_GCC_END"]
lo += [lp + '\tWIN64_GCC_END']
continue
# macro calls
@ -323,13 +410,13 @@ def pass_three(code, labels, macros, level) :
continue
if mac_name :
m = re.search(r"\s*([^%]+)%([0-9]+)\s*", l)
m = re.search(r'\s*([^%]+)%([0-9]+)\s*', l)
if m and m.lastindex == 2 and int(m.group(2)) <= macros[mac_name][2] :
lo += [lp + '\t{0}%{1}'.format(m.group(1).lower(),m.group(2))]
continue
# ins
m = re.search(p_in + r"\s+(.*)", l)
m = re.search(p_in + r'\s+(.*)', l)
if m :
v = list(m.groups())
if debug :
@ -344,18 +431,19 @@ def pass_three(code, labels, macros, level) :
lo += [lp + ';\t{0}'.format(v[1])]
continue
m = re.search(r"include\(.+config.m4.+\)", l)
m = re.search(r'include\(.+config.m4.+\)', l)
if m :
if is_linux :
lo += [lp + '%include "yasm_mac.inc"']
lo += [lp + "%include 'yasm_mac.inc'"]
else :
lo += [lp + '%include "'
+ ''.join(['..\\'] * level) + 'yasm_mac.inc"']
lo += [lp + "%include '"
+ ''.join(['..\\'] * level) + "yasm_mac.inc'"]
continue
m = re.search(r"\s*(\S+)", l)
m = re.search(r'\s*(\S+)', l)
if m :
lo += [lp + '{0} ; < not translated >'.format(l[:-1])]
t = None if l[-1].isprintable() else None
lo += [lp + '{0} ; < not translated >'.format(l[:t])]
else :
lo += ['']
return lo
@ -375,11 +463,11 @@ def conv_lines(code, l) :
return (labels, macros, code)
def conv_file(f_in, f_out, l) :
f = open(f_in, "r")
f = open(f_in, 'r')
code = f.readlines()
f.close()
labels, macros, code = conv_lines(code, l)
f = open(f_out, "w")
f = open(f_out, 'w')
f.writelines(code)
f.close()
@ -398,14 +486,14 @@ def conv_dirs(s, d, l) :
if x[1] == '.asm' :
form_path(dp)
print("translating '{0}'".format(sp))
f = open(sp, "r")
f = open(sp, 'r')
code = f.readlines()
f.close()
if sp == dp :
rp = os.path.join(s, x[0] + ('.as' if is_linux else '.old'))
os.rename(sp, rp)
labels, macros, code = conv_lines(code, l)
f = open(dp, "w")
f = open(dp, 'w')
f.writelines(code)
f.close()
elif False :
@ -414,13 +502,13 @@ def conv_dirs(s, d, l) :
if len(sys.argv) == 1 :
cd = os.getcwd() # if run in the build.vc9 directory
if cd.endswith("build.vc9") :
cd1 = cd + "\\..\\mpn\\x86_64" # the GAS assembler directory
cd2 = cd + "\\..\\mpn\\x86_64w" # the YASM (Windows) assembler directory
elif cd.endswith("x86_64") : # if run in the GAS assembler directory
if os.path.exists(cd + "\\..\\x86_64w") :
if cd.endswith('build.vc9') :
cd1 = cd + '\\..\\mpn\\x86_64' # the GAS assembler directory
cd2 = cd + '\\..\\mpn\\x86_64w' # the YASM (Windows) assembler directory
elif cd.endswith('x86_64') : # if run in the GAS assembler directory
if os.path.exists(cd + '\\..\\x86_64w') :
cd1 = cd
cd2 = cd + "\\..\\x86_64w"
cd2 = cd + '\\..\\x86_64w'
else :
cd1 = cd2 = cd
elif len(sys.argv) == 3 :

View File

@ -1,24 +1,24 @@
/* Generated by tuneup.c, 2009-04-14, system compiler */
/* Generated by tuneup.c, 2009-05-06, system compiler */
#define MUL_KARATSUBA_THRESHOLD 28
#define MUL_TOOM3_THRESHOLD 161
#define MUL_TOOM4_THRESHOLD 567
#define MUL_TOOM7_THRESHOLD 567
#define MUL_KARATSUBA_THRESHOLD 26
#define MUL_TOOM3_THRESHOLD 168
#define MUL_TOOM4_THRESHOLD 842
#define MUL_TOOM7_THRESHOLD 842
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_KARATSUBA_THRESHOLD 34
#define SQR_TOOM3_THRESHOLD 218
#define MULLOW_BASECASE_THRESHOLD 0 /* always */
#define MULLOW_DC_THRESHOLD 118
#define MULLOW_MUL_N_THRESHOLD 228
#define MULLOW_BASECASE_THRESHOLD 7
#define MULLOW_DC_THRESHOLD 99
#define MULLOW_MUL_N_THRESHOLD 210
#define DIV_SB_PREINV_THRESHOLD 0 /* always */
#define DIV_DC_THRESHOLD 102
#define POWM_THRESHOLD 200
#define DIV_DC_THRESHOLD 108
#define POWM_THRESHOLD 170
#define GCD_ACCEL_THRESHOLD 3
#define GCDEXT_THRESHOLD 218
#define GCDEXT_THRESHOLD 224
#define JACOBI_BASE_METHOD 2
#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
@ -35,11 +35,22 @@
#define GET_STR_PRECOMPUTE_THRESHOLD 11
#define SET_STR_THRESHOLD 8540
#define MUL_FFT_TABLE { 752, 1696, 3520, 7424, 15360, 45056, 0 }
#define MUL_FFT_MODF_THRESHOLD 976
#define MUL_FFT_TABLE { 464, 1056, 3392, 3840, 7168, 28672, 0 }
#define MUL_FFT_MODF_THRESHOLD 1488
#define MUL_FFT_THRESHOLD 14336
#define SQR_FFT_TABLE { 880, 1888, 3904, 7424, 15360, 36864, 0 }
#define SQR_FFT_MODF_THRESHOLD 1008
#define SQR_FFT_THRESHOLD 7040
#define SQR_FFT_TABLE { 560, 1056, 3392, 3840, 7168, 36864, 0 }
#define SQR_FFT_MODF_THRESHOLD 1488
#define SQR_FFT_THRESHOLD 13120
/* Tuneup completed successfully, took 22 seconds */
/* Tuneup completed successfully, took 1381 seconds */
#define MUL_FFT_TABLE2 {{1, 2}, {215, 3}, {220, 2}, {404, 3}, {413, 2}, {443, 3}, {453, 2}, {507, 3}, {519, 2}, {695, 3}, {711, 2}, {727, 3}, {777, 2}, {831, 3}, {850, 2}, {1015, 3}, {1038, 2}, {1185, 3}, {1211, 2}, {1266, 3}, {1352, 2}, {1382, 3}, {1476, 4}, {1509, 2}, {1543, 3}, {1577, 2}, {1612, 3}, {1648, 2}, {2340, 3}, {2392, 2}, {2499, 3}, {2610, 2}, {2668, 3}, {2787, 2}, {3248, 3}, {3393, 2}, {3468, 3}, {3544, 2}, {3622, 3}, {3702, 2}, {3784, 3}, {3867, 4}, {3952, 3}, {4128, 2}, {4914, 3}, {5022, 4}, {5132, 3}, {5245, 2}, {5360, 3}, {5478, 4}, {5598, 2}, {5721, 3}, {6107, 2}, {6378, 3}, {6661, 2}, {6807, 3}, {6957, 2}, {7110, 3}, {7426, 2}, {7926, 3}, {8100, 4}, {8460, 2}, {9030, 3}, {9228, 4}, {9431, 2}, {9850, 3}, {10287, 2}, {10744, 3}, {10980, 4}, {11221, 3}, {11467, 4}, {11976, 3}, {13061, 4}, {13640, 3}, {13939, 4}, {14245, 3}, {14557, 4}, {14876, 5}, {15202, 4}, {16224, 3}, {17316, 4}, {18084, 2}, {18480, 3}, {19299, 2}, {19722, 3}, {20154, 2}, {20596, 3}, {21508, 4}, {21979, 3}, {22461, 2}, {23970, 3}, {24495, 4}, {25032, 5}, {25581, 6}, {26142, 7}, {26715, 8}, {27300, 9}, {28509, 7}, {29134, 8}, {31091, 9}, {33179, 10}, {33906, 9}, {37787, 10}, {39461, 9}, {42113, 10}, {43036, 9}, {43979, 10}, {45928, 11}, {46934, 10}, {47962, 9}, {51184, 10}, {52305, 9}, {54622, 10}, {55819, 8}, {57042, 9}, {59569, 10}, {60874, 11}, {62207, 12}, {63570, 10}, {64963, 9}, {67840, 10}, {72397, 9}, {75604, 10}, {77260, 9}, {78952, 10}, {86099, 11}, {87985, 10}, {91881, 11}, {93893, 10}, {95949, 11}, {98051, 12}, {MP_SIZE_T_MAX,0}}
#define MUL_FFTM_TABLE2 {{1, 2}, {695, 3}, {711, 2}, {743, 3}, {760, 2}, {971, 3}, {993, 2}, {1015, 3}, {1038, 2}, {1134, 3}, {1159, 2}, {1211, 3}, {1266, 4}, {1294, 2}, {1382, 3}, {1413, 2}, {1444, 3}, {1476, 2}, {1543, 3}, {1577, 4}, {1612, 2}, {1722, 3}, {1760, 2}, {1965, 3}, {2053, 2}, {2098, 3}, {2191, 2}, {2340, 3}, {2499, 2}, {2668, 3}, {2727, 2}, {2849, 3}, {2912, 2}, {2976, 3}, {3109, 4}, {3178, 2}, {3248, 3}, {3622, 4}, {3702, 2}, {3952, 3}, {4039, 4}, {4128, 5}, {4219, 3}, {4504, 2}, {4603, 3}, {4704, 2}, {4914, 3}, {5132, 2}, {5598, 3}, {5847, 2}, {6241, 3}, {6378, 2}, {6807, 3}, {6957, 4}, {7110, 3}, {7426, 4}, {7589, 5}, {7756, 3}, {7926, 2}, {8278, 3}, {8460, 4}, {8836, 5}, {9030, 3}, {9228, 4}, {9638, 3}, {9850, 4}, {10066, 3}, {10287, 2}, {10980, 3}, {11221, 4}, {11467, 5}, {11719, 6}, {11976, 4}, {12239, 3}, {12781, 4}, {13640, 5}, {13939, 4}, {14245, 2}, {14876, 3}, {15202, 4}, {15535, 3}, {15876, 2}, {16224, 3}, {16580, 4}, {16944, 5}, {17316, 4}, {17696, 3}, {18480, 4}, {19722, 2}, {20154, 3}, {20596, 4}, {21508, 5}, {21979, 4}, {22953, 3}, {23970, 2}, {24495, 3}, {25032, 4}, {25581, 5}, {26715, 6}, {27300, 7}, {28509, 8}, {29134, 9}, {30424, 7}, {31091, 8}, {31772, 9}, {33179, 8}, {33906, 9}, {35408, 10}, {37787, 9}, {38615, 10}, {42113, 9}, {43036, 10}, {45928, 11}, {46934, 9}, {49013, 10}, {50087, 11}, {51184, 12}, {54622, 10}, {57042, 9}, {59569, 10}, {60874, 11}, {62207, 12}, {63570, 10}, {64963, 9}, {66386, 10}, {69326, 11}, {70845, 12}, {72397, 11}, {75604, 10}, {77260, 11}, {80681, 10}, {87985, 11}, {89912, 9}, {91881, 10}, {93893, 11}, {98051, 10}, {MP_SIZE_T_MAX,0}}
#define SQR_FFT_TABLE2 {{1, 2}, {205, 3}, {210, 2}, {496, 3}, {507, 2}, {568, 3}, {581, 2}, {760, 3}, {777, 2}, {831, 3}, {850, 2}, {869, 3}, {909, 2}, {1038, 3}, {1061, 2}, {1085, 3}, {1109, 2}, {1185, 3}, {1211, 2}, {1266, 3}, {1294, 2}, {1413, 3}, {1476, 2}, {1543, 3}, {1577, 2}, {1760, 3}, {1799, 2}, {2009, 3}, {2053, 2}, {2191, 3}, {2239, 2}, {2289, 3}, {2392, 2}, {2445, 3}, {2554, 4}, {2610, 3}, {2668, 2}, {2912, 3}, {3042, 2}, {3393, 3}, {3468, 2}, {3952, 3}, {4039, 2}, {4128, 3}, {4219, 2}, {4808, 3}, {4914, 2}, {5022, 3}, {5132, 2}, {5245, 3}, {5598, 2}, {5721, 3}, {5847, 2}, {5976, 3}, {6107, 2}, {6241, 3}, {6518, 4}, {6661, 5}, {6807, 3}, {6957, 4}, {7110, 3}, {7926, 2}, {8100, 3}, {8278, 2}, {9228, 3}, {9431, 2}, {9850, 3}, {10066, 2}, {11719, 3}, {12239, 2}, {12781, 3}, {13061, 2}, {13347, 3}, {14557, 2}, {15535, 3}, {16224, 2}, {16580, 3}, {16944, 2}, {18084, 3}, {18480, 4}, {18885, 5}, {19299, 4}, {19722, 5}, {20596, 4}, {21047, 3}, {21979, 2}, {22953, 3}, {23456, 4}, {24495, 5}, {25581, 6}, {26715, 4}, {27898, 5}, {28509, 6}, {29134, 5}, {30424, 3}, {31091, 4}, {31772, 5}, {33179, 4}, {35408, 3}, {36977, 2}, {37787, 3}, {38615, 4}, {39461, 3}, {40326, 2}, {41210, 3}, {42113, 4}, {43036, 3}, {46934, 4}, {49013, 5}, {52305, 6}, {53451, 5}, {54622, 4}, {55819, 5}, {57042, 6}, {58292, 5}, {59569, 6}, {62207, 4}, {64963, 3}, {66386, 4}, {69326, 5}, {77260, 6}, {78952, 5}, {84254, 6}, {86099, 4}, {87985, 5}, {89912, 4}, {91881, 5}, {93893, 3}, {98051, 4}, {MP_SIZE_T_MAX,0}}
#define SQR_FFTM_TABLE2 {{1, 2}, {215, 3}, {220, 2}, {453, 3}, {463, 2}, {971, 3}, {993, 2}, {1109, 3}, {1159, 2}, {1185, 3}, {1266, 2}, {1294, 3}, {1323, 2}, {1352, 3}, {1382, 2}, {1444, 3}, {1476, 2}, {1760, 3}, {1799, 2}, {1839, 3}, {1880, 2}, {2053, 3}, {2098, 2}, {2191, 3}, {2239, 2}, {2392, 3}, {2445, 2}, {2554, 3}, {2610, 2}, {2849, 3}, {2912, 2}, {3109, 3}, {3248, 4}, {3320, 3}, {3468, 2}, {3544, 3}, {3702, 2}, {3952, 3}, {4128, 2}, {4914, 3}, {5022, 2}, {5478, 3}, {5598, 2}, {6107, 3}, {6241, 2}, {6518, 3}, {6661, 2}, {6807, 3}, {7110, 2}, {7426, 3}, {7589, 4}, {7756, 2}, {8100, 3}, {8278, 2}, {9030, 3}, {10287, 2}, {10744, 3}, {11719, 2}, {12239, 3}, {12507, 4}, {12781, 5}, {13061, 6}, {13347, 7}, {13640, 8}, {14557, 9}, {14876, 10}, {15202, 11}, {15535, 10}, {15876, 11}, {16224, 9}, {16944, 10}, {17316, 9}, {18084, 8}, {18480, 9}, {18885, 10}, {19299, 9}, {20154, 8}, {21508, 9}, {21979, 8}, {22461, 9}, {22953, 10}, {23456, 8}, {23970, 9}, {25032, 8}, {26715, 9}, {28509, 7}, {29134, 8}, {31772, 9}, {32468, 10}, {33179, 9}, {33906, 8}, {35408, 6}, {36977, 4}, {39461, 5}, {40326, 6}, {42113, 5}, {43979, 6}, {44943, 4}, {45928, 5}, {46934, 4}, {47962, 5}, {49013, 6}, {51184, 4}, {54622, 5}, {55819, 6}, {57042, 5}, {58292, 6}, {60874, 4}, {62207, 5}, {63570, 6}, {64963, 7}, {66386, 6}, {67840, 7}, {70845, 8}, {72397, 6}, {78952, 4}, {80681, 3}, {82448, 4}, {86099, 5}, {87985, 3}, {95949, 4}, {MP_SIZE_T_MAX,0}}
#define MUL_FFT_FULL_TABLE2 {{16, 2}, {1045, 1}, {1092, 2}, {1116, 3}, {1166, 1}, {1192, 2}, {1219, 1}, {1302, 2}, {1331, 1}, {1519, 3}, {1553, 1}, {1588, 3}, {1623, 4}, {1659, 1}, {1734, 4}, {1772, 2}, {1811, 1}, {1851, 3}, {1934, 6}, {1977, 5}, {2021, 2}, {2112, 4}, {2207, 1}, {2306, 4}, {2357, 5}, {2409, 1}, {2629, 3}, {2687, 1}, {2869, 2}, {2997, 1}, {3063, 2}, {3131, 5}, {3200, 1}, {3343, 4}, {3417, 3}, {3492, 1}, {3728, 4}, {3810, 1}, {3894, 2}, {3980, 3}, {4068, 1}, {4158, 2}, {4250, 3}, {4344, 2}, {4538, 4}, {4740, 3}, {4844, 4}, {4951, 1}, {5285, 2}, {5401, 1}, {6022, 2}, {6427, 4}, {6568, 1}, {6859, 4}, {7010, 1}, {7164, 3}, {7321, 4}, {7646, 1}, {7814, 3}, {7986, 5}, {8340, 4}, {8523, 6}, {8710, 3}, {8901, 2}, {9096, 5}, {9296, 4}, {9922, 3}, {10140, 1}, {10363, 3}, {10590, 2}, {10822, 3}, {11059, 1}, {11302, 2}, {11550, 1}, {12327, 2}, {12597, 3}, {12873, 6}, {13155, 5}, {13444, 4}, {14040, 1}, {14348, 3}, {14663, 6}, {14985, 9}, {15314, 10}, {15650, 8}, {16344, 7}, {16702, 10}, {17442, 11}, {17824, 8}, {18215, 10}, {18614, 13}, {19022, 15}, {19439, 11}, {19865, 13}, {20300, 12}, {20745, 13}, {21665, 14}, {22140, 13}, {22625, 14}, {23121, 10}, {23628, 9}, {24146, 8}, {24675, 9}, {26334, 6}, {26911, 5}, {27501, 1}, {28104, 4}, {29349, 1}, {45274, 2}, {46266, 1}, {48316, 2}, {50456, 1}, {51561, 2}, {52691, 1}, {53845, 2}, {55025, 1}, {57462, 2}, {58721, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 1}, {69835, 3}, {72928, 2}, {74525, 1}, {76157, 3}, {77825, 1}, {79530, 3}, {83052, 1}, {88630, 2}, {94582, 1}, {103145, 4}, {105404, 3}, {110072, 5}, {112483, 3}, {114947, 4}, {117465, 1}, {120038, 4}, {122667, 3}, {125354, 2}, {128099, 5}, {130905, 2}, {136702, 5}, {139696, 6}, {142755, 2}, {145881, 3}, {149076, 4}, {155677, 3}, {173486, 4}, {177285, 2}, {181168, 5}, {185136, 6}, {189190, 2}, {197567, 4}, {206315, 7}, {210833, 8}, {220168, 11}, {224990, 9}, {229917, 8}, {234952, 4}, {245355, 6}, {250728, 3}, {256219, 6}, {261830, 5}, {273423, 2}, {279411, 4}, {285530, 2}, {298173, 3}, {304703, 5}, {311376, 4}, {318195, 2}, {325163, 5}, {332284, 6}, {339561, 3}, {346997, 4}, {370296, 6}, {386691, 9}, {395159, 8}, {403812, 7}, {412655, 6}, {421691, 5}, {430925, 2}, {440362, 4}, {450005, 6}, {459859, 2}, {469929, 3}, {480220, 6}, {501482, 5}, {512464, 4}, {535154, 2}, {546873, 3}, {558848, 6}, {571086, 2}, {583592, 3}, {609431, 4}, {622776, 2}, {636414, 4}, {694016, 3}, {709213, 2}, {724743, 3}, {740613, 4}, {790340, 6}, {807647, 5}, {825333, 3}, {843406, 4}, {861875, 6}, {880748, 3}, {919743, 4}, {939883, 3}, {960464, 5}, {981496, 3}, {MP_SIZE_T_MAX,0}}

View File

@ -1,24 +1,24 @@
/* Generated by tuneup.c, 2009-04-14, system compiler */
/* Generated by tuneup.c, 2009-05-06, system compiler */
#define MUL_KARATSUBA_THRESHOLD 16
#define MUL_TOOM3_THRESHOLD 114
#define MUL_TOOM4_THRESHOLD 507
#define MUL_TOOM7_THRESHOLD 507
#define MUL_TOOM3_THRESHOLD 113
#define MUL_TOOM4_THRESHOLD 502
#define MUL_TOOM7_THRESHOLD 502
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_KARATSUBA_THRESHOLD 28
#define SQR_TOOM3_THRESHOLD 179
#define SQR_KARATSUBA_THRESHOLD 26
#define SQR_TOOM3_THRESHOLD 177
#define MULLOW_BASECASE_THRESHOLD 7
#define MULLOW_DC_THRESHOLD 78
#define MULLOW_MUL_N_THRESHOLD 390
#define MULLOW_BASECASE_THRESHOLD 6
#define MULLOW_DC_THRESHOLD 79
#define MULLOW_MUL_N_THRESHOLD 378
#define DIV_SB_PREINV_THRESHOLD 0 /* always */
#define DIV_DC_THRESHOLD 94
#define POWM_THRESHOLD 83
#define DIV_DC_THRESHOLD 93
#define POWM_THRESHOLD 79
#define GCD_ACCEL_THRESHOLD 20
#define GCDEXT_THRESHOLD 197
#define GCD_ACCEL_THRESHOLD 16
#define GCDEXT_THRESHOLD 155
#define JACOBI_BASE_METHOD 1
#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
@ -35,12 +35,22 @@
#define GET_STR_PRECOMPUTE_THRESHOLD 11
#define SET_STR_THRESHOLD 7764
#define MUL_FFT_TABLE { 464, 1056, 2368, 3840, 11264, 28672, 0 }
#define MUL_FFT_MODF_THRESHOLD 480
#define MUL_FFT_THRESHOLD 7680
#define MUL_FFT_TABLE { 432, 864, 2368, 2816, 7168, 20480, 0 }
#define MUL_FFT_MODF_THRESHOLD 1120
#define MUL_FFT_THRESHOLD 5760
#define SQR_FFT_TABLE { 592, 1184, 2368, 3840, 11264, 28672, 0 }
#define SQR_FFT_MODF_THRESHOLD 488
#define SQR_FFT_THRESHOLD 3456
#define SQR_FFT_TABLE { 432, 928, 2496, 2816, 7168, 36864, 0 }
#define SQR_FFT_MODF_THRESHOLD 1120
#define SQR_FFT_THRESHOLD 5408
/* Tuneup completed successfully, took 12 seconds */
/* Tuneup completed successfully, took 202 seconds */
#define MUL_FFT_TABLE2 {{1, 2}, {248, 3}, {254, 2}, {299, 3}, {306, 2}, {360, 3}, {368, 2}, {760, 3}, {777, 2}, {831, 3}, {869, 2}, {971, 3}, {993, 2}, {1015, 3}, {1038, 2}, {1085, 3}, {1109, 4}, {1159, 2}, {1211, 3}, {1238, 2}, {1266, 3}, {1294, 4}, {1323, 2}, {1444, 3}, {1476, 2}, {1799, 3}, {1839, 2}, {2098, 3}, {2144, 2}, {2392, 3}, {2445, 2}, {2668, 3}, {2727, 2}, {2787, 3}, {2849, 2}, {2912, 3}, {3042, 2}, {3109, 3}, {3248, 4}, {3320, 5}, {3468, 6}, {3544, 5}, {3622, 3}, {3784, 2}, {4504, 3}, {4603, 2}, {4808, 3}, {4914, 4}, {5022, 3}, {5245, 2}, {5478, 3}, {5721, 2}, {5976, 3}, {6107, 2}, {6378, 3}, {6518, 2}, {7110, 3}, {7756, 4}, {7926, 3}, {8100, 2}, {9431, 3}, {10066, 4}, {10287, 5}, {10513, 6}, {10744, 7}, {11221, 8}, {11467, 7}, {11719, 8}, {12507, 9}, {12781, 8}, {13347, 9}, {13939, 10}, {14876, 8}, {15202, 9}, {15876, 8}, {16224, 9}, {16944, 8}, {17316, 9}, {18480, 8}, {18885, 9}, {19722, 10}, {20596, 9}, {21047, 10}, {21508, 9}, {21979, 10}, {23970, 9}, {25581, 10}, {26715, 8}, {27300, 9}, {29134, 10}, {29772, 11}, {31091, 9}, {33179, 10}, {36977, 11}, {37787, 9}, {38615, 10}, {41210, 11}, {42113, 10}, {43036, 11}, {43979, 10}, {46934, 11}, {47962, 10}, {49013, 11}, {50087, 10}, {52305, 11}, {54622, 12}, {55819, 11}, {57042, 12}, {58292, 11}, {62207, 12}, {63570, 10}, {69326, 11}, {70845, 10}, {72397, 11}, {75604, 10}, {77260, 11}, {87985, 10}, {89912, 11}, {MP_SIZE_T_MAX,0}}
#define MUL_FFTM_TABLE2 {{1, 2}, {220, 3}, {225, 2}, {242, 3}, {248, 2}, {568, 3}, {581, 2}, {608, 3}, {622, 2}, {909, 3}, {971, 2}, {1015, 3}, {1061, 2}, {1109, 3}, {1134, 2}, {1185, 3}, {1211, 4}, {1238, 2}, {1266, 3}, {1294, 4}, {1323, 2}, {1382, 3}, {1413, 2}, {1444, 3}, {1476, 2}, {1685, 3}, {1722, 4}, {1799, 5}, {1839, 4}, {1880, 3}, {1965, 2}, {2340, 3}, {2445, 4}, {2499, 2}, {2610, 3}, {2668, 2}, {2727, 3}, {2849, 2}, {3320, 3}, {3393, 2}, {3468, 3}, {3544, 2}, {3622, 3}, {3702, 2}, {4128, 3}, {4219, 2}, {4504, 3}, {4603, 2}, {4704, 3}, {4808, 2}, {4914, 3}, {5245, 4}, {5360, 3}, {5478, 2}, {5598, 3}, {5721, 2}, {6241, 3}, {6378, 4}, {6518, 5}, {6661, 6}, {6807, 4}, {6957, 5}, {7110, 6}, {7266, 7}, {7589, 5}, {7756, 3}, {7926, 2}, {8100, 3}, {8460, 2}, {8646, 3}, {8836, 4}, {9030, 3}, {9228, 2}, {9431, 3}, {9850, 2}, {10066, 3}, {10744, 2}, {11221, 3}, {11467, 2}, {11719, 3}, {12507, 4}, {13061, 3}, {13347, 2}, {13939, 3}, {14245, 4}, {14557, 5}, {15535, 6}, {15876, 7}, {16580, 8}, {17696, 9}, {18084, 8}, {18480, 9}, {18885, 10}, {19299, 9}, {19722, 10}, {20154, 9}, {21047, 8}, {21508, 9}, {21979, 10}, {23456, 9}, {23970, 10}, {25032, 11}, {25581, 10}, {27300, 11}, {27898, 9}, {28509, 10}, {29772, 9}, {30424, 10}, {31091, 9}, {31772, 10}, {36184, 9}, {36977, 10}, {42113, 11}, {43979, 9}, {44943, 10}, {45928, 11}, {47962, 10}, {52305, 11}, {53451, 12}, {58292, 11}, {60874, 12}, {62207, 10}, {72397, 11}, {80681, 10}, {82448, 11}, {93893, 12}, {95949, 11}, {98051, 12}, {MP_SIZE_T_MAX,0}}
#define SQR_FFT_TABLE2 {{1, 2}, {328, 3}, {336, 2}, {360, 3}, {368, 2}, {433, 3}, {443, 2}, {453, 3}, {463, 2}, {555, 3}, {568, 2}, {650, 3}, {665, 2}, {680, 3}, {711, 2}, {777, 3}, {795, 2}, {1109, 3}, {1159, 2}, {1185, 3}, {1211, 2}, {1352, 3}, {1382, 4}, {1413, 3}, {1444, 2}, {1577, 3}, {1648, 2}, {1685, 3}, {1722, 2}, {1880, 3}, {1922, 4}, {1965, 2}, {2053, 3}, {2098, 4}, {2239, 3}, {2289, 2}, {2340, 3}, {2392, 2}, {2499, 3}, {2554, 2}, {2787, 3}, {2976, 2}, {3393, 3}, {3468, 2}, {3622, 3}, {3702, 2}, {4039, 3}, {4219, 2}, {4312, 3}, {4603, 2}, {5022, 3}, {5132, 2}, {5360, 3}, {5478, 2}, {5598, 3}, {5721, 2}, {5976, 3}, {6107, 4}, {6241, 3}, {6378, 2}, {6661, 3}, {6957, 2}, {7110, 3}, {7426, 2}, {7756, 3}, {8100, 4}, {8278, 2}, {8460, 3}, {9030, 2}, {9431, 3}, {9638, 2}, {9850, 3}, {10513, 4}, {10744, 2}, {10980, 3}, {11467, 2}, {11976, 3}, {12239, 4}, {12781, 3}, {13061, 2}, {13640, 3}, {13939, 4}, {14245, 5}, {14557, 4}, {14876, 3}, {15876, 4}, {16580, 3}, {16944, 4}, {17316, 3}, {17696, 2}, {18084, 3}, {18885, 2}, {19299, 3}, {19722, 2}, {20154, 3}, {20596, 4}, {21508, 3}, {21979, 4}, {22461, 5}, {25032, 3}, {25581, 4}, {27300, 3}, {27898, 4}, {31091, 3}, {32468, 2}, {33179, 3}, {33906, 4}, {34649, 2}, {36977, 3}, {38615, 4}, {39461, 3}, {41210, 4}, {42113, 5}, {43979, 6}, {45928, 5}, {50087, 6}, {52305, 7}, {53451, 8}, {54622, 9}, {55819, 10}, {57042, 11}, {58292, 12}, {59569, 11}, {60874, 12}, {63570, 11}, {64963, 9}, {66386, 10}, {73983, 11}, {75604, 10}, {77260, 11}, {80681, 10}, {84254, 11}, {91881, 12}, {93893, 11}, {98051, 10}, {MP_SIZE_T_MAX,0}}
#define SQR_FFTM_TABLE2 {{1, 2}, {443, 3}, {453, 2}, {496, 3}, {507, 2}, {636, 3}, {650, 2}, {665, 3}, {680, 2}, {743, 3}, {760, 2}, {777, 3}, {813, 2}, {1061, 3}, {1085, 2}, {1159, 3}, {1211, 2}, {1323, 3}, {1352, 2}, {1382, 3}, {1413, 2}, {1444, 3}, {1476, 2}, {1509, 3}, {1543, 2}, {1612, 3}, {1648, 2}, {1799, 3}, {1839, 2}, {2009, 3}, {2053, 2}, {2098, 3}, {2144, 4}, {2191, 3}, {2392, 2}, {2554, 3}, {2668, 2}, {2849, 3}, {2976, 2}, {4312, 3}, {4407, 2}, {4808, 3}, {5360, 2}, {5598, 3}, {5721, 4}, {5847, 3}, {5976, 2}, {6241, 3}, {6378, 2}, {6518, 3}, {6661, 4}, {6807, 3}, {7266, 4}, {7426, 2}, {7926, 3}, {8100, 2}, {8278, 3}, {8460, 4}, {9228, 2}, {9850, 3}, {10066, 2}, {10513, 3}, {10744, 4}, {11467, 3}, {11719, 2}, {11976, 3}, {12507, 2}, {13640, 3}, {13939, 2}, {14876, 3}, {16224, 2}, {16580, 3}, {16944, 4}, {17316, 2}, {17696, 3}, {18480, 2}, {19299, 3}, {19722, 2}, {20154, 3}, {20596, 4}, {21047, 3}, {21508, 2}, {22461, 3}, {23456, 4}, {24495, 5}, {25032, 4}, {25581, 2}, {26142, 3}, {26715, 4}, {27300, 2}, {29134, 3}, {29772, 4}, {30424, 5}, {31091, 6}, {31772, 4}, {34649, 2}, {35408, 3}, {36184, 4}, {37787, 5}, {38615, 6}, {39461, 7}, {40326, 6}, {41210, 7}, {42113, 8}, {43036, 9}, {45928, 10}, {52305, 11}, {54622, 10}, {57042, 11}, {58292, 12}, {63570, 11}, {64963, 10}, {66386, 11}, {70845, 10}, {73983, 11}, {80681, 10}, {86099, 11}, {95949, 10}, {98051, 11}, {MP_SIZE_T_MAX,0}}
#define MUL_FFT_FULL_TABLE2 {{16, 2}, {1045, 1}, {1068, 2}, {1092, 1}, {1141, 2}, {1192, 1}, {1331, 4}, {1361, 2}, {1391, 4}, {1422, 2}, {1454, 1}, {1486, 3}, {1553, 5}, {1588, 2}, {1623, 1}, {1696, 3}, {1734, 1}, {1892, 4}, {1934, 6}, {2021, 5}, {2159, 2}, {2207, 3}, {2462, 1}, {2516, 2}, {2746, 5}, {2807, 2}, {2869, 4}, {2932, 3}, {2997, 6}, {3063, 5}, {3200, 4}, {3271, 3}, {3343, 1}, {3417, 3}, {3492, 1}, {3728, 2}, {3980, 5}, {4158, 4}, {4538, 1}, {4638, 3}, {4740, 5}, {4844, 3}, {4951, 1}, {5060, 2}, {5171, 1}, {5285, 2}, {5641, 4}, {5765, 5}, {5892, 6}, {7010, 4}, {7164, 6}, {7482, 5}, {7814, 6}, {7986, 5}, {8161, 6}, {8340, 5}, {8523, 6}, {8710, 5}, {8901, 6}, {9096, 5}, {9296, 6}, {9500, 3}, {9709, 6}, {9922, 2}, {11803, 5}, {12062, 7}, {12327, 10}, {12597, 11}, {12873, 12}, {13155, 14}, {13444, 10}, {13739, 11}, {14040, 13}, {14663, 16}, {14985, 17}, {15314, 14}, {15650, 16}, {15993, 13}, {16344, 15}, {16702, 18}, {17068, 20}, {17442, 22}, {17824, 18}, {18614, 15}, {19022, 17}, {19439, 20}, {20300, 19}, {20745, 17}, {21200, 16}, {21665, 17}, {22140, 19}, {22625, 18}, {23121, 16}, {23628, 18}, {24675, 19}, {25216, 16}, {26334, 12}, {26911, 13}, {27501, 16}, {28104, 18}, {29349, 17}, {29992, 18}, {30649, 14}, {31321, 16}, {32007, 12}, {32708, 13}, {33425, 9}, {34157, 10}, {34905, 13}, {35670, 9}, {36452, 10}, {38901, 11}, {40624, 8}, {41514, 4}, {42424, 1}, {45274, 2}, {47280, 3}, {48316, 1}, {49374, 3}, {50456, 2}, {51561, 3}, {53845, 1}, {56230, 4}, {57462, 1}, {62664, 2}, {64037, 1}, {65440, 2}, {66873, 4}, {68338, 2}, {71365, 3}, {72928, 1}, {76157, 2}, {77825, 1}, {81272, 3}, {83052, 1}, {84871, 3}, {86730, 2}, {88630, 1}, {90571, 2}, {92555, 1}, {94582, 2}, {98771, 4}, {100934, 2}, {103145, 1}, {120038, 4}, {122667, 1}, {128099, 2}, {136702, 3}, {139696, 1}, {159086, 3}, {162570, 2}, {166130, 1}, {169768, 2}, {173486, 1}, {332284, 2}, {339561, 1}, {512464, 3}, {523686, 5}, {535154, 4}, {546873, 1}, {558848, 3}, {571086, 1}, {609431, 4}, {622776, 2}, {664591, 1}, {694016, 4}, {740613, 2}, {756831, 3}, {773404, 6}, {790340, 5}, {807647, 1}, {825333, 4}, {843406, 2}, {880748, 1}, {919743, 2}, {960464, 1}, {981496, 2}, {MP_SIZE_T_MAX,0}}

View File

@ -1,22 +1,5 @@
;
; YASM macros for handling Windows Prologues and Epilogues
;
; Copyright 2008, 2009 Brian Gladman
;
; Windows x64 prologue macro
;
; prologue name, stack_slots, register_save_list
;
; name: routine name
; register_save_list: comma separated list of registers to save
; stack_slots: stack space needed in 8 byte units
; Windows x64 epilogue macro
;
; epilogue register_save_list
;
; register_save_list: comma separated list of registers to save
; in same order used in prologue
; Standardised register numbering scheme
%define r0 rax
%define r1 rdx
@ -54,10 +37,37 @@
%define r6b bpl
%define r7b spl
; Standard macro for alignment (used to allow easy subsititution of
; alternative padding schemes)
%macro xalign 1
align %1
%endmacro
; YASM macros for handling Windows Prologues and Epilogues
;
; Copyright 2008, 2009 Brian Gladman
;
; Windows x64 prologue macro
;
; prologue name, stack_slots, register_save_list
;
; name: routine name
; register_save_list: comma separated list of registers to save
; stack_slots: stack space needed in 8 byte units
; Windows x64 epilogue macro
;
; epilogue register_save_list
;
; register_save_list: comma separated list of registers to save
; in same order used in prologue
;
; On return the macro variable 'stack_use' gives the total number
; of bytes used on the stack. This allows the function parameters
; to be accessed at [rsp + stack_use + 8 * n] where n starts at 1
; (for n = 1..4 this is shadow space for a register parameter)
%macro FRAME_PROC 2-*
global __g%1
@ -151,9 +161,16 @@ __g%1:
; WIN64_GCC_END frame | leaf
;
; name subroutine name
; type subroutine type (frame or leaf)
; parms number of parameters
; n_parms number of parameters (default 6)
; type frame or leaf function (default frame)
;
; These defines are also used:
;
; reg_save_list list of registers to be saved
; and restored
; stack_slots number of 8 byte slots needed
; on the stack (excluding the
; register save/restore space)
%macro WIN64_GCC_PROC 1-3 6, frame