static really_really_inline
m128 palignr(m128 r, m128 l, int offset) {
-#if defined(HS_OPTIMIZE)
- return (m128)vextq_s8((int8x16_t)l, (int8x16_t)r, offset);
-#else
- return palignr_imm(r, l, offset);
+#if defined(HAVE__BUILTIN_CONSTANT_P)
+ if (__builtin_constant_p(offset)) {
+ return (m128)vextq_s8((int8x16_t)l, (int8x16_t)r, offset);
+ }
#endif
+ return palignr_imm(r, l, offset);
}
#undef CASE_ALIGN_VECTORS
return vshr_128(N);
}
-#ifdef HS_OPTIMIZE
-template <>
-really_inline SuperVector<16> SuperVector<16>::operator>>(uint8_t const N) const
-{
- return {vextq_u8(u.u8x16[0], vdupq_n_u8(0), N)};
-}
-#else
template <>
really_inline SuperVector<16> SuperVector<16>::operator>>(uint8_t const N) const
{
+#if defined(HAVE__BUILTIN_CONSTANT_P)
+ if (__builtin_constant_p(N)) {
+ return {vextq_u8(u.u8x16[0], vdupq_n_u8(0), N)};
+ }
+#endif
return vshr_128(N);
}
-#endif
-#ifdef HS_OPTIMIZE
-template <>
-really_inline SuperVector<16> SuperVector<16>::operator<<(uint8_t const N) const
-{
- return {vextq_u8(vdupq_n_u8(0), u.u8x16[0], 16 - N)};
-}
-#else
template <>
really_inline SuperVector<16> SuperVector<16>::operator<<(uint8_t const N) const
{
+#if defined(HAVE__BUILTIN_CONSTANT_P)
+ if (__builtin_constant_p(N)) {
+ return {vextq_u8(vdupq_n_u8(0), u.u8x16[0], 16 - N)};
+ }
+#endif
return vshl_128(N);
}
-#endif
-
template<>
really_inline SuperVector<16> SuperVector<16>::Ones_vshr(uint8_t const N)
return mask & v;
}
-#ifdef HS_OPTIMIZE
template<>
really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> &other, int8_t offset)
{
- if (offset == 16) {
- return *this;
- } else {
- return {vextq_u8(other.u.u8x16[0], u.u8x16[0], offset)};
+#if defined(HAVE__BUILTIN_CONSTANT_P)
+ if (__builtin_constant_p(offset)) {
+ if (offset == 16) {
+ return *this;
+ } else {
+ return {vextq_u8(other.u.u8x16[0], u.u8x16[0], offset)};
+ }
}
-}
-#else
-template<>
-really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> &other, int8_t offset)
-{
+#endif
switch(offset) {
case 0: return other; break;
case 1: return {vextq_u8( other.u.u8x16[0], u.u8x16[0], 1)}; break;
}
return *this;
}
-#endif
template<>
template<>