WIP: simd & bitutils files finctions fixes

This commit is contained in:
Apostolos Tapsas
2021-10-21 13:34:02 +00:00
parent 558313a2c2
commit 2b1db73326
5 changed files with 69 additions and 25 deletions

View File

@@ -45,6 +45,10 @@
static really_inline
u32 packedExtract128(m128 s, const m128 permute, const m128 compare) {
m128 shuffled = pshufb_m128(s, permute);
int8x16_t res = (int8x16_t) pshufb_m128(s, permute);
printf("shufled:");
for(int i=15; i>=0; i--) {printf("%02x ", res[i]);}
printf("\n");
m128 compared = and128(shuffled, compare);
u16 rv = ~movemask128(eq128(compared, shuffled));
return (u32)rv;

View File

@@ -155,6 +155,18 @@ const u8 *rvermSearchAligned(m128 chars, const u8 *buf, const u8 *buf_end,
assert((size_t)buf_end % 16 == 0);
for (; buf + 15 < buf_end; buf_end -= 16) {
m128 data = load128(buf_end - 16);
/*
{
printf("after_load128 data:");
for (int i=3; i>=0; i--) {printf("%d, ",data[i]);}
printf("\n");
}
{
m128 res_eq = eq128(chars, data);
printf("dd:");
for (int i=3; i>=0; i--) { printf("%d, ", res_eq[i]); }
}
*/
u32 z = movemask128(eq128(chars, data));
if (negate) {
z = ~z & 0xffff;
@@ -1281,4 +1293,4 @@ const u8 *rvermicelliDoubleExec(char c1, char c2, char nocase, const u8 *buf,
} else {
return rdvermSearchAligned(chars1, chars2, c1, c2, buf, buf_end);
}
}
}