From 8357cb440cfd7678784a186f04ca7375b1fe669c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BA=BDn?= Date: Tue, 23 Oct 2012 15:49:28 +0200 Subject: [PATCH] Remove suprious printing. Ensure -msse is only passed if sse instructions are supported. --- src/Makefile | 10 ++++++++-- src/static_bitsequence/sdarray.cpp | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 9812eac..b1165d6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,14 +1,20 @@ 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 -#POPCOUNT_FLAG=-DHAS_POPCOUNT_TABLE POPCOUNT_FLAG= endif -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 INCL=-I../includes/ diff --git a/src/static_bitsequence/sdarray.cpp b/src/static_bitsequence/sdarray.cpp index 30cdf9e..d0a4066 100644 --- a/src/static_bitsequence/sdarray.cpp +++ b/src/static_bitsequence/sdarray.cpp @@ -265,7 +265,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) { int i,m; int nl; int p,pp; - int il,is,ml,ms; + int il,is,ms,ml; int r; uint *s; @@ -302,6 +302,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) { for(int k=0;kp[k]=0; select->size += (nl+1)*sizeof(uint); + for (r = 0; r < 2; r++) { ml = ms = 0; for (il = 0; il < nl; il++) { @@ -309,7 +310,8 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) { select->lp[il] = pp; i = min((il+1)*L-1,m-1); p = s[i]; - //printf("%d ",p-pp); + // printf("p-pp=%d, LL=%d\n",p-pp, LL); + if (p - pp >= LL) { if (r == 1) { for (is = 0; is < L; is++) { @@ -317,6 +319,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) { select->sl[ml*L+is] = s[il*L+is]; } } + select->p[il] = -((ml<sl = new uint[ml*L+1]; for(int k=0;ksl[k]=0; -- 2.17.1