Skip to content

Commit ca5199d

Browse files
committed
remove redundancy by making complex and batch_bool first implementation common
1 parent e66da98 commit ca5199d

File tree

4 files changed

+2
-36
lines changed

4 files changed

+2
-36
lines changed

include/xsimd/arch/common/xsimd_common_memory.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,13 @@ namespace xsimd
270270
template <class A, class T>
271271
XSIMD_INLINE T first(batch_bool<T, A> const& self, requires_arch<common>) noexcept
272272
{
273-
return get(self, 0, common {});
273+
return first(batch<T, A>(self), A {});
274274
}
275275

276276
template <class A, class T>
277277
XSIMD_INLINE auto first(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept -> typename batch<std::complex<T>, A>::value_type
278278
{
279-
return get(self, 0, common {});
279+
return { first(self.real(), A {}), first(self.imag(), A {}) };
280280
}
281281

282282
// load

include/xsimd/arch/xsimd_avx.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,17 +1901,6 @@ namespace xsimd
19011901
}
19021902
}
19031903

1904-
template <class A, class T>
1905-
XSIMD_INLINE std::complex<T> first(batch<std::complex<T>, A> const& self, requires_arch<avx>) noexcept
1906-
{
1907-
return { first(self.real(), A {}), first(self.imag(), A {}) };
1908-
}
1909-
1910-
template <class A, class T>
1911-
XSIMD_INLINE bool first(batch_bool<T, A> const& self, requires_arch<avx>) noexcept
1912-
{
1913-
return first(batch<T, A>(self), A {});
1914-
}
19151904
}
19161905
}
19171906

include/xsimd/arch/xsimd_avx512f.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,18 +2378,6 @@ namespace xsimd
23782378
}
23792379
}
23802380

2381-
template <class A, class T>
2382-
XSIMD_INLINE std::complex<T> first(batch<std::complex<T>, A> const& self, requires_arch<avx512f>) noexcept
2383-
{
2384-
return { first(self.real(), A {}), first(self.imag(), A {}) };
2385-
}
2386-
2387-
template <class A, class T>
2388-
XSIMD_INLINE bool first(batch_bool<T, A> const& self, requires_arch<avx512f>) noexcept
2389-
{
2390-
return first(batch<T, A>(self), A {});
2391-
}
2392-
23932381
}
23942382

23952383
}

include/xsimd/arch/xsimd_sse2.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,17 +1822,6 @@ namespace xsimd
18221822
}
18231823
}
18241824

1825-
template <class A, class T>
1826-
XSIMD_INLINE std::complex<T> first(batch<std::complex<T>, A> const& self, requires_arch<sse2>) noexcept
1827-
{
1828-
return { first(self.real(), A {}), first(self.imag(), A {}) };
1829-
}
1830-
1831-
template <class A, class T>
1832-
XSIMD_INLINE bool first(batch_bool<T, A> const& self, requires_arch<sse2>) noexcept
1833-
{
1834-
return first(batch<T, A>(self), A {});
1835-
}
18361825
}
18371826
}
18381827

0 commit comments

Comments
 (0)