Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

risc-v: failed to conversion between rvv register type and batch<T> or batch<T, A> #1074

Open
Ag-Cu opened this issue Dec 20, 2024 · 0 comments

Comments

@Ag-Cu
Copy link

Ag-Cu commented Dec 20, 2024

When using xsimd on the RISC-V platform, I found that converting between RVV register types and xsimd's batch-related types is quite tricky. This might be due to the variable vector length of RVV.

Here is an example of using xsimd on a platform that supports AVX:

#if XSIMD_WITH_AVX2
inline xsimd::batch<int64_t> cvtU32toI64(
    xsimd::batch<int32_t, xsimd::sse2> values) {
  return _mm256_cvtepu32_epi64(values);
}

Such code compiles smoothly. However, on a platform that supports RVV, if a RVV register type is returned, it cannot be smoothly converted into a batch type, here are two simple situation I met before:

https://godbolt.org/z/Gazvx7f98

Here are more information about my work(porting velox to risc-v using xsimd):

https://github.com/facebookincubator/velox/blob/main/velox/common/base/SimdUtil-inl.h

So, how can I elegantly use both xsimd and RVV intrinsics simultaneously?

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

No branches or pull requests

1 participant