/* SIMD engine agnostic noodle scan parts */
-#include "util/simd/types.hpp"
+#include "util/supervector/supervector.hpp"
static u8 CASEMASK[] = { 0xff, 0xdf };
const SuperVector<VECTORSIZE> mask2{getMask<VECTORSIZE>(n->key1, noCase)};
return scanDoubleMain(n, buf, len, start, caseMask, mask1, mask2, cbi);
-}
\ No newline at end of file
+}
#include "util/bitutils.h"
#include "util/unaligned.h"
-#include "util/simd/types.hpp"
-
-#define GET1_LO_4(chars, low4bits) and128(chars, low4bits)
-#define GET1_HI_4(chars, low4bits) and128(rshift64_m128(chars, 4), low4bits)
+#include "util/supervector/supervector.hpp"
template <uint16_t S>
static really_inline
typename SuperVector<S>::movemask_type block(SuperVector<S> mask_lo, SuperVector<S> mask_hi,
SuperVector<S> chars, const SuperVector<S> low4bits) {
SuperVector<S> c_lo = chars & low4bits;
- print_m128_16x8("c_lo", c_lo.u.v128[0]);
+ //printv_u8("c_lo", c_lo);
c_lo = mask_lo.pshufb(c_lo);
- print_m128_16x8("c_lo", c_lo.u.v128[0]);
+ //printv_u8("c_lo", c_lo);
SuperVector<S> c_hi = mask_hi.pshufb(chars.rshift64(4) & low4bits);
SuperVector<S> t = c_lo & c_hi;
- print_m128_16x8("low4bits", low4bits.u.v128[0]);
- print_m128_16x8("mask_lo", mask_lo.u.v128[0]);
- print_m128_16x8("mask_hi", mask_hi.u.v128[0]);
- print_m128_16x8("chars", chars.u.v128[0]);
- print_m128_16x8("c_lo", c_lo.u.v128[0]);
- print_m128_16x8("c_hi", c_hi.u.v128[0]);
- print_m128_16x8("t", t.u.v128[0]);
+ /*printv_u8("low4bits", low4bits);
+ printv_u8("mask_lo", mask_lo);
+ printv_u8("mask_hi", mask_hi);
+ printv_u8("chars", chars);
+ printv_u8("c_lo", c_lo);
+ printv_u8("c_hi", c_hi);
+ printv_u8("t", t);*/
return t.eqmask(SuperVector<S>::Zeroes());
}
template <uint16_t S>
const u8 *lastMatch(const u8 *buf, typename SuperVector<S>::movemask_type z);
-
template <>
really_inline
const u8 *firstMatch<16>(const u8 *buf, typename SuperVector<16>::movemask_type z) {
assert(len <= S);
SuperVector<S> chars = SuperVector<S>::loadu_maskz(buf, static_cast<uint8_t>(len));
- print_m128_16x8("chars", chars.u.v128[0]);
+ //printv_u8("chars", chars);
uint8_t alignment = (uintptr_t)(buf) & 15;
typename SuperVector<S>::movemask_type maskb = 1 << alignment;
typename SuperVector<S>::movemask_type maske = SINGLE_LOAD_MASK(len - alignment);
DEBUG_PRINTF("shufti %p len %zu\n", buf, buf_end - buf);
DEBUG_PRINTF("b %s\n", buf);
- const SuperVector<S> low4bits = SuperVector<S>::set1u_16x8(0xf);
+ const SuperVector<S> low4bits = SuperVector<S>::dup_u8(0xf);
const SuperVector<S> wide_mask_lo(mask_lo);
const SuperVector<S> wide_mask_hi(mask_hi);
DEBUG_PRINTF("shufti %p len %zu\n", buf, buf_end - buf);
DEBUG_PRINTF("b %s\n", buf);
- const SuperVector<S> low4bits = SuperVector<S>::set1u_16x8(0xf);
+ const SuperVector<S> low4bits = SuperVector<S>::dup_u8(0xf);
const SuperVector<S> wide_mask_lo(mask_lo);
const SuperVector<S> wide_mask_hi(mask_hi);
DEBUG_PRINTF("shufti %p len %zu\n", buf, buf_end - buf);
DEBUG_PRINTF("b %s\n", buf);
- const SuperVector<S> low4bits = SuperVector<S>::set1u_16x8(0xf);
+ const SuperVector<S> low4bits = SuperVector<S>::dup_u8(0xf);
const SuperVector<S> wide_mask1_lo(mask1_lo);
const SuperVector<S> wide_mask1_hi(mask1_hi);
const SuperVector<S> wide_mask2_lo(mask2_lo);
#include "util/bitutils.h"
#include "util/unaligned.h"
-#include "util/simd/types.hpp"
+#include "util/supervector/supervector.hpp"
template <uint16_t S>
typename SuperVector<S>::movemask_type block(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_mask_lo_highset,
SuperVector<S> v){
- SuperVector<S> highconst = SuperVector<S>::set1_16x8(0x80);
- print_m128_16x8("highconst", highconst.u.v128[0]);
+ SuperVector<S> highconst = SuperVector<S>::dup_u8(0x80);
+ printv_u8("highconst", highconst);
- SuperVector<S> shuf_mask_hi = SuperVector<S>::set1_2x64(0x8040201008040201);
- print_m128_2x64("shuf_mask_hi", shuf_mask_hi.u.v128[0]);
+ SuperVector<S> shuf_mask_hi = SuperVector<S>::dup_u64(0x8040201008040201);
+ printv_u64("shuf_mask_hi", shuf_mask_hi);
SuperVector<S> shuf1 = shuf_mask_lo_highclear.pshufb(v);
SuperVector<S> t1 = v ^ highconst;
SuperVector<S> shuf2 = shuf_mask_lo_highset.pshufb(t1);
SuperVector<S> t2 = highconst.opandnot(v.rshift64(4));
SuperVector<S> shuf3 = shuf_mask_hi.pshufb(t2);
- SuperVector<S> tmp = shuf3 & (shuf1 | shuf2);
+ SuperVector<S> tmp = (shuf1 | shuf2) & shuf3;
return tmp.eqmask(SuperVector<S>::Zeroes());
}
#include <cstdint>
-#include "util/simd/arch/arm/types.hpp"
+#include "util/supervector/arch/arm/types.hpp"
// 128-bit NEON implementation
template<>
-really_inline SuperVector<16>::SuperVector(SuperVector const &o)
+really_inline SuperVector<16>::SuperVector(SuperVector const &other)
{
- u.v128[0] = o.u.v128[0];
+ u.v128[0] = other.u.v128[0];
}
template<>
template<>
template<>
-really_inline SuperVector<16>::SuperVector<int8x16_t>(int8x16_t const o)
+really_inline SuperVector<16>::SuperVector<int8x16_t>(int8x16_t const other)
{
- u.v128[0] = static_cast<int32x4_t>(o);
+ u.v128[0] = static_cast<int32x4_t>(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<uint8x16_t>(uint8x16_t const o)
+really_inline SuperVector<16>::SuperVector<uint8x16_t>(uint8x16_t const other)
{
- u.v128[0] = static_cast<int32x4_t>(o);
+ u.v128[0] = static_cast<int32x4_t>(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<int8_t>(int8_t const o)
+really_inline SuperVector<16>::SuperVector<int8_t>(int8_t const other)
{
- u.v128[0] = vdupq_n_s8(o);
+ u.v128[0] = vdupq_n_s8(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<uint8_t>(uint8_t const o)
+really_inline SuperVector<16>::SuperVector<uint8_t>(uint8_t const other)
{
- u.v128[0] = vdupq_n_u8(o);
+ u.v128[0] = vdupq_n_u8(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<int16_t>(int16_t const o)
+really_inline SuperVector<16>::SuperVector<int16_t>(int16_t const other)
{
- u.v128[0] = vdupq_n_s16(o);
+ u.v128[0] = vdupq_n_s16(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<uint16_t>(uint16_t const o)
+really_inline SuperVector<16>::SuperVector<uint16_t>(uint16_t const other)
{
- u.v128[0] = vdupq_n_u16(o);
+ u.v128[0] = vdupq_n_u16(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<int32_t>(int32_t const o)
+really_inline SuperVector<16>::SuperVector<int32_t>(int32_t const other)
{
- u.v128[0] = vdupq_n_s32(o);
+ u.v128[0] = vdupq_n_s32(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<uint32_t>(uint32_t const o)
+really_inline SuperVector<16>::SuperVector<uint32_t>(uint32_t const other)
{
- u.v128[0] = vdupq_n_u32(o);
+ u.v128[0] = vdupq_n_u32(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<int64_t>(int64_t const o)
+really_inline SuperVector<16>::SuperVector<int64_t>(int64_t const other)
{
- u.v128[0] = vdupq_n_s64(o);
+ u.v128[0] = vdupq_n_s64(other);
}
template<>
template<>
-really_inline SuperVector<16>::SuperVector<uint64_t>(uint64_t const o)
+really_inline SuperVector<16>::SuperVector<uint64_t>(uint64_t const other)
{
- u.v128[0] = vdupq_n_u64(o);
+ u.v128[0] = vdupq_n_u64(other);
}
// Constants
// Methods
template <>
-really_inline void SuperVector<16>::operator=(SuperVector<16> const &o)
+really_inline void SuperVector<16>::operator=(SuperVector<16> const &other)
{
- u.v128[0] = o.u.v128[0];
+ u.v128[0] = other.u.v128[0];
}
template <>
-really_inline SuperVector<16> SuperVector<16>::operator&(SuperVector<16> const b) const
+really_inline SuperVector<16> SuperVector<16>::operator&(SuperVector<16> const &b) const
{
return {vandq_s8(u.v128[0], b.u.v128[0])};
}
template <>
-really_inline SuperVector<16> SuperVector<16>::operator|(SuperVector<16> const b) const
+really_inline SuperVector<16> SuperVector<16>::operator|(SuperVector<16> const &b) const
{
return {vorrq_s8(u.v128[0], b.u.v128[0])};
}
template <>
-really_inline SuperVector<16> SuperVector<16>::opand(SuperVector<16> const b) const
+really_inline SuperVector<16> SuperVector<16>::operator^(SuperVector<16> const &b) const
+{
+ return {veorq_s8(u.v128[0], b.u.v128[0])};
+}
+
+template <>
+really_inline SuperVector<16> SuperVector<16>::opand(SuperVector<16> const &b) const
{
return {vandq_s8(u.v128[0], b.u.v128[0])};
}
template <>
-really_inline SuperVector<16> SuperVector<16>::opandnot(SuperVector<16> const b) const
+really_inline SuperVector<16> SuperVector<16>::opandnot(SuperVector<16> const &b) const
{
return {vandq_s8(u.v128[0], b.u.v128[0])};
}
template <>
-really_inline SuperVector<16> SuperVector<16>::eq(SuperVector<16> const b) const
+really_inline SuperVector<16> SuperVector<16>::eq(SuperVector<16> const &b) const
{
return {vceqq_s8((int16x8_t)u.v128[0], (int16x8_t)b.u.v128[0])};
}
// Compute the mask from the input
uint64x2_t mask = vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vandq_u8((uint16x8_t)u.v128[0], powers))));
- uint64x2_t mask1 = (m128)vextq_s8(mask, zeroes128(), 7);
+ uint64x2_t mask1 = (m128)vextq_s8(mask, vdupq_n_u8(0), 7);
mask = vorrq_u8(mask, mask1);
// Get the resulting bytes
#ifndef HS_OPTIMIZE
template<>
-really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> r, int8_t offset)
+really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> &other, int8_t offset)
{
- return {vextq_s8((int16x8_t)r.u.v128[0], (int16x8_t)u.v128[0], 16 - offset)};
+ return {vextq_s8((int16x8_t)other.u.v128[0], (int16x8_t)u.v128[0], 16 - offset)};
}
#else
template<>
-really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> r, int8_t offset)
+really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> &other, int8_t offset)
{
switch(offset) {
case 0: return *this; break;
- case 1: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 15)}; break;
- case 2: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 14)}; break;
- case 3: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 13)}; break;
- case 4: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 12)}; break;
- case 5: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 11)}; break;
- case 6: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 10)}; break;
- case 7: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 9)}; break;
- case 8: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 8)}; break;
- case 9: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 7)}; break;
- case 10: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 6)}; break;
- case 11: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 5)}; break;
- case 12: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 4)}; break;
- case 13: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 3)}; break;
- case 14: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 2)}; break;
- case 15: return {vextq_s8((int16x8_t) r.u.v128[0], (int16x8_t) u.v128[0], 1)}; break;
- case 16: return r; break;
+ case 1: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 15)}; break;
+ case 2: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 14)}; break;
+ case 3: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 13)}; break;
+ case 4: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 12)}; break;
+ case 5: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 11)}; break;
+ case 6: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 10)}; break;
+ case 7: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 9)}; break;
+ case 8: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 8)}; break;
+ case 9: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 7)}; break;
+ case 10: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 6)}; break;
+ case 11: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 5)}; break;
+ case 12: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 4)}; break;
+ case 13: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 3)}; break;
+ case 14: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 2)}; break;
+ case 15: return {vextq_s8((int16x8_t) other.u.v128[0], (int16x8_t) u.v128[0], 1)}; break;
+ case 16: return other; break;
default: break;
}
return *this;
#ifdef HS_OPTIMIZE
template<>
-really_inline SuperVector<16> SuperVector<16>::lshift64(uint8_t const l)
+really_inline SuperVector<16> SuperVector<16>::lshift64(uint8_t const N)
{
- return {(m128)vshlq_n_s64(u.v128[0], l)};
+ return {(m128)vshlq_n_s64(u.v128[0], N)};
}
#else
template<>
-really_inline SuperVector<16> SuperVector<16>::lshift64(uint8_t const l)
+really_inline SuperVector<16> SuperVector<16>::lshift64(uint8_t const N)
{
- switch(l) {
+ switch(N) {
case 0: return {vshlq_n_s64(u.v128[0], 0)}; break;
case 1: return {vshlq_n_s64(u.v128[0], 1)}; break;
case 2: return {vshlq_n_s64(u.v128[0], 2)}; break;
#ifdef HS_OPTIMIZE
template<>
-really_inline SuperVector<16> SuperVector<16>::rshift64(uint8_t const l)
+really_inline SuperVector<16> SuperVector<16>::rshift64(uint8_t const N)
{
- return {(m128)vshrq_n_s64(u.v128[0], l)};
+ return {(m128)vshrq_n_s64(u.v128[0], N)};
}
#else
template<>
-really_inline SuperVector<16> SuperVector<16>::rshift64(uint8_t const l)
+really_inline SuperVector<16> SuperVector<16>::rshift64(uint8_t const N)
{
- switch(l) {
+ switch(N) {
case 0: return {vshrq_n_s64(u.v128[0], 0)}; break;
case 1: return {vshrq_n_s64(u.v128[0], 1)}; break;
case 2: return {vshrq_n_s64(u.v128[0], 2)}; break;
#include "ue2common.h"
#include "util/arch.h"
#include "util/unaligned.h"
-#include "util/simd/types.hpp"
+#include "util/supervector/arch/arm/types.hpp"
#if !defined(m128) && defined(HAVE_SSE2)
typedef __m128i m128;
return {_mm_xor_si128(u.v128[0], b.u.v128[0])};
}
-template <>
-really_inline SuperVector<16> SuperVector<16>::opand(SuperVector<16> const b) const
-{
- return *this & b;
-}
-
-template <>
-really_inline SuperVector<16> SuperVector<16>::opxor(SuperVector<16> const b) const
-{
- return *this ^ b;
-}
template <>
really_inline SuperVector<16> SuperVector<16>::opandnot(SuperVector<16> const b) const
#include <cstdio>
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
-#include "util/simd/arch/x86/types.hpp"
+#include "util/supervector/arch/x86/types.hpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
-#include "util/simd/arch/arm/types.hpp"
+#include "util/supervector/arch/arm/types.hpp"
#endif
#if defined(HAVE_SIMD_512_BITS)
#elif defined(HAVE_SIMD_128_BITS)
using Z_TYPE = u32;
#define Z_BITS 32
-#define Z_SHIFT 0
+#define Z_SHIFT 15
#define DOUBLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL)
#define SINGLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL)
#endif
double f64[SIZE / sizeof(double)];
} u;
- SuperVector(SuperVector const &o);
+ SuperVector(SuperVector const &other);
SuperVector(typename base_type::type const v);
template<typename T>
- SuperVector(T const o);
+ SuperVector(T const other);
- static SuperVector set1u_16x8(uint8_t o) { return {o}; };
- static SuperVector set1_16x8(int8_t o) { return {o}; };
- static SuperVector set1u_8x16(uint16_t o) { return {o}; };
- static SuperVector set1_8x16(int16_t o) { return {o}; };
- static SuperVector set1u_4x32(uint32_t o) { return {o}; };
- static SuperVector set1_4x32(int32_t o) { return {o}; };
- static SuperVector set1u_2x64(uint64_t o) { return {o}; };
- static SuperVector set1_2x64(int64_t o) { return {o}; };
+ static SuperVector dup_u8 (uint8_t other) { return {other}; };
+ static SuperVector dup_s8 (int8_t other) { return {other}; };
+ static SuperVector dup_u16(uint16_t other) { return {other}; };
+ static SuperVector dup_s16(int16_t other) { return {other}; };
+ static SuperVector dup_u32(uint32_t other) { return {other}; };
+ static SuperVector dup_s32(int32_t other) { return {other}; };
+ static SuperVector dup_u64(uint64_t other) { return {other}; };
+ static SuperVector dup_s64(int64_t other) { return {other}; };
- void operator=(SuperVector const &o);
+ void operator=(SuperVector const &other);
- SuperVector operator&(SuperVector const b) const;
- SuperVector operator|(SuperVector const b) const;
- SuperVector operator^(SuperVector const b) const;
-
- SuperVector opand(SuperVector const b) const;
- SuperVector opor(SuperVector const b) const;
- SuperVector opandnot(SuperVector const b) const;
- SuperVector opxor(SuperVector const b) const;
+ SuperVector operator&(SuperVector const &b) const;
+ SuperVector operator|(SuperVector const &b) const;
+ SuperVector operator^(SuperVector const &b) const;
- SuperVector eq(SuperVector const b) const;
+ SuperVector opand(SuperVector const &b) const { return *this & b; }
+ SuperVector opor (SuperVector const &b) const { return *this | b; }
+ SuperVector opxor(SuperVector const &b) const { return *this ^ b; }
+ SuperVector opandnot(SuperVector const &b) const;
+
+ SuperVector eq(SuperVector const &b) const;
SuperVector operator<<(uint8_t const N) const;
SuperVector operator>>(uint8_t const N) const;
typename base_type::movemask_type movemask(void) const;
static SuperVector loadu(void const *ptr);
static SuperVector load(void const *ptr);
static SuperVector loadu_maskz(void const *ptr, uint8_t const len);
- SuperVector alignr(SuperVector l, int8_t offset);
+ SuperVector alignr(SuperVector &other, int8_t offset);
SuperVector pshufb(SuperVector b);
- SuperVector lshift64(uint8_t const l);
- SuperVector rshift64(uint8_t const l);
+ SuperVector lshift64(uint8_t const N);
+ SuperVector rshift64(uint8_t const N);
// Constants
static SuperVector Ones();
#if defined(HS_OPTIMIZE)
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
-#include "util/simd/arch/x86/impl.cpp"
+#include "util/supervector/arch/x86/impl.cpp"
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
-#include "util/simd/arch/arm/impl.cpp"
+#include "util/supervector/arch/arm/impl.cpp"
#endif
#endif
template <uint16_t S>
-static void printv_u8(const char *label, SuperVector<S> &v) {
+static void printv_u8(const char *label, SuperVector<S> const &v) {
printf("%s: ", label);
- for(int i=0; i < S; i++)
+ for(size_t i=0; i < S; i++)
printf("%02x ", v.u.u8[i]);
printf("\n");
}
template <uint16_t S>
-static void printv_u16(const char *label, SuperVector<S> &v) {
+static void printv_u16(const char *label, SuperVector<S> const &v) {
printf("%s: ", label);
- for(int i=0; i < S/sizeof(u16); i++)
+ for(size_t i=0; i < S/sizeof(u16); i++)
printf("%04x ", v.u.u16[i]);
printf("\n");
}
template <uint16_t S>
-static void printv_u32(const char *label, SuperVector<S> &v) {
+static void printv_u32(const char *label, SuperVector<S> const &v) {
printf("%s: ", label);
- for(int i=0; i < S/sizeof(u32); i++)
+ for(size_t i=0; i < S/sizeof(u32); i++)
printf("%08x ", v.u.u32[i]);
printf("\n");
}
template <uint16_t S>
-static inline void printv_u64(const char *label, SuperVector<S> &v) {
+static inline void printv_u64(const char *label, SuperVector<S> const &v) {
printf("%s: ", label);
- for(int i=0; i < S/sizeof(u64a); i++)
+ for(size_t i=0; i < S/sizeof(u64a); i++)
printf("%016lx ", v.u.u64[i]);
printf("\n");
}
#include<time.h>
#include"gtest/gtest.h"
#include"ue2common.h"
-#include"util/arch.h"
-#include"util/simd_utils.h"
-#include"util/simd/types.hpp"
+#include"util/supervector/supervector.hpp"
TEST(SuperVectorUtilsTest, Zero128c) {
}
/*Define ALIGNR128 macro*/
-#define TEST_ALIGNR128(v1, v2, buf, l) { \
- auto v_aligned = v2.alignr(v1,l); \
- printv_u8("v1", v1); \
- printv_u8("v2", v2); \
- printv_u8("v_aligned", v_aligned); \
- for (size_t i=0; i<16; i++) { \
- ASSERT_EQ(v_aligned.u.u8[i], vec[16 -l + i]); \
- } \
+#define TEST_ALIGNR128(v1, v2, buf, l) { \
+ auto v_aligned = v2.alignr(v1, l); \
+ for (size_t i=0; i<16; i++) { \
+ ASSERT_EQ(v_aligned.u.u8[i], vec[16 - l + i]); \
+ } \
}
TEST(SuperVectorUtilsTest,Alignr128c){