Skip to content

Commit 209d0c5

Browse files
WIP
1 parent d0be84b commit 209d0c5

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

test/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ set(XSIMD_TESTS
147147
test_complex_trigonometric.cpp
148148
# test_conversion.cpp
149149
# test_custom_default_arch.cpp
150-
# test_error_gamma.cpp
151-
# test_explicit_batch_instantiation.cpp
152-
# test_exponential.cpp
153-
# test_extract_pair.cpp
150+
test_error_gamma.cpp
151+
test_explicit_batch_instantiation.cpp
152+
test_exponential.cpp
153+
test_extract_pair.cpp
154154
# test_fp_manipulation.cpp
155155
# test_hyperbolic.cpp
156156
test_load_store.cpp

test/test_batch_cast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct batch_cast_test
7171
using int32_batch = xsimd::batch<int32_t>;
7272
using uint32_batch = xsimd::batch<uint32_t>;
7373
using float_batch = xsimd::batch<float>;
74-
#ifndef XSIMD_WITH_ALTIVEC
74+
#if !XSIMD_WITH_ALTIVEC
7575
using int64_batch = xsimd::batch<int64_t>;
7676
using uint64_batch = xsimd::batch<uint64_t>;
7777
using double_batch = xsimd::batch<double>;
@@ -185,7 +185,7 @@ struct batch_cast_test
185185
test_cast_impl<uint32_batch, uint32_batch>(test_value, "batch cast uint32 -> uint32");
186186
test_cast_impl<uint32_batch, float_batch>(test_value, "batch cast uint32 -> float");
187187

188-
#ifndef XSIMD_WITH_ALTIVEC
188+
#if !XSIMD_WITH_ALTIVEC
189189
test_cast_impl<int64_batch, int64_batch>(test_value, "batch cast int64 -> int64");
190190
test_cast_impl<int64_batch, uint64_batch>(test_value, "batch cast int64 -> uint64");
191191
test_cast_impl<int64_batch, double_batch>(test_value, "batch cast int64 -> double");
@@ -202,7 +202,7 @@ struct batch_cast_test
202202
test_cast_impl<float_batch, float_batch>(test_value, "batch cast float -> float");
203203
}
204204

205-
#ifndef XSIMD_WITH_ALTIVEC
205+
#if !XSIMD_WITH_ALTIVEC
206206
for (const auto& test_value : double_test_values)
207207
{
208208
test_cast_impl<double_batch, int64_batch>(test_value, "batch cast double -> int64");

test/test_bitwise_cast.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct bitwise_cast_test
2929
int32_vector ftoi32_res;
3030
float_vector i32tof_res;
3131

32-
#ifndef XSIMD_WITH_ALTIVEC
32+
#if !XSIMD_WITH_ALTIVEC
3333
using int64_batch = xsimd::batch<int64_t>;
3434
using double_batch = xsimd::batch<double>;
3535

@@ -49,7 +49,7 @@ struct bitwise_cast_test
4949
bitwise_cast_test()
5050
: ftoi32_res(2 * N)
5151
, i32tof_res(2 * N)
52-
#ifndef XSIMD_WITH_ALTIVEC
52+
#if !XSIMD_WITH_ALTIVEC
5353
, dtoi32_res(2 * N)
5454
, i64tof_res(2 * N)
5555
, dtof_res(2 * N)
@@ -66,7 +66,7 @@ struct bitwise_cast_test
6666
b.i32[0] = input.get(0);
6767
b.i32[1] = input.get(1);
6868
std::fill(i32tof_res.begin(), i32tof_res.end(), b.f[0]);
69-
#ifndef XSIMD_WITH_ALTIVEC
69+
#if !XSIMD_WITH_ALTIVEC
7070
std::fill(i32tod_res.begin(), i32tod_res.end(), b.d);
7171
#endif
7272
}
@@ -76,12 +76,12 @@ struct bitwise_cast_test
7676
b.f[0] = input.get(0);
7777
b.f[1] = input.get(1);
7878
std::fill(ftoi32_res.begin(), ftoi32_res.end(), b.i32[0]);
79-
#ifndef XSIMD_WITH_ALTIVEC
79+
#if !XSIMD_WITH_ALTIVEC
8080
std::fill(ftoi64_res.begin(), ftoi64_res.end(), b.i64);
8181
std::fill(ftod_res.begin(), ftod_res.end(), b.d);
8282
#endif
8383
}
84-
#ifndef XSIMD_WITH_ALTIVEC
84+
#if !XSIMD_WITH_ALTIVEC
8585
{
8686
int64_batch input = i64_input();
8787
bitcast b;
@@ -119,7 +119,7 @@ struct bitwise_cast_test
119119
INFO("to_int32(float)");
120120
CHECK_VECTOR_EQ(i32vres, ftoi32_res);
121121
}
122-
#ifndef XSIMD_WITH_ALTIVEC
122+
#if !XSIMD_WITH_ALTIVEC
123123
{
124124
int32_batch i32bres = xsimd::bitwise_cast<int32_t>(d_input());
125125
i32bres.store_aligned(i32vres.data());
@@ -138,7 +138,7 @@ struct bitwise_cast_test
138138
INFO("to_float(int32_t)");
139139
CHECK_VECTOR_EQ(fvres, i32tof_res);
140140
}
141-
#ifndef XSIMD_WITH_ALTIVEC
141+
#if !XSIMD_WITH_ALTIVEC
142142
{
143143
float_batch fbres = xsimd::bitwise_cast<float>(i64_input());
144144
fbres.store_aligned(fvres.data());
@@ -154,7 +154,7 @@ struct bitwise_cast_test
154154
#endif
155155
}
156156

157-
#ifndef XSIMD_WITH_ALTIVEC
157+
#if !XSIMD_WITH_ALTIVEC
158158

159159
void test_to_int64()
160160
{
@@ -208,7 +208,7 @@ struct bitwise_cast_test
208208
return float_batch(3.);
209209
}
210210

211-
#ifndef XSIMD_WITH_ALTIVEC
211+
#if !XSIMD_WITH_ALTIVEC
212212
int64_batch i64_input() const
213213
{
214214
return int64_batch(2);
@@ -236,7 +236,7 @@ TEST_CASE_TEMPLATE("[bitwise cast]", B, CONVERSION_TYPES)
236236

237237
SUBCASE("to_float") { Test.test_to_float(); }
238238

239-
#ifndef XSIMD_WITH_ALTIVEC
239+
#if !XSIMD_WITH_ALTIVEC
240240
SUBCASE("to_int64") { Test.test_to_int64(); }
241241

242242
SUBCASE("to_double") { Test.test_to_double(); }

test/test_explicit_batch_instantiation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ namespace xsimd
2222
template class batch<signed short>;
2323
template class batch<unsigned int>;
2424
template class batch<signed int>;
25+
#if !XSIMD_WITH_ALTIVEC
2526
template class batch<unsigned long>;
2627
template class batch<signed long>;
28+
#endif
2729
template class batch<float>;
28-
#if !XSIMD_WITH_NEON || XSIMD_WITH_NEON64
30+
#if (!XSIMD_WITH_NEON && !XSIMD_WITH_ALTIVEC) || XSIMD_WITH_NEON64
2931
template class batch<double>;
3032
#endif
3133
}

test/test_load_store.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct load_store_test
3232
using uint16_vector_type = std::vector<uint16_t, allocator<uint16_t>>;
3333
using int32_vector_type = std::vector<int32_t, allocator<int32_t>>;
3434
using uint32_vector_type = std::vector<uint32_t, allocator<uint32_t>>;
35-
#ifndef XSIMD_WITH_ALTIVEC
35+
#if !XSIMD_WITH_ALTIVEC
3636
using int64_vector_type = std::vector<int64_t, allocator<int64_t>>;
3737
using uint64_vector_type = std::vector<uint64_t, allocator<uint64_t>>;
3838
#endif
@@ -51,7 +51,7 @@ struct load_store_test
5151
uint16_vector_type ui16_vec;
5252
int32_vector_type i32_vec;
5353
uint32_vector_type ui32_vec;
54-
#ifndef XSIMD_WITH_ALTIVEC
54+
#if !XSIMD_WITH_ALTIVEC
5555
int64_vector_type i64_vec;
5656
uint64_vector_type ui64_vec;
5757
#endif
@@ -74,7 +74,7 @@ struct load_store_test
7474
init_test_vector(ui16_vec);
7575
init_test_vector(i32_vec);
7676
init_test_vector(ui32_vec);
77-
#ifndef XSIMD_WITH_ALTIVEC
77+
#if !XSIMD_WITH_ALTIVEC
7878
init_test_vector(i64_vec);
7979
init_test_vector(ui64_vec);
8080
#endif
@@ -96,7 +96,7 @@ struct load_store_test
9696
test_load_impl(ui16_vec, "load uint16_t");
9797
test_load_impl(i32_vec, "load int32_t");
9898
test_load_impl(ui32_vec, "load uint32_t");
99-
#ifndef XSIMD_WITH_ALTIVEC
99+
#if !XSIMD_WITH_ALTIVEC
100100
test_load_impl(i64_vec, "load int64_t");
101101
test_load_impl(ui64_vec, "load uint64_t");
102102
#endif
@@ -118,7 +118,7 @@ struct load_store_test
118118
test_store_impl(ui16_vec, "load uint16_t");
119119
test_store_impl(i32_vec, "load int32_t");
120120
test_store_impl(ui32_vec, "load uint32_t");
121-
#ifndef XSIMD_WITH_ALTIVEC
121+
#if !XSIMD_WITH_ALTIVEC
122122
test_store_impl(i64_vec, "load int64_t");
123123
test_store_impl(ui64_vec, "load uint64_t");
124124
#endif
@@ -139,7 +139,7 @@ struct load_store_test
139139
test_gather_impl(ui16_vec, "gather uint16_t");
140140
test_gather_impl(i32_vec, "gather int32_t");
141141
test_gather_impl(ui32_vec, "gather uint32_t");
142-
#ifndef XSIMD_WITH_ALTIVEC
142+
#if !XSIMD_WITH_ALTIVEC
143143
test_gather_impl(i64_vec, "gather int64_t");
144144
test_gather_impl(ui64_vec, "gather uint64_t");
145145
#endif
@@ -162,7 +162,7 @@ struct load_store_test
162162
test_scatter_impl(ui16_vec, "scatter uint16_t");
163163
test_scatter_impl(i32_vec, "scatter int32_t");
164164
test_scatter_impl(ui32_vec, "scatter uint32_t");
165-
#ifndef XSIMD_WITH_ALTIVEC
165+
#if !XSIMD_WITH_ALTIVEC
166166
test_scatter_impl(i64_vec, "scatter int64_t");
167167
test_scatter_impl(ui64_vec, "scatter uint64_t");
168168
#endif

0 commit comments

Comments
 (0)