mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
disable asm w/ x64 instructions set on i386
This commit is contained in:
parent
7c863a9fa5
commit
997830f31b
3 changed files with 5 additions and 5 deletions
|
@ -48,7 +48,7 @@ set(crypto_sources
|
||||||
CryptonightR_JIT.c
|
CryptonightR_JIT.c
|
||||||
tree-hash.c)
|
tree-hash.c)
|
||||||
|
|
||||||
if(ARCH_ID STREQUAL "i386" OR ARCH_ID STREQUAL "x86_64" OR ARCH_ID STREQUAL "x86-64")
|
if(ARCH_ID STREQUAL "x86_64" OR ARCH_ID STREQUAL "x86-64")
|
||||||
list(APPEND crypto_sources CryptonightR_template.S)
|
list(APPEND crypto_sources CryptonightR_template.S)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "CryptonightR_template.h"
|
#include "CryptonightR_template.h"
|
||||||
|
|
||||||
static const uint8_t prologue[] = {
|
static const uint8_t prologue[] = {
|
||||||
#if defined __i386 || defined __x86_64__
|
#if defined __x86_64__
|
||||||
0x4C, 0x8B, 0xD7, // mov r10, rdi
|
0x4C, 0x8B, 0xD7, // mov r10, rdi
|
||||||
0x53, // push rbx
|
0x53, // push rbx
|
||||||
0x55, // push rbp
|
0x55, // push rbp
|
||||||
|
@ -31,7 +31,7 @@ static const uint8_t prologue[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t epilogue[] = {
|
static const uint8_t epilogue[] = {
|
||||||
#if defined __i386 || defined __x86_64__
|
#if defined __x86_64__
|
||||||
0x49, 0x8B, 0xE3, // mov rsp, r11
|
0x49, 0x8B, 0xE3, // mov rsp, r11
|
||||||
0x41, 0x89, 0x1A, // mov DWORD PTR [r10], ebx
|
0x41, 0x89, 0x1A, // mov DWORD PTR [r10], ebx
|
||||||
0x41, 0x89, 0x72, 0x04, // mov DWORD PTR [r10+4], esi
|
0x41, 0x89, 0x72, 0x04, // mov DWORD PTR [r10+4], esi
|
||||||
|
@ -54,7 +54,7 @@ static const uint8_t epilogue[] = {
|
||||||
|
|
||||||
int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_func buf, const size_t buf_size)
|
int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_func buf, const size_t buf_size)
|
||||||
{
|
{
|
||||||
#if defined __i386 || defined __x86_64__
|
#if defined __x86_64__
|
||||||
uint8_t* JIT_code = (uint8_t*) buf;
|
uint8_t* JIT_code = (uint8_t*) buf;
|
||||||
const uint8_t* JIT_code_end = JIT_code + buf_size;
|
const uint8_t* JIT_code_end = JIT_code + buf_size;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
|
// - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
|
||||||
|
|
||||||
typedef void (*v4_random_math_JIT_func)(uint32_t* r)
|
typedef void (*v4_random_math_JIT_func)(uint32_t* r)
|
||||||
#if defined __i386 || defined __x86_64__
|
#if defined __x86_64__
|
||||||
__attribute__((sysv_abi))
|
__attribute__((sysv_abi))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in a new issue