-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 JIT CNV4 compiler for ppc64le, ppc64 and ppc #5540
Conversation
src/crypto/slow-hash.c
Outdated
}\ | ||
else if (sizeof(void*) == sizeof(uint64_t)){\ | ||
tmp+=4088; \ | ||
}\ |
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.
That could be tmp += 4096 - sizeof(void*);
src/crypto/CryptonightR_JIT.c
Outdated
} | ||
} | ||
if(idx >= INST_LEN){ | ||
printf("JIT BUFFER FILLED UP!\n"); |
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.
MERROR
src/crypto/CryptonightR_JIT.c
Outdated
@@ -117,7 +223,82 @@ int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_f | |||
__builtin___clear_cache((char*)buf, (char*)JIT_code); | |||
|
|||
return 0; | |||
#elif defined __PPC__ || defined __PPC64__ | |||
printf("Started compiling PPC64 JIT at %p\n",buf); |
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.
MDEBUG
src/crypto/CryptonightR_JIT.c
Outdated
} | ||
#endif | ||
|
||
uint8_t regN[] = {4,5,6,7,8,9,10,11,12}; |
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.
static const ?
src/crypto/CryptonightR_JIT.c
Outdated
uint8_t regN[] = {4,5,6,7,8,9,10,11,12}; | ||
uint8_t r0 = 0; | ||
ppcJIT_load(JIT_code,prologue,INST_LEN); | ||
for (uint32_t i = 0; i < 70; ++i) |
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.
Where does the 70 come from ?
else if(sizeof(void*) == sizeof(uint64_t)){ | ||
uint64_t* fP = (uint64_t*)JIT_code; | ||
*(fP+l-1) = (uint64_t)JIT_code; | ||
} |
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.
That can also be a single op.
I'll fix this your comments and some extra bugs in a new pull, just reject this one. |
You should push if instead once you've fixed everything (and squash commits). |
Test project /monero-m/build/Linux/master/debug It's passing cnv4jit test and the hash_slow4 test now, and x86 is unaffected. I guess its ready for merging. |
How long did the jit test take before that ? |
Double the time. I haven’t implemented altivec yet. For reference my xmrig fork went from 2 hash/s/core to 60 hash/s/core after optimizations. |
Can you squash those commits please ? |
Hmm, how do I that? I just tried and it added two more commits. |
Meh, I'll just delete the repo and refork, dunno what I did wrong. |
+duplicate of #5543 |
Initial version of JIT compiler for PPC, ported from my fork of XMRIG. Still requires testing.