diff --git a/ext/beplug_.h b/ext/beplug_.h index 668e5e6..65a6bc3 100644 --- a/ext/beplug_.h +++ b/ext/beplug_.h @@ -90,7 +90,7 @@ extern "C" { } #endif - #if C_SIMDCOMP + #if C_SIMDCOMP128 #undef SIMDBITPACKING_H_ #include "vabyte.h" // Standard Variable Byte #include "simdcomp/include/simdcomp.h" @@ -112,7 +112,9 @@ unsigned char *simdfor_selectx( unsigned char *__restrict in, unsigned n, unsign unsigned i; for(i=0; i < n;i++) out[i] = simdselectFOR(start, (const __m128i *)in, b, i); return in + simdpackFOR_compressedbytes(n, b); } - #ifdef __AVX2__ + #endif + #if C_SIMDCOMP256 +#undef SIMDBITPACKING_H_ unsigned char *avxpackwithoutmaskn(uint32_t *in, uint32_t n, uint32_t *out, uint32_t b) { uint32_t *ip; for(ip = in; ip != in+(n&~(256-1)); ip += 256,out += 8 * b) @@ -125,7 +127,6 @@ unsigned char *avxunpackn(uint32_t *in, uint32_t n, uint32_t *out, uint32_t b) { avxunpack((__m256i *)in, op, b); return (unsigned char *)simdunpack_shortlength((__m128i *)in, n & (256-1), op, b); } - #endif #endif #if C_BITSHUFFLE diff --git a/ext/beplugc_.c b/ext/beplugc_.c index cadbf37..8e14c1d 100644 --- a/ext/beplugc_.c +++ b/ext/beplugc_.c @@ -82,16 +82,15 @@ case P_QMX: { JASS::compress_integer_qmx_improved qmx; unsigned r=qmx.encode(out+4, outsize, (uint32_t *)in, n); ctou32(out)=r; return out+4+r; } #endif - #if C_SIMDCOMP + #if C_SIMDCOMP128 //case SC_PACK: if(b < 0) { b = maxbits_length(in,n); *out++ = b; } return fastpackwithoutmask32(in, n, (uint32_t *)out, b); case SC_FOR: case SC_FORDA: case SC_SIMDPACK128:if(b < 0) b = maxbits(in), *out++ = b; return (unsigned char *)simdpack_length(in, n, (__m128i *)out, b); - #ifdef __AVX2__ - case SC_SIMDPACK256:if(b < 0) b = avxmaxbits(in), *out++ = b; return (unsigned char *)avxpackwithoutmaskn(in, n, (unsigned *)out, b); - #endif #endif - + #if C_SIMDCOMP256 + case SC_SIMDPACK256:if(b < 0) b = avxmaxbits(in), *out++ = b; return (unsigned char *)avxpackwithoutmaskn(in, n, (unsigned *)out, b); + #endif #if C_STREAMVBYTE case P_STREAMVBYTE: return out + streamvbyte_encode(in, n, out); #endif diff --git a/ext/beplugd_.c b/ext/beplugd_.c index 1e5aa6b..6d9cbde 100644 --- a/ext/beplugd_.c +++ b/ext/beplugd_.c @@ -18,7 +18,7 @@ return (unsigned char *)ip; } - case FP_SIMDFASTPFOR: { + case FP_SIMDFASTPFOR: { size_t nvalue = n; FastPForLib::SIMDFastPFor<4> ic; const uint32_t *ip = ic.decodeArray((const uint32_t *)(in+4), ctou32(in), out, nvalue); if(n & 127) { @@ -81,14 +81,14 @@ case PC_OPTPFD : return optpfddec32( in, n, out); //if(n < 128) return vbytedec(in, n, out); else { unsigned all_array[2048]; return (unsigned char *)detailed_p4_decode(out, (unsigned *)in, all_array); } #endif - #if C_SIMDCOMP + #if C_SIMDCOMP128 //case SC_PACK: if(b < 0) b = *in++; return fastunpack32((uint32_t *)in, n, out, b); case SC_FOR: case SC_SIMDPACK128: if(b < 0) b = *in++; return (unsigned char *)simdunpack_length( (__m128i *)in, n, out, b); case SC_FORDA: if(b < 0) b = *in++; return simdfor_selectx(in, n, out, 0, b); - #ifdef __AVX2__ + #endif + #if C_SIMDCOMP256 case SC_SIMDPACK256: if(b < 0) b = *in++; return (unsigned char *)avxunpackn( (unsigned *)in, n, out, b); - #endif #endif #if C_STREAMVBYTE diff --git a/ext/beplugr_.h b/ext/beplugr_.h index 2d56784..f8178f2 100644 --- a/ext/beplugr_.h +++ b/ext/beplugr_.h @@ -22,7 +22,7 @@ { FP_GROUPSIMPLE, "FP_GROUPSIMPLE", C_FASTPFOR128, 0, 0,"","Group Simple" }, { SC_SIMDPACK128, "SC_SIMDPack128", C_SIMDCOMP128, BLK_V128,0,"","Bit packing (SSE4.1)"}, - { SC_SIMDPACK256, "SC_SIMDPack256", C_SIMDCOMP128, BLK_V256,0,"","Bit packing (SSE4.1)"}, + { SC_SIMDPACK256, "SC_SIMDPack256", C_SIMDCOMP256, BLK_V256,0,"","Bit packing (SSE4.1)"}, { SC_FOR, "SC_For", C_SIMDCOMP128, BLK_V128,0,"","For (SSE4.1)"}, { SC_FORDA, "SC_ForDA", C_SIMDCOMP128, BLK_V128,0,"","For direct access (SSE4.1)"},