You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On an apple silicon + clang this doesnt compile (latest git clone on master):
typedef xsimd::batch<float, xsimd::make_sized_batch<float, 2>> t_Vector2;
t_Vector2 a = 2.0f;
Error is:
/opt/compiler-explorer/libs/xsimd/trunk/include/xsimd/types/xsimd_batch.hpp:532:58: error: no matching function for call to 'broadcast<xsimd::make_sized_batch<float, 2> >(float&, xsimd::make_sized_batch<float, 2>)'
532 | : types::simd_register<T, A>(kernel::broadcast<A>(val, A {}))
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
• there are 11 candidates
...omissis...
A quick search in xsimd_neon.hpp in the library doesnt show any intrinsic float32x2_t vdup_n_f32(float32_t value) function
I believe assignment operator = also fails for the 2 lanes simd.
Actually make_sized_batch<T, N> already returns a batch type if possible (meaning if this size is supported on the given architecture). For NEON, we support batches of 4 float scalars only (i.e. wrapping float32x4_t).
The "difficulty" is that the current design of xsimd is not well adapted for that: an architecture supports a given length of batch per scalar type. A solution could be to add a "fake" architecture, like HALF_NEON (or maybe we could find a better name), or take that need when refactoring the way we handle architecture and introduce "decorators" for specifying additional instruction sets to a particular architecture. My preference would be the fake architecture since it's already possible to implement it, but maybe @serge-sans-paille has a better idea.
What about half_batch<type, arch>?
It makes sense for Neon, sse/avx/avx512...
We need to think a bit about the consequences in terms of class hierachy etc,
but it may make sense.
What about half_batch<type, arch>?
It makes sense for Neon, sse/avx/avx512...
We need to think a bit about the consequences in terms of class hierachy etc,
but it may make sense.
That would also be interesting in the context of #1130
From my newbie POV, this is what surprised me about the unsupported float32x2_t on ARM.
When I compile this on x86-64 clang -march=skylake-avx512 they all work:
Activity
JohanMabille commentedon Feb 23, 2026
Actually
make_sized_batch<T, N>already returns abatchtype if possible (meaning if this size is supported on the given architecture). For NEON, we support batches of 4 float scalars only (i.e. wrappingfloat32x4_t).mlomonaco commentedon Feb 23, 2026
Thanks, any plan to add those in the future? I might be able to help
JohanMabille commentedon Feb 23, 2026
The "difficulty" is that the current design of xsimd is not well adapted for that: an architecture supports a given length of batch per scalar type. A solution could be to add a "fake" architecture, like HALF_NEON (or maybe we could find a better name), or take that need when refactoring the way we handle architecture and introduce "decorators" for specifying additional instruction sets to a particular architecture. My preference would be the fake architecture since it's already possible to implement it, but maybe @serge-sans-paille has a better idea.
serge-sans-paille commentedon Feb 23, 2026
DiamonDinoia commentedon Feb 23, 2026
That would also be interesting in the context of #1130
mlomonaco commentedon Feb 24, 2026
From my newbie POV, this is what surprised me about the unsupported
float32x2_ton ARM.When I compile this on x86-64 clang
-march=skylake-avx512they all work:so why not
?