1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/Makefile ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/Makefile
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/Makefile 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/Makefile 2016-01-11 10:45:40.485257844 +0200
@@ -7,7 +7,10 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-CFLAGS= -O3 -march=k8 -mtune=k8 -I.
+#CFLAGS= -O3 -march=k8 -mtune=k8 -I.
+#CFLAGS= -O3 -march=native -mtune=native -I. -fPIC -fstack-protector-strong
+CFLAGS= -O3 -march=native -mtune=native -I. -fstack-protector-strong -static
+#LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" # -call_shared"
#CFLAGS= -g
CC=gcc
@@ -144,3 +147,6 @@
bup:
echo $(SRCFILES)
+
+clean:
+ -rm -f *.o *.a
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/mpqs_td.asm ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/mpqs_td.asm
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/mpqs_td.asm 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/mpqs_td.asm 2016-01-11 10:45:40.485257844 +0200
@@ -290,7 +290,7 @@
mull %ecx
testl %edx,%edx
jnz tdloop
- cmpw $27,nr
+ cmpw $27,nrw # KH
jnc gotonext
movl aux4d,%eax
movw aux5w,10(relptr,nr,2)
@@ -321,10 +321,10 @@
mull %ecx
testl %edx,%edx
jnz tdloopk
- cmpw $27,nr
+ cmpw $27,nrw # KH
jnc gotonext
movl aux4d,%eax
- movw nr1,10(relptr,nr,2)
+ movw nr1w,10(relptr,nr,2) # KH
incq nr
movl aux4d,qxd
jmp divloopk
@@ -354,7 +354,7 @@
testl %edx,%edx
jnz tdloopa
movl aux4d,%eax
- cmpw $27,nr
+ cmpw $27,nrw # KH
jnc gotonext
addw nr1w,aux5w
movw aux5w,10(relptr,nr,2)
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie1.asm ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie1.asm
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie1.asm 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie1.asm 2016-01-11 10:45:40.485257844 +0200
@@ -10,6 +10,7 @@
define(sieve_ptr,%r8)dnl
define(sieve_ptr_ub,%r9)dnl
define(root,%r10)dnl
+define(rootw,%r10w)dnl
define(prime,%r11)dnl
define(prime32,%r11d)dnl
define(sv0,%al)dnl
@@ -58,7 +59,7 @@
jnz tdslinie1_suche
tdslinie1_nextfbi:
cmpq aux_ptr,aux_ptr_ub
- movw root,root_src
+ movw rootw,root_src # KH
leaq 8(aux_ptr),aux_ptr
ja tdslinie1_fbi_loop
tdslinie1_ende:
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie2.asm ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie2.asm
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie2.asm 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie2.asm 2016-01-11 10:45:40.485257844 +0200
@@ -10,6 +10,7 @@
define(sieve_ptr,%r8)dnl
define(sieve_ptr_ub,%r9)dnl
define(root,%r10)dnl
+define(rootw,%r10w)dnl
define(prime,%r11)dnl
define(prime32,%r11d)dnl
define(sv0,%al)dnl
@@ -57,7 +58,7 @@
jnz tdslinie2_suche
tdslinie2_next_fbi:
cmpq aux_ptr,aux_ptr_ub
- movw root,root_src
+ movw rootw,root_src # KH
leaq 8(aux_ptr),aux_ptr
ja tdslinie2_fbi_loop
tdslinie2_ende:
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie3.asm ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie3.asm
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie3.asm 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie3.asm 2016-01-11 10:45:40.485257844 +0200
@@ -7,6 +7,7 @@
define(sieve_ptr,%r8)dnl
define(sieve_ptr_ub,%r9)dnl
define(root,%r10)dnl
+define(rootw,%r10w)dnl
define(prime,%r11)dnl
define(prime32,%r11d)dnl
define(sv0,%al)dnl
@@ -73,7 +74,7 @@
tdslinie3_next_j`'i:
')
cmpq aux_ptr,aux_ptr_ub
- movw root,root_src
+ movw rootw,root_src # KH
leaq 8(aux_ptr),aux_ptr
ja tdslinie3_fbi_loop
tdslinie3_ende:
diff -aur ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie.asm ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie.asm
--- ggnfs-code/src/experimental/lasieve4_64/athlon64/tdslinie.asm 2016-01-10 22:14:26.958067416 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/athlon64/tdslinie.asm 2016-01-11 10:45:40.485257844 +0200
@@ -10,6 +10,7 @@
define(sieve_ptr,%r8)dnl
define(sieve_ptr_ub,%r9)dnl
define(root,%r10)dnl
+define(rootw,%r10w)dnl
define(prime,%r11)dnl
define(prime32,%r11d)dnl
define(sv0,%al)dnl
@@ -115,7 +116,7 @@
tdslinie_next_j`'i:
')
cmpq aux_ptr,aux_ptr_ub
- movw root,root_src
+ movw rootw,root_src # KH
leaq 8(aux_ptr),aux_ptr
ja tdslinie_fbi_loop
tdslinie_ende:
diff -aur ggnfs-code/src/experimental/lasieve4_64/Makefile ggnfs-code-hack/src/experimental/lasieve4_64/Makefile
--- ggnfs-code/src/experimental/lasieve4_64/Makefile 2016-01-10 22:14:26.818069850 +0200
+++ ggnfs-code-hack/src/experimental/lasieve4_64/Makefile 2016-01-11 10:45:40.485257844 +0200
@@ -8,11 +8,16 @@
# 02111-1307, USA.
#
# 6/13/04: Hacked up for use in GGNFS by Chris Monico.
+# 2016-01-11: Altered for native (static) binaries on i7. YMMW. K. Hampf <k.hampf@gmail.com>
INC=-I. -I./asm
-LIBFLAGS=-L.
+LIBFLAGS=-L.
#CFLAGS=-Os -march=amdfam10 -mtune=amdfam10 -funroll-loops
-CFLAGS=-O3 -march=k8 -mtune=k8 -funroll-loops
+#CFLAGS=-O3 -march=k8 -mtune=k8 -funroll-loops
+#CFLAGS=-O3 -march=native -mtune=native -funroll-loops -fPIC -fstack-protector-strong
+CFLAGS=-O3 -march=native -mtune=native -funroll-loops -fstack-protector-strong -static
+LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
+BINDIR=../../../bin
.SUFFIXES:
@@ -29,10 +34,12 @@
LIBS=-lgmp-aux -lgmp -lm
+all : $(BINDIR)/gnfs-lasieve4I11e $(BINDIR)/gnfs-lasieve4I12e \
+ $(BINDIR)/gnfs-lasieve4I13e $(BINDIR)/gnfs-lasieve4I14e \
+ $(BINDIR)/gnfs-lasieve4I15e $(BINDIR)/gnfs-lasieve4I16e
-all : gnfs-lasieve4I11e gnfs-lasieve4I12e gnfs-lasieve4I13e \
- gnfs-lasieve4I14e gnfs-lasieve4I15e gnfs-lasieve4I16e
-
+asm/%:
+ $(MAKE) -C asm $*
%.o: %.c asm/siever-config.h
$(CC) $(CFLAGS) $(INC) -c -o $@ $<
@@ -46,23 +53,23 @@
gnfs-lasieve4eI%.o: gnfs-lasieve4e.c
$(CC) $(CFLAGS) $(INC) -c -DI_bits=$* -o $@ $<
-gnfs-lasieve4I11e: gnfs-lasieve4eI11.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI11.a
+$(BINDIR)/gnfs-lasieve4I11e: gnfs-lasieve4eI11.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI11.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
-gnfs-lasieve4I12e: gnfs-lasieve4eI12.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI12.a
+$(BINDIR)/gnfs-lasieve4I12e: gnfs-lasieve4eI12.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI12.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
-gnfs-lasieve4I13e: gnfs-lasieve4eI13.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI13.a
+$(BINDIR)/gnfs-lasieve4I13e: gnfs-lasieve4eI13.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI13.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
-gnfs-lasieve4I14e: gnfs-lasieve4eI14.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI14.a
+$(BINDIR)/gnfs-lasieve4I14e: gnfs-lasieve4eI14.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI14.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
-gnfs-lasieve4I15e: gnfs-lasieve4eI15.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI15.a
+$(BINDIR)/gnfs-lasieve4I15e: gnfs-lasieve4eI15.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI15.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
-gnfs-lasieve4I16e: gnfs-lasieve4eI16.o $(OBJS) libgmp-aux.a \
- liblasieve.a liblasieveI16.a
+$(BINDIR)/gnfs-lasieve4I16e: gnfs-lasieve4eI16.o $(OBJS) libgmp-aux.a \
+ asm/liblasieve.a asm/liblasieveI16.a
$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS) -static
|