@@ -110,43 +110,64 @@ struct constant_batch_test
110110 {
111111 constexpr auto n12 = xsimd::make_batch_constant<value_type, constant<12 >, arch_type>();
112112 constexpr auto n3 = xsimd::make_batch_constant<value_type, constant<3 >, arch_type>();
113+ constexpr std::integral_constant<value_type, 3 > c3;
113114
114115 constexpr auto n12_add_n3 = n12 + n3;
115116 constexpr auto n15 = xsimd::make_batch_constant<value_type, constant<15 >, arch_type>();
116117 static_assert (std::is_same<decltype (n12_add_n3), decltype (n15)>::value, " n12 + n3 == n15" );
118+ constexpr auto n12_add_c3 = n12 + c3;
119+ static_assert (std::is_same<decltype (n12_add_c3), decltype (n15)>::value, " n12 + c3 == n15" );
117120
118121 constexpr auto n12_sub_n3 = n12 - n3;
119122 constexpr auto n9 = xsimd::make_batch_constant<value_type, constant<9 >, arch_type>();
120123 static_assert (std::is_same<decltype (n12_sub_n3), decltype (n9)>::value, " n12 - n3 == n9" );
124+ constexpr auto n12_sub_c3 = n12 - c3;
125+ static_assert (std::is_same<decltype (n12_sub_c3), decltype (n9)>::value, " n12 - c3 == n9" );
121126
122127 constexpr auto n12_mul_n3 = n12 * n3;
123128 constexpr auto n36 = xsimd::make_batch_constant<value_type, constant<36 >, arch_type>();
124129 static_assert (std::is_same<decltype (n12_mul_n3), decltype (n36)>::value, " n12 * n3 == n36" );
130+ constexpr auto n12_mul_c3 = n12 * c3;
131+ static_assert (std::is_same<decltype (n12_mul_c3), decltype (n36)>::value, " n12 - c3 == n36" );
125132
126133 constexpr auto n12_div_n3 = n12 / n3;
127134 constexpr auto n4 = xsimd::make_batch_constant<value_type, constant<4 >, arch_type>();
128135 static_assert (std::is_same<decltype (n12_div_n3), decltype (n4)>::value, " n12 / n3 == n4" );
136+ constexpr auto n12_div_c3 = n12 / c3;
137+ static_assert (std::is_same<decltype (n12_div_c3), decltype (n4)>::value, " n12 / c3 == n4" );
129138
130139 constexpr auto n12_mod_n3 = n12 % n3;
131140 constexpr auto n0 = xsimd::make_batch_constant<value_type, constant<0 >, arch_type>();
132141 static_assert (std::is_same<decltype (n12_mod_n3), decltype (n0)>::value, " n12 % n3 == n0" );
142+ constexpr auto n12_mod_c3 = n12 % c3;
143+ static_assert (std::is_same<decltype (n12_mod_c3), decltype (n0)>::value, " n12 % c3 == n0" );
133144
134145 constexpr auto n12_land_n3 = n12 & n3;
135146 static_assert (std::is_same<decltype (n12_land_n3), decltype (n0)>::value, " n12 & n3 == n0" );
147+ constexpr auto n12_land_c3 = n12 & c3;
148+ static_assert (std::is_same<decltype (n12_land_c3), decltype (n0)>::value, " n12 & c3 == n0" );
136149
137150 constexpr auto n12_lor_n3 = n12 | n3;
138151 static_assert (std::is_same<decltype (n12_lor_n3), decltype (n15)>::value, " n12 | n3 == n15" );
152+ constexpr auto n12_lor_c3 = n12 | c3;
153+ static_assert (std::is_same<decltype (n12_lor_c3), decltype (n15)>::value, " n12 | c3 == n15" );
139154
140155 constexpr auto n12_lxor_n3 = n12 ^ n3;
141156 static_assert (std::is_same<decltype (n12_lxor_n3), decltype (n15)>::value, " n12 ^ n3 == n15" );
157+ constexpr auto n12_lxor_c3 = n12 ^ c3;
158+ static_assert (std::is_same<decltype (n12_lxor_c3), decltype (n15)>::value, " n12 ^ c3 == n15" );
142159
143160 constexpr auto n96 = xsimd::make_batch_constant<value_type, constant<96 >, arch_type>();
144161 constexpr auto n12_lshift_n3 = n12 << n3;
145162 static_assert (std::is_same<decltype (n12_lshift_n3), decltype (n96)>::value, " n12 << n3 == n96" );
163+ constexpr auto n12_lshift_c3 = n12 << c3;
164+ static_assert (std::is_same<decltype (n12_lshift_c3), decltype (n96)>::value, " n12 << c3 == n96" );
146165
147166 constexpr auto n1 = xsimd::make_batch_constant<value_type, constant<1 >, arch_type>();
148167 constexpr auto n12_rshift_n3 = n12 >> n3;
149168 static_assert (std::is_same<decltype (n12_rshift_n3), decltype (n1)>::value, " n12 >> n3 == n1" );
169+ constexpr auto n12_rshift_c3 = n12 >> c3;
170+ static_assert (std::is_same<decltype (n12_rshift_c3), decltype (n1)>::value, " n12 >> c3 == n1" );
150171
151172 constexpr auto n12_uadd = +n12;
152173 static_assert (std::is_same<decltype (n12_uadd), decltype (n12)>::value, " +n12 == n12" );
@@ -167,21 +188,27 @@ struct constant_batch_test
167188
168189 static_assert (std::is_same<decltype (n12 == n12), true_batch_type>::value, " n12 == n12" );
169190 static_assert (std::is_same<decltype (n12 == n3), false_batch_type>::value, " n12 == n3" );
191+ static_assert (std::is_same<decltype (n12 == c3), false_batch_type>::value, " n12 == c3" );
170192
171193 static_assert (std::is_same<decltype (n12 != n12), false_batch_type>::value, " n12 != n12" );
172194 static_assert (std::is_same<decltype (n12 != n3), true_batch_type>::value, " n12 != n3" );
195+ static_assert (std::is_same<decltype (n12 != c3), true_batch_type>::value, " n12 != c3" );
173196
174197 static_assert (std::is_same<decltype (n12 < n12), false_batch_type>::value, " n12 < n12" );
175198 static_assert (std::is_same<decltype (n12 < n3), false_batch_type>::value, " n12 < n3" );
199+ static_assert (std::is_same<decltype (n12 < c3), false_batch_type>::value, " n12 < c3" );
176200
177201 static_assert (std::is_same<decltype (n12 > n12), false_batch_type>::value, " n12 > n12" );
178202 static_assert (std::is_same<decltype (n12 > n3), true_batch_type>::value, " n12 > n3" );
203+ static_assert (std::is_same<decltype (n12 > c3), true_batch_type>::value, " n12 > c3" );
179204
180205 static_assert (std::is_same<decltype (n12 <= n12), true_batch_type>::value, " n12 <= n12" );
181206 static_assert (std::is_same<decltype (n12 <= n3), false_batch_type>::value, " n12 <= n3" );
207+ static_assert (std::is_same<decltype (n12 <= c3), false_batch_type>::value, " n12 <= c3" );
182208
183209 static_assert (std::is_same<decltype (n12 >= n12), true_batch_type>::value, " n12 >= n12" );
184210 static_assert (std::is_same<decltype (n12 >= n3), true_batch_type>::value, " n12 >= n3" );
211+ static_assert (std::is_same<decltype (n12 >= c3), true_batch_type>::value, " n12 >= c3" );
185212 }
186213};
187214
0 commit comments