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
Added Elbrus 2000 architecture #3425
Conversation
Benchmark results:
|
what's the difference with just using an x86-64 compile? |
Different compiler, different optimization levels. LCC E2K -O4 == GCC x86-64 -O3, need flags to tune architecture binary: -march (elbrus-v2, elbrus-v3, elbrus-v4, elbrus-v5, elbrus-v6). |
sure, but elbrus can run x86-64 code. How much better is this patch? |
It can run x86-64 in emulation mode, but this patch brings e2k native support. |
Can you answer the question posed by @Sopel97 , what are the bench numbers for this patch before and after? |
./stockfish bench 256 8 16 In ARCH=x86-64 compilation mode results are:
In ARCH=e2k-v4 compilation mode results are:
|
Thanks for the patch, good to discover the Elbrus processor brand :-) I would need at least the default bench number to check that it is the same as Intel/arm etc. What is the result of this command ?
|
Another remark is that the changes to the makefile and to the output of Is there a way to use a generic flag for the compiler which would say "use the best available variant for the current machine", or something like that? |
@EntityFX can you report the output of Honestly, I'm wonder if we should support this, I think it is a really rare architecture. Do you have any projects based on this code that would run on this architecture? Just trying to get a feel for it. |
Elbrus-8CB (E8C2) @ 1.55 GHz
|
|
Not very own, it uses frontend from EDG (Edison Design Group). You can check that by
You can assume that elbrus-v2 is legacy hardware and deprecated. Starting from elbrus-v3 you can assume that SSE4.1 is supported. Also it supports MMX intrinsics, which can be used in places where you don't need 128-bit wide vectors. 128-bit vectors on Elbrus before v5 are emulated using two 64-bit vector instructions. Even AVX/AVX2 is emulated in that way, and have enabled by default in LCC (as if -mavx2 given). |
I think this is unnecessary and it is also wrong, because
It always happens automatically, no flag to compiler needed at all (only if you want to cross-compile), so in my opinion the build system shouldn't care about that.
Use And if you really need to print exact LCC version, then use #define dot_ver2(n) \
compiler += (char)'.'; \
compiler += (char)('0' + (n) / 10); \
compiler += (char)('0' + (n) % 10);
compiler += "LCC ";
compiler += std::to_string(__LCC__ / 100);
dot_ver2(__LCC__ % 100)
dot_ver2(__LCC_MINOR__)
Don't use -O4, it generates too much binary code. MCST is also going to change -O4 to -O3, -O3 to -O2, so less tuning is required for various software build systems. Therefore, I also recommend removing this change. |
Considering the development of the architecture came a long way and still quite active, I guess adding compiler support is more or less equivalent to supporting Apple M1 for benchmark purposes rather than their practical use, which we already did, so I'm for it. |
I suggest the patch can be updated to include the review comments, and made as small as meaningful, e.g. drop some of the legacy architectures. |
Thank you, I've updated my code according your recommendations, please review. |
Patch looks much better now, thanks! |
Fine. LCC 1.25.09 failed to compile due to constexpr related errors, newer LCC 1.25.15 compiles without errors.
|
@EntityFX let me know your full name for the AUTHORS file, if you wish. |
using your name as inferred from the email address for now, let me know if there is a mistake. |
EntityFX artem.solopiy@gmail.com |
thanks that's what I used. BTW, since we don't have access to the hardware and no CI on it, I would appreciate if you could check from time to time if things still work for you. |
e2k (Elbrus 2000) - this is a VLIW/EPIC architecture, the like Intel Itanium (IA-64) architecture. The architecture has half native / half software support for most Intel/AMD SIMD (e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4) via intrinsics. https://en.wikipedia.org/wiki/Elbrus_2000 closes official-stockfish#3425 No functional change
e2k (Elbrus 2000) - this is VLIW/EPIC architecture, like Intel Itanium (IA-64) architecture.
Architecture has half native / half software support of most Intel/AMD SIMD (e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4) via intrinsics.
https://en.wikipedia.org/wiki/Elbrus_2000
Cpu Info (Elbrus 8CB):
Compiler: Elbrus C Compiler (in code: LCC) (own MCST's compiler with GCC compatibility, not Little C Compiler)
Architecture name: E2k (in code: e2k)
Architecture versions: elbrus-v2 (generic), elbrus-v3 (e2k-v3), elbrus-v4 (e2k-v4), elbrus-v5 (e2k-v5), elbrus-v6 (e2k-v6)