Skip to content

Fix VSX clang build#1337

Open
Andreas-Krebbel wants to merge 1 commit intoxtensor-stack:masterfrom
Andreas-Krebbel:vsx-fixes
Open

Fix VSX clang build#1337
Andreas-Krebbel wants to merge 1 commit intoxtensor-stack:masterfrom
Andreas-Krebbel:vsx-fixes

Conversation

@Andreas-Krebbel
Copy link
Copy Markdown
Contributor

This fixes issue #1257.
Clang appears to be somewhat stricter when it comes to checking which types are allowed with the __vector keyword. In order to fix this I've copied what I did for IBM Z (s390x) VXE support. The element types used in batch<T, A> are mapped to a matching register_type which is accepted by the compiler intrinsics.

With this tests run clean with GCC and Clang for me.

The clang build, however, still shows some warnings on code like this:
kernel::store_aligned(mem, (batch<int>)in, vsx {});

xcast.cpp:8:42: warning: implicit conversion between vector types (''register_type' (aka 'xsimd::types::get_bool_simd_register<int, xsimd::vsx>::type::register_type')'
      and ''register_type' (aka 'xsimd::types::simd_register<int, xsimd::vsx>::register_type')') is deprecated; in the future, the behavior implied by '-fno-lax-vector-conversions' will be
      the default [-Wdeprecate-lax-vec-conv-all]
    8 |   kernel::store_aligned(mem, (batch<int>)in, vsx {});
      |                                          ^
1 warning generated

I think the reason for that is that clang does not accept implicit casts between __vector bool int to __vector int.

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.

1 participant