Skip to content

Fix spurious double-register instantiation in emulated batch_bool - #1454

Open
DiamonDinoia wants to merge 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:fix-emulated-batch-bool
Open

DiamonDinoia wants to merge 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:fix-emulated-batch-bool

Conversation

@DiamonDinoia

Copy link
Copy Markdown
Contributor

Kind of a wierd edge case but I am working on interpoperability with std-simd to allow for support for other archs that we do not support (optin) and this is the only edge case I hit.

Otherwise we are interoperable.

#include <xsimd/xsimd.hpp>
int main()
{
    using M = xsimd::batch_bool<float, xsimd::emulated<96>>;
    M const m(true);
    return m.get(2) ? 0 : 1;
}

g++-16 -std=c++17 -O2 -DXSIMD_WITH_EMULATED=1 -I upstream/include repro.cpp


template <class A, class T, size_t N, class... Values>
// no A parameter: callers pass no explicit template argument, so deduction stays constrained
template <class T, size_t N, class... Values>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only for this one and not the one above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I missed it. I will fix shortly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only fixed the overload my std::simd repro hit without looking around too much.

…ue ctors

The emulated set overloads named a template parameter A that no argument deduces. The explicit kernel::set<A> calls could instantiate an unrelated emulated register type.
The overloads drop A, and the callers let deduction pick the overload.

Assisted-by: Qwen3.8-27B-FP8
@DiamonDinoia
DiamonDinoia force-pushed the fix-emulated-batch-bool branch from 3d0d65e to 18eb965 Compare December 1, 2026 14:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants