Ensure -msse is only passed if sse instructions are supported.
CPP=g++
POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1)
CPP=g++
POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1)
+SSE=$(shell grep -q sse /proc/cpuinfo && echo 1)
ifeq ($(POPCOUNT), 1)
POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt
else
ifeq ($(POPCOUNT), 1)
POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt
else
-#POPCOUNT_FLAG=-DHAS_POPCOUNT_TABLE
-CPPFLAGS=-O3 -Wall -DNDEBUG -fno-PIC $(POPCOUNT_FLAG) -g -msse
+ifeq ($(SSE), 1)
+ SSE_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt
+else
+ SSE_FLAG=-msse
+endif
+
+CPPFLAGS=-O3 -Wall -DNDEBUG -fno-PIC $(POPCOUNT_FLAG) $(SSE_FLAG) -g
int i,m;
int nl;
int p,pp;
int i,m;
int nl;
int p,pp;
for(int k=0;k<nl+1;k++) select->p[k]=0;
select->size += (nl+1)*sizeof(uint);
for(int k=0;k<nl+1;k++) select->p[k]=0;
select->size += (nl+1)*sizeof(uint);
for (r = 0; r < 2; r++) {
ml = ms = 0;
for (il = 0; il < nl; il++) {
for (r = 0; r < 2; r++) {
ml = ms = 0;
for (il = 0; il < nl; il++) {
select->lp[il] = pp;
i = min((il+1)*L-1,m-1);
p = s[i];
select->lp[il] = pp;
i = min((il+1)*L-1,m-1);
p = s[i];
+ // printf("p-pp=%d, LL=%d\n",p-pp, LL);
+
if (p - pp >= LL) {
if (r == 1) {
for (is = 0; is < L; is++) {
if (p - pp >= LL) {
if (r == 1) {
for (is = 0; is < L; is++) {
select->sl[ml*L+is] = s[il*L+is];
}
}
select->sl[ml*L+is] = s[il*L+is];
}
}
select->p[il] = -((ml<<logL)+1);
ml++;
}
select->p[il] = -((ml<<logL)+1);
ml++;
}
if (r == 0) {
select->sl = new uint[ml*L+1];
for(int k=0;k<ml*L+1;k++) select->sl[k]=0;
if (r == 0) {
select->sl = new uint[ml*L+1];
for(int k=0;k<ml*L+1;k++) select->sl[k]=0;