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
support building for e2k (Elbrus2000) CPU architecture (VLIW) #871
Conversation
Wow, exciting 💪 |
// Elbrus e2k architecture | ||
#define JPH_CPU_E2K | ||
#define JPH_CPU_ADDRESS_BITS 64 | ||
#define JPH_USE_SSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is safer to first check the availability of the SSE macro, and then enable it.
#if defined(__SSE__) && !defined(JPH_USE_SSE)
#define JPH_USE_SSE
#endif
You can do the same with the rest of the macros (SSE4_1, SSE4_2, AVX, AVX2, F16C, LZCNT, BMI).
Hello, It's a cool project for sure, but I'm not sure if I want to support this in Jolt. I have no idea how widespread these CPUs are (I had never heard of them). Looking at the change, isn't it possible to support it without having an JPH_CPU_E2K define? Since E2K is an x86 CPU (and I'm hoping that the compiler defines the relevant define for it), I think you can achieve the same by just disabling the relevant instruction sets by adding one or more of the following defines to cmake:
|
Unfortunately E2K it not x86 (or even near it), it is VLIW (very long instruction word) architecture.
is defined and CANNOT be defined globally for this arch. |
If you don't want to merge this (I think no maintaining is required from your side - maybe just I will occasionally send patches if code stops compiling after some large changes - but I don't expect so because core headers are not changing frequently) just say, I will abandon PR (and just proceed maintaining altered JoltPhysics source code in DagorEngine project) |
Ok, I've merged it. It is indeed unlikely to get in the way. How common is this CPU? |
It is CPU developed in Russia, started at 200X. Now 6th generation of CPU is available. |
Elbrus 2000 (aka e2k) is a 64-bit little-endian WLIV architecture (more info https://github.com/ilyakurdyukov/e2k-ports).
This change adds compilation for e2k (using SSE intrinsics that are translated to close equivalents for Elbrus2000 CPU instructions) with LCC compiler (mimics GCC 9.3.0).
Since LCC issues more warnings JoltPhysics cannot be compiled with treat-warning-as-errors, so we setup and compile as:
cmake . -DENABLE_ALL_WARNINGS=OFF
Internal tests passed:
./UnitTests
./PerformanceTest