dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

s390/ibm/linuxone compatibility

Open romange opened this issue 2 years ago • 1 comments

Dragonfly does not build on s390.

First impressions:

  1. lua patch request - requires changes. line 79 - remove the error. line 83 - add "-march=native" before $(OPTFLAGS)
  2. configuring requires -DMARCH_OPT="-march=native" support
  3. sse instruction are not supported and emmintrin.h is not present. however __s390__ , __s390x__, __zarch__ are defined. therefore we can fallback on scalar code for this architecture. Requires changes in dashtable and bitpacking.cc

romange avatar Mar 14 '23 07:03 romange

Thank you @romange for giving this a go.

I hope some of the info I'm sharing here will be useful: https://github.com/simd-everywhere/simde/commit/5b9b2af4ce3a9ab2d9dab5850d024eca2d5802dc https://github.com/simd-everywhere/simde/commit/fec505381cddc565067ce76979824de0f3e11d48 https://gcc.gnu.org/onlinedocs/gcc/S_002f390-and-zSeries-Options.html

In summary, -march=native and -mzvector seem important. That's about as far as I understand 😛

Below 2 links are from docs of a newer Clang-based compiler toolchain for IBM Z (Open XL C/C++ for zOS): https://www.ibm.com/docs/en/open-xl-c-cpp-zos/1.1?topic=options-qvector https://www.ibm.com/docs/en/open-xl-c-cpp-zos/1.1?topic=support-options

Although s390x runs linux and not zOS, some of the info may be useful for reference.

EDIT: s390 refers to 32-bit arch (but 31-bit addressing), whereas s390x refers to the 64-bit arch 😄 https://en.wikipedia.org/wiki/31-bit_computing#Linux/390

v1gnesh avatar Mar 19 '23 07:03 v1gnesh

Also, I hope this also helps for reference - https://src.fedoraproject.org/rpms/gcc/blob/rawhide/f/gcc.spec ... contains mentions of s390intrin.h, for when building with gcc. Can't remember where I found that DF builds with gcc.

v1gnesh avatar Apr 02 '23 03:04 v1gnesh

@romange, Can you assign this issue to me, please?

iko1 avatar Apr 29 '23 15:04 iko1

Done @iko1

romange avatar Apr 29 '23 16:04 romange

May be off-topic, but out of curiosity, is anyone still using System/390 in production today?

ThatOneCalculator avatar Jun 02 '23 22:06 ThatOneCalculator

Uh, yes @ThatOneCalculator. The question is like asking if anyone is using x86 today. Just like we're on whatever upgraded bunch of instruction set extensions in the x86 family today, S390 is where one such thing started. s390 refers to 32-bit arch, and s390x refers to 64-bit arch... and s390x arch usage is very much alive & kicking. I don't personally know the actual figures, but you can look up figures from IBM and have a pinch of salt next to ya :)

v1gnesh avatar Jun 03 '23 01:06 v1gnesh

Ah, gotcha. Thanks for the clarification!

ThatOneCalculator avatar Jun 03 '23 01:06 ThatOneCalculator