Add IBM Z (s390x) support#1307
Conversation
|
We need to setup CI for this. @Andreas-Krebbel could you do that, probably based on how it's done for vsx? |
I can give it a try. Yes. |
c5da613 to
fccb073
Compare
|
I have tested the workflow locally and it seems to work fine. I see less testcases being executed though: |
serge-sans-paille
left a comment
There was a problem hiding this comment.
Some nit picking, just missing the runtime detection and we're good.
It also means we should improve CI to detect that...
| template <class A, class T_in, class T_out> | ||
| XSIMD_INLINE batch<T_out, A> bitwise_cast(batch<T_in, A> const& self, batch<T_out, A> const&, requires_arch<vxe>) noexcept | ||
| { | ||
| return (typename batch<T_out, A>::register_type)(self.data); |
There was a problem hiding this comment.
nit: could be a static_cast, but we're not very diligent on this, so feel free to ignore.
There was a problem hiding this comment.
A static_cast didn't work with GCC since it doesn't allow a cast between vector types with different signness. clang was ok with it though.
| template <class A> | ||
| XSIMD_INLINE batch<float, A> complex_low(batch<std::complex<float>, A> const& self, requires_arch<vxe>) noexcept | ||
| { | ||
| uv16qi perm = (uv16qi) { 0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23 }; |
There was a problem hiding this comment.
gcc constructor expression. that's a gnu extension, but I guess it's fine. I've been using it for PowerPC too.
| // equivalent types. | ||
| XSIMD_DECLARE_SIMD_BOOL_VXE_REGISTER(signed char, signed char, char); | ||
| XSIMD_DECLARE_SIMD_BOOL_VXE_REGISTER(unsigned char, unsigned char, char); | ||
| #ifdef __CHAR_UNSIGNED__ |
There was a problem hiding this comment.
If you could avoid using a macro using a type alais instead, that would be cool.
There was a problem hiding this comment.
It would work with GCC, but it didn't with clang. Clang does not seem to accept type aliases in combination with __vector bool.
|
The error in arch consistency is related to qemu emulation capability, more on https://www.qemu.org/docs/master/system/target-s390x.html |
77f0168 to
257168d
Compare
|
This all looks good to me, thanks a lot for going through this and adressing the reviews. I'll leave it to you to squash and rebase and we're good! |
ed3551e to
6bb1387
Compare
|
@Andreas-Krebbel the risc-v issue is not on you, I'll accept your PR anyway and leave it to @AntoinePrv to fix it ;-) |
|
@serge-sans-paille, sure but please wait for it to be fixed before merging this one (#1322). |
|
@Andreas-Krebbel can you rebase your PR? |
c0203ba to
784eaa2
Compare
Add support for the IBM Z (s390x) architecture leveraging the GCC and Clang compiler intrinsics which are similar to what is available for IBM Power with the Altivec extension. SIMD hardware is available on IBM Z starting with IBM z13. However, the XSIMD support requires at least IBM z14 to also support float vectors.
784eaa2 to
063778e
Compare
This PR adds support for IBM Z. It leverages the compiler intrinsics available with GCC and Clang:
https://www.ibm.com/docs/en/open-xl-c-cpp-zos/2.2.0?topic=reference-vector-programming-support
The intrinsics are similar to what is available for IBM Power with altivec (VSX). I've started with an initial version of my patch before VSX has been added to XSIMD. However, while refreshing my changes to the latest upstream level I've used the VSX implementation as a base.
I've tested the patch on an IBM z17 (latest machine generation) with GCC and Clang: