Skip to content

Commit 4286282

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

38 files changed

+390
-390
lines changed

.github/workflows/cross-rvv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
-DBUILD_TESTS=ON
5151
-DDOWNLOAD_DOCTEST=ON
5252
-DCMAKE_BUILD_TYPE=Release
53-
-DTARGET_ARCH=generic
53+
-DTARGET_ARCH=common
5454
-DCMAKE_C_FLAGS="-march=rv64gcv_zvl${{ matrix.vector_bits }}b_zba_zbb_zbs -mrvv-vector-bits=zvl"
5555
-DCMAKE_CXX_FLAGS="-march=rv64gcv_zvl${{ matrix.vector_bits }}b_zba_zbb_zbs -mrvv-vector-bits=zvl"
5656
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/clang-riscv64-linux-gnu.cmake

.github/workflows/cross-sve.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup
3232
run: |
3333
mkdir _build
34-
cd _build && cmake .. -GNinja -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=generic -DCMAKE_C_FLAGS="-march=armv8-a+sve -msve-vector-bits=${{ matrix.vector_bits }}" -DCMAKE_CXX_FLAGS="-march=armv8-a+sve -msve-vector-bits=${{ matrix.vector_bits }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/gcc-aarch64-linux-gnu.cmake
34+
cd _build && cmake .. -GNinja -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=common -DCMAKE_C_FLAGS="-march=armv8-a+sve -msve-vector-bits=${{ matrix.vector_bits }}" -DCMAKE_CXX_FLAGS="-march=armv8-a+sve -msve-vector-bits=${{ matrix.vector_bits }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/gcc-aarch64-linux-gnu.cmake
3535
- name: Build
3636
run: cmake --build _build
3737
- name: Testing xsimd

.github/workflows/cross.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup
3737
run: |
3838
mkdir _build
39-
cd _build && cmake .. -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DBUILD_BENCHMARK=${{ matrix.target.full }} -DBUILD_EXAMPLES=${{ matrix.target.full }} -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=generic -DCMAKE_C_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_CXX_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake
39+
cd _build && cmake .. -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DBUILD_BENCHMARK=${{ matrix.target.full }} -DBUILD_EXAMPLES=${{ matrix.target.full }} -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=common -DCMAKE_C_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_CXX_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake
4040
- name: Build
4141
run: cmake --build _build
4242
- name: Testing xsimd

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
}

0 commit comments

Comments
 (0)