diff --git a/ext/FastPFor b/ext/FastPFor index 4e484a8..bae51c0 160000 --- a/ext/FastPFor +++ b/ext/FastPFor @@ -1 +1 @@ -Subproject commit 4e484a8d6f1b45af0f4a57515d1c31aea1e80a86 +Subproject commit bae51c0f8f7c50c179e10a84d0a3e137bbc062d7 diff --git a/ext/beplug_.h b/ext/beplug_.h index be75547..18fe680 100644 --- a/ext/beplug_.h +++ b/ext/beplug_.h @@ -11,7 +11,13 @@ #include "FastPFor/headers/simdfastpfor.h" #include "FastPFor/headers/optpfor.h" #include "FastPFor/headers/simdoptpfor.h" -//#include "ext/FastPFor/headers/compositecodec.h" +#ifndef min +#define min(x,y) (((x)<(y)) ? (x) : (y)) +#endif +#define _mm_store_si128 _mm_storeu_si128 +#define _mm_load_si128 _mm_loadu_si128 +#include "FastPFor/headers/simdgroupsimple.h" +#undef min #endif #if C_SIMPLE8B diff --git a/ext/beplugc_.c b/ext/beplugc_.c index ab1c759..8b17655 100644 --- a/ext/beplugc_.c +++ b/ext/beplugc_.c @@ -36,6 +36,17 @@ } ctou32(out) = nvalue; return out+4+nvalue*4; + } + case FP_GROUPSIMPLE: { + size_t nvalue = outsize/4; + FastPForLib::SIMDGroupSimple ic; ic.encodeArray((const int32_t *)in, n & (~127), (uint32_t *)(out+4), nvalue); + if(n & 127) { + size_t nvalue2 = outsize/4 - nvalue; + FastPForLib::VariableByte vc; vc.encodeArray((const int32_t *)(in + (n & (~127))), n & 127, (uint32_t *)(out + 4 + nvalue*4), nvalue2); + nvalue += nvalue2; + } + ctou32(out) = nvalue; + return out+4+nvalue*4; } case FP_VBYTE: { size_t nvalue=outsize/4; FastPForLib::VariableByte ic; ic.encodeArray((const int32_t *)in, (const size_t)n, (uint32_t *)(out+4), nvalue); ctou32(out)=nvalue; return out+4+nvalue*4; } case FP_SIMPLE8BRLE:{ size_t nvalue=outsize/4; FastPForLib::Simple8b_RLE ic; ic.encodeArray((const int32_t *)in, (const size_t)n, (uint32_t *)(out+4), nvalue); ctou32(out)=nvalue; return out+4+nvalue*4; } diff --git a/ext/beplugd_.c b/ext/beplugd_.c index 29ea802..9795a4c 100644 --- a/ext/beplugd_.c +++ b/ext/beplugd_.c @@ -38,6 +38,16 @@ } return (unsigned char *)ip; } + case FP_GROUPSIMPLE: { + size_t nvalue = n; + FastPForLib::SIMDGroupSimple ic; const uint32_t *ip = ic.decodeArray((const int32_t *)(in+4), ctou32(in), out, nvalue); + if(n & 127) { + nvalue = n - nvalue; + FastPForLib::VariableByte vc; + return (unsigned char *)vc.decodeArray(ip, (const uint32_t *)in+1+ctou32(in) - ip, out + (n&(~127)), nvalue); //return vbdec32((unsigned char *)ip, n & 127, out + mynvalue1); + } + return (unsigned char *)ip; + } case FP_VBYTE: //return vbytedec( in, n, out); { size_t nvalue=n; FastPForLib::VariableByte ic; return (unsigned char *)ic.decodeArray((const int32_t *)(in+4), ctou32(in), (uint32_t *)out, nvalue); } diff --git a/ext/beplugr_.h b/ext/beplugr_.h index d6380ed..4573f38 100644 --- a/ext/beplugr_.h +++ b/ext/beplugr_.h @@ -19,6 +19,7 @@ { FP_SIMDOPTPFOR, "FP_SIMDOptPFor", C_FASTPFOR, 0, 0,"","OptPFor SIMD" }, { FP_VBYTE, "FP_VByte", C_FASTPFOR, 0, 0,"","Variable byte" }, { FP_SIMPLE8BRLE, "FP_Simple8bRLE", C_FASTPFOR, 0, 0,"","Simple-8b + rle" }, + { FP_GROUPSIMPLE, "FP_GROUPSIMPLE", C_FASTPFOR, 0, 0,"","Group Simple" }, { SC_SIMDPACK128, "SC_SIMDPack128", C_SIMDCOMP, BLK_V128,0,"","Bit packing (SSE4.1)"}, { SC_SIMDPACK256, "SC_SIMDPack256", C_SIMDCOMP, BLK_V256,0,"","Bit packing (SSE4.1)"}, diff --git a/ext/lz4 b/ext/lz4 index d18084c..1525fd1 160000 --- a/ext/lz4 +++ b/ext/lz4 @@ -1 +1 @@ -Subproject commit d18084c65561cddec48f74c3a91363c9f8e6f709 +Subproject commit 1525fd1f52940e9acb0df094b3e6ee5d0a36e4f3