c_lo = mask_lo.template pshufb<false>(c_lo);
c_hi = mask_hi.template pshufb<false>(c_hi);
- return (c_lo & c_hi) > (SuperVector<S>::Zeroes());
+ return (c_lo & c_hi).eq(SuperVector<S>::Zeroes());
}
template <uint16_t S>
SuperVector<S> t = t1 | (t2.template vshr_128_imm<1>());
t.print8("t");
- return !t.eq(SuperVector<S>::Ones());
+ return t.eq(SuperVector<S>::Ones());
}
template <>
really_really_inline
const u8 *firstMatch<16>(const u8 *buf, SuperVector<16> v) {
- SuperVector<16>::movemask_type z = v.movemask();
- DEBUG_PRINTF("buf %p z %08x \n", buf, z);
- DEBUG_PRINTF("z %08x\n", z);
- if (unlikely(z != 0xffff)) {
+ if (unlikely(vec_any_ne(v.u.v128[0], SuperVector<16>::Ones().u.v128[0]))) {
+ SuperVector<16>::movemask_type z = v.movemask();
+ DEBUG_PRINTF("buf %p z %08x \n", buf, z);
+ DEBUG_PRINTF("z %08x\n", z);
u32 pos = ctz32(~z & 0xffff);
DEBUG_PRINTF("~z %08x\n", ~z);
DEBUG_PRINTF("match @ pos %u\n", pos);
template <>
really_really_inline
const u8 *lastMatch<16>(const u8 *buf, SuperVector<16> v) {
- SuperVector<16>::movemask_type z = v.movemask();
- DEBUG_PRINTF("buf %p z %08x \n", buf, z);
- DEBUG_PRINTF("z %08x\n", z);
- if (unlikely(z != 0xffff)) {
+ if (unlikely(vec_any_ne(v.u.v128[0], SuperVector<16>::Ones().u.v128[0]))) {
+ SuperVector<16>::movemask_type z = v.movemask();
+ DEBUG_PRINTF("buf %p z %08x \n", buf, z);
+ DEBUG_PRINTF("z %08x\n", z);
u32 pos = clz32(~z & 0xffff);
DEBUG_PRINTF("~z %08x\n", ~z);
DEBUG_PRINTF("match @ pos %u\n", pos);
template<>
really_inline SuperVector<16>::SuperVector<uint8_t>(uint8_t const other)
{
- u.v128[0] = (m128) vec_splats(static_cast<int8_t>(other));
+ u.v128[0] = (m128) vec_splats(static_cast<uint8_t>(other));
}
template<>
template<>
really_inline SuperVector<16>::SuperVector<uint16_t>(uint16_t const other)
{
- u.v128[0] = (m128) vec_splats(static_cast<int8_t>(other));
+ u.v128[0] = (m128) vec_splats(static_cast<uint16_t>(other));
}
template<>
template<>
really_inline SuperVector<16>::SuperVector<uint32_t>(uint32_t const other)
{
- u.v128[0] = (m128) vec_splats(static_cast<int8_t>(other));
+ u.v128[0] = (m128) vec_splats(static_cast<uint32_t>(other));
}
template<>
template<>
really_inline SuperVector<16>::SuperVector<uint64_t>(uint64_t const other)
{
- u.v128[0] = (m128) vec_splats(static_cast<int8_t>(other));
+ u.v128[0] = (m128) vec_splats(static_cast<uint64_t>(other));
}
// Constants
template <>
really_inline SuperVector<16> SuperVector<16>::opandnot(SuperVector<16> const &b) const
{
- return vec_xor(vec_and(u.v128[0], b.u.v128[0]), vec_and(u.v128[0], b.u.v128[0]));
+ m128 not_res = vec_xor(u.v128[0], (m128)vec_splat_s8(-1));
+ return {(m128) vec_and(not_res, (m128)b.u.v128[0]) };
}
template <>
template<uint8_t N>
really_inline SuperVector<16> SuperVector<16>::vshr_64_imm() const
-{
- return { (m128) vec_sr((int64x2_t)u.v128[0], vec_splats((uint64_t)N)) };
+{
+ return { (m128) vec_sr((int64x2_t)u.v128[0], vec_splats((uint64_t)N)) };
}
template <>