Skip to content

Commit abf2d6b

Browse files
Rename generic into common to avoid conflict with C#
Fix #1100
1 parent fb25021 commit abf2d6b

35 files changed

+387
-387
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_fma3_avx.hpp
3838
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_fma3_avx2.hpp
3939
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_fma3_sse.hpp
4040
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_fma4.hpp
41-
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_generic.hpp
41+
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_common.hpp
4242
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_isa.hpp
4343
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_neon.hpp
4444
${XSIMD_INCLUDE_DIR}/xsimd/arch/xsimd_neon64.hpp
@@ -68,7 +68,7 @@ ${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_fma3_avx_register.hpp
6868
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_fma3_avx2_register.hpp
6969
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_fma3_sse_register.hpp
7070
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_fma4_register.hpp
71-
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_generic_arch.hpp
71+
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_common_arch.hpp
7272
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_register.hpp
7373
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_rvv_register.hpp
7474
${XSIMD_INCLUDE_DIR}/xsimd/types/xsimd_sse2_register.hpp

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ INPUT = ../include/xsimd/types/xsimd_api.hpp \
77
../include/xsimd/config/xsimd_config.hpp \
88
../include/xsimd/memory/xsimd_alignment.hpp \
99
../include/xsimd/memory/xsimd_aligned_allocator.hpp \
10-
../include/xsimd/types/xsimd_generic_arch.hpp \
10+
../include/xsimd/types/xsimd_common_arch.hpp \
1111
../include/xsimd/types/xsimd_traits.hpp \
1212
../include/xsimd/types/xsimd_avx2_register.hpp \
1313
../include/xsimd/types/xsimd_avx512bw_register.hpp \

include/xsimd/arch/generic/xsimd_generic_arithmetic.hpp renamed to include/xsimd/arch/common/xsimd_common_arithmetic.hpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* The full license is in the file LICENSE, distributed with this software. *
1010
****************************************************************************/
1111

12-
#ifndef XSIMD_GENERIC_ARITHMETIC_HPP
13-
#define XSIMD_GENERIC_ARITHMETIC_HPP
12+
#ifndef XSIMD_COMMON_ARITHMETIC_HPP
13+
#define XSIMD_COMMON_ARITHMETIC_HPP
1414

1515
#include <complex>
1616
#include <limits>
1717
#include <type_traits>
1818

19-
#include "./xsimd_generic_details.hpp"
19+
#include "./xsimd_common_details.hpp"
2020

2121
namespace xsimd
2222
{
@@ -28,7 +28,7 @@ namespace xsimd
2828

2929
// bitwise_lshift
3030
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
31-
XSIMD_INLINE batch<T, A> bitwise_lshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
31+
XSIMD_INLINE batch<T, A> bitwise_lshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
3232
{
3333
return detail::apply([](T x, T y) noexcept
3434
{ return x << y; },
@@ -37,7 +37,7 @@ namespace xsimd
3737

3838
// bitwise_rshift
3939
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
40-
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
40+
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
4141
{
4242
return detail::apply([](T x, T y) noexcept
4343
{ return x >> y; },
@@ -46,21 +46,21 @@ namespace xsimd
4646

4747
// decr
4848
template <class A, class T>
49-
XSIMD_INLINE batch<T, A> decr(batch<T, A> const& self, requires_arch<generic>) noexcept
49+
XSIMD_INLINE batch<T, A> decr(batch<T, A> const& self, requires_arch<common>) noexcept
5050
{
5151
return self - T(1);
5252
}
5353

5454
// decr_if
5555
template <class A, class T, class Mask>
56-
XSIMD_INLINE batch<T, A> decr_if(batch<T, A> const& self, Mask const& mask, requires_arch<generic>) noexcept
56+
XSIMD_INLINE batch<T, A> decr_if(batch<T, A> const& self, Mask const& mask, requires_arch<common>) noexcept
5757
{
5858
return select(mask, decr(self), self);
5959
}
6060

6161
// div
6262
template <class A, class T, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
63-
XSIMD_INLINE batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
63+
XSIMD_INLINE batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
6464
{
6565
return detail::apply([](T x, T y) noexcept -> T
6666
{ return x / y; },
@@ -69,13 +69,13 @@ namespace xsimd
6969

7070
// fma
7171
template <class A, class T>
72-
XSIMD_INLINE batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) noexcept
72+
XSIMD_INLINE batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<common>) noexcept
7373
{
7474
return x * y + z;
7575
}
7676

7777
template <class A, class T>
78-
XSIMD_INLINE batch<std::complex<T>, A> fma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
78+
XSIMD_INLINE batch<std::complex<T>, A> fma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
7979
{
8080
auto res_r = fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
8181
auto res_i = fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
@@ -84,13 +84,13 @@ namespace xsimd
8484

8585
// fms
8686
template <class A, class T>
87-
XSIMD_INLINE batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) noexcept
87+
XSIMD_INLINE batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<common>) noexcept
8888
{
8989
return x * y - z;
9090
}
9191

9292
template <class A, class T>
93-
XSIMD_INLINE batch<std::complex<T>, A> fms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
93+
XSIMD_INLINE batch<std::complex<T>, A> fms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
9494
{
9595
auto res_r = fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
9696
auto res_i = fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
@@ -99,13 +99,13 @@ namespace xsimd
9999

100100
// fnma
101101
template <class A, class T>
102-
XSIMD_INLINE batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) noexcept
102+
XSIMD_INLINE batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<common>) noexcept
103103
{
104104
return -x * y + z;
105105
}
106106

107107
template <class A, class T>
108-
XSIMD_INLINE batch<std::complex<T>, A> fnma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
108+
XSIMD_INLINE batch<std::complex<T>, A> fnma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
109109
{
110110
auto res_r = -fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
111111
auto res_i = -fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
@@ -114,13 +114,13 @@ namespace xsimd
114114

115115
// fnms
116116
template <class A, class T>
117-
XSIMD_INLINE batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) noexcept
117+
XSIMD_INLINE batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<common>) noexcept
118118
{
119119
return -x * y - z;
120120
}
121121

122122
template <class A, class T>
123-
XSIMD_INLINE batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) noexcept
123+
XSIMD_INLINE batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
124124
{
125125
auto res_r = -fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
126126
auto res_i = -fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
@@ -129,7 +129,7 @@ namespace xsimd
129129

130130
// hadd
131131
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
132-
XSIMD_INLINE T hadd(batch<T, A> const& self, requires_arch<generic>) noexcept
132+
XSIMD_INLINE T hadd(batch<T, A> const& self, requires_arch<common>) noexcept
133133
{
134134
alignas(A::alignment()) T buffer[batch<T, A>::size];
135135
self.store_aligned(buffer);
@@ -143,21 +143,21 @@ namespace xsimd
143143

144144
// incr
145145
template <class A, class T>
146-
XSIMD_INLINE batch<T, A> incr(batch<T, A> const& self, requires_arch<generic>) noexcept
146+
XSIMD_INLINE batch<T, A> incr(batch<T, A> const& self, requires_arch<common>) noexcept
147147
{
148148
return self + T(1);
149149
}
150150

151151
// incr_if
152152
template <class A, class T, class Mask>
153-
XSIMD_INLINE batch<T, A> incr_if(batch<T, A> const& self, Mask const& mask, requires_arch<generic>) noexcept
153+
XSIMD_INLINE batch<T, A> incr_if(batch<T, A> const& self, Mask const& mask, requires_arch<common>) noexcept
154154
{
155155
return select(mask, incr(self), self);
156156
}
157157

158158
// mul
159159
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
160-
XSIMD_INLINE batch<T, A> mul(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
160+
XSIMD_INLINE batch<T, A> mul(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
161161
{
162162
return detail::apply([](T x, T y) noexcept -> T
163163
{ return x * y; },
@@ -166,28 +166,28 @@ namespace xsimd
166166

167167
// rotl
168168
template <class A, class T, class STy>
169-
XSIMD_INLINE batch<T, A> rotl(batch<T, A> const& self, STy other, requires_arch<generic>) noexcept
169+
XSIMD_INLINE batch<T, A> rotl(batch<T, A> const& self, STy other, requires_arch<common>) noexcept
170170
{
171171
constexpr auto N = std::numeric_limits<T>::digits;
172172
return (self << other) | (self >> (N - other));
173173
}
174174

175175
// rotr
176176
template <class A, class T, class STy>
177-
XSIMD_INLINE batch<T, A> rotr(batch<T, A> const& self, STy other, requires_arch<generic>) noexcept
177+
XSIMD_INLINE batch<T, A> rotr(batch<T, A> const& self, STy other, requires_arch<common>) noexcept
178178
{
179179
constexpr auto N = std::numeric_limits<T>::digits;
180180
return (self >> other) | (self << (N - other));
181181
}
182182

183183
// sadd
184184
template <class A>
185-
XSIMD_INLINE batch<float, A> sadd(batch<float, A> const& self, batch<float, A> const& other, requires_arch<generic>) noexcept
185+
XSIMD_INLINE batch<float, A> sadd(batch<float, A> const& self, batch<float, A> const& other, requires_arch<common>) noexcept
186186
{
187187
return add(self, other); // no saturated arithmetic on floating point numbers
188188
}
189189
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
190-
XSIMD_INLINE batch<T, A> sadd(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
190+
XSIMD_INLINE batch<T, A> sadd(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
191191
{
192192
if (std::is_signed<T>::value)
193193
{
@@ -204,19 +204,19 @@ namespace xsimd
204204
}
205205
}
206206
template <class A>
207-
XSIMD_INLINE batch<double, A> sadd(batch<double, A> const& self, batch<double, A> const& other, requires_arch<generic>) noexcept
207+
XSIMD_INLINE batch<double, A> sadd(batch<double, A> const& self, batch<double, A> const& other, requires_arch<common>) noexcept
208208
{
209209
return add(self, other); // no saturated arithmetic on floating point numbers
210210
}
211211

212212
// ssub
213213
template <class A>
214-
XSIMD_INLINE batch<float, A> ssub(batch<float, A> const& self, batch<float, A> const& other, requires_arch<generic>) noexcept
214+
XSIMD_INLINE batch<float, A> ssub(batch<float, A> const& self, batch<float, A> const& other, requires_arch<common>) noexcept
215215
{
216216
return sub(self, other); // no saturated arithmetic on floating point numbers
217217
}
218218
template <class A, class T, class /*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
219-
XSIMD_INLINE batch<T, A> ssub(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) noexcept
219+
XSIMD_INLINE batch<T, A> ssub(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
220220
{
221221
if (std::is_signed<T>::value)
222222
{
@@ -229,7 +229,7 @@ namespace xsimd
229229
}
230230
}
231231
template <class A>
232-
XSIMD_INLINE batch<double, A> ssub(batch<double, A> const& self, batch<double, A> const& other, requires_arch<generic>) noexcept
232+
XSIMD_INLINE batch<double, A> ssub(batch<double, A> const& self, batch<double, A> const& other, requires_arch<common>) noexcept
233233
{
234234
return sub(self, other); // no saturated arithmetic on floating point numbers
235235
}

include/xsimd/arch/generic/xsimd_generic_complex.hpp renamed to include/xsimd/arch/common/xsimd_common_complex.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* The full license is in the file LICENSE, distributed with this software. *
1010
****************************************************************************/
1111

12-
#ifndef XSIMD_GENERIC_COMPLEX_HPP
13-
#define XSIMD_GENERIC_COMPLEX_HPP
12+
#ifndef XSIMD_COMMON_COMPLEX_HPP
13+
#define XSIMD_COMMON_COMPLEX_HPP
1414

1515
#include <complex>
1616

17-
#include "./xsimd_generic_details.hpp"
17+
#include "./xsimd_common_details.hpp"
1818

1919
namespace xsimd
2020
{
@@ -26,54 +26,54 @@ namespace xsimd
2626

2727
// real
2828
template <class A, class T>
29-
XSIMD_INLINE batch<T, A> real(batch<T, A> const& self, requires_arch<generic>) noexcept
29+
XSIMD_INLINE batch<T, A> real(batch<T, A> const& self, requires_arch<common>) noexcept
3030
{
3131
return self;
3232
}
3333

3434
template <class A, class T>
35-
XSIMD_INLINE batch<T, A> real(batch<std::complex<T>, A> const& self, requires_arch<generic>) noexcept
35+
XSIMD_INLINE batch<T, A> real(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept
3636
{
3737
return self.real();
3838
}
3939

4040
// imag
4141
template <class A, class T>
42-
XSIMD_INLINE batch<T, A> imag(batch<T, A> const& /*self*/, requires_arch<generic>) noexcept
42+
XSIMD_INLINE batch<T, A> imag(batch<T, A> const& /*self*/, requires_arch<common>) noexcept
4343
{
4444
return batch<T, A>(T(0));
4545
}
4646

4747
template <class A, class T>
48-
XSIMD_INLINE batch<T, A> imag(batch<std::complex<T>, A> const& self, requires_arch<generic>) noexcept
48+
XSIMD_INLINE batch<T, A> imag(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept
4949
{
5050
return self.imag();
5151
}
5252

5353
// arg
5454
template <class A, class T>
55-
XSIMD_INLINE real_batch_type_t<batch<T, A>> arg(batch<T, A> const& self, requires_arch<generic>) noexcept
55+
XSIMD_INLINE real_batch_type_t<batch<T, A>> arg(batch<T, A> const& self, requires_arch<common>) noexcept
5656
{
5757
return atan2(imag(self), real(self));
5858
}
5959

6060
// conj
6161
template <class A, class T>
62-
XSIMD_INLINE complex_batch_type_t<batch<T, A>> conj(batch<T, A> const& self, requires_arch<generic>) noexcept
62+
XSIMD_INLINE complex_batch_type_t<batch<T, A>> conj(batch<T, A> const& self, requires_arch<common>) noexcept
6363
{
6464
return { real(self), -imag(self) };
6565
}
6666

6767
// norm
6868
template <class A, class T>
69-
XSIMD_INLINE real_batch_type_t<batch<T, A>> norm(batch<T, A> const& self, requires_arch<generic>) noexcept
69+
XSIMD_INLINE real_batch_type_t<batch<T, A>> norm(batch<T, A> const& self, requires_arch<common>) noexcept
7070
{
7171
return { fma(real(self), real(self), imag(self) * imag(self)) };
7272
}
7373

7474
// proj
7575
template <class A, class T>
76-
XSIMD_INLINE complex_batch_type_t<batch<T, A>> proj(batch<T, A> const& self, requires_arch<generic>) noexcept
76+
XSIMD_INLINE complex_batch_type_t<batch<T, A>> proj(batch<T, A> const& self, requires_arch<common>) noexcept
7777
{
7878
using batch_type = complex_batch_type_t<batch<T, A>>;
7979
using real_batch = typename batch_type::real_batch;
@@ -86,19 +86,19 @@ namespace xsimd
8686
}
8787

8888
template <class A, class T>
89-
XSIMD_INLINE batch_bool<T, A> isnan(batch<std::complex<T>, A> const& self, requires_arch<generic>) noexcept
89+
XSIMD_INLINE batch_bool<T, A> isnan(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept
9090
{
9191
return batch_bool<T, A>(isnan(self.real()) || isnan(self.imag()));
9292
}
9393

9494
template <class A, class T>
95-
XSIMD_INLINE batch_bool<T, A> isinf(batch<std::complex<T>, A> const& self, requires_arch<generic>) noexcept
95+
XSIMD_INLINE batch_bool<T, A> isinf(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept
9696
{
9797
return batch_bool<T, A>(isinf(self.real()) || isinf(self.imag()));
9898
}
9999

100100
template <class A, class T>
101-
XSIMD_INLINE batch_bool<T, A> isfinite(batch<std::complex<T>, A> const& self, requires_arch<generic>) noexcept
101+
XSIMD_INLINE batch_bool<T, A> isfinite(batch<std::complex<T>, A> const& self, requires_arch<common>) noexcept
102102
{
103103
return batch_bool<T, A>(isfinite(self.real()) && isfinite(self.imag()));
104104
}

0 commit comments

Comments
 (0)