Skip to content
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

Master2 #6

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ cmake_minimum_required(VERSION 3.5)

project(RandomX)

set(CMAKE_VERBOSE_MAKEFILE ON)

set(randomx_sources
src/aes_hash.cpp
src/argon2_ref.c
Expand Down Expand Up @@ -212,9 +214,14 @@ endif()
set(RANDOMX_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "RandomX Include path")

# Define variables for custom preprocessor definitions with default values
option(USE_HIDDEN_VISIBILITY "Include -fvisibility=hidden flag" OFF)
set(RANDOMX_ARGON_MEMORY "" CACHE STRING "Set the RANDOMX_ARGON_MEMORY value")
set(RANDOMX_DATASET_BASE_SIZE "" CACHE STRING "Set the RANDOMX_DATASET_BASE_SIZE value")

if(USE_HIDDEN_VISIBILITY)
add_compile_options("-fvisibility=hidden")
endif()

add_library(randomx ${randomx_sources})

# Apply the custom preprocessor definitions only if they are set
Expand Down
1 change: 0 additions & 1 deletion src/randomx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ extern "C" {
}

randomx_dataset *randomx_alloc_dataset(randomx_flags flags) {

//fail on 32-bit systems if DatasetSize is >= 4 GiB
if (randomx::DatasetSize > std::numeric_limits<size_t>::max()) {
return nullptr;
Expand Down
93 changes: 0 additions & 93 deletions src/tests/rng-tests.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions src/vm_interpreted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ namespace randomx {

template<class Allocator, bool softAes>
void InterpretedVm<Allocator, softAes>::execute() {

NativeRegisterFile nreg;

for(unsigned i = 0; i < RegisterCountFlt; ++i)
Expand All @@ -71,7 +70,7 @@ namespace randomx {
spAddr0 &= ScratchpadL3Mask64;
spAddr1 ^= spMix >> 32;
spAddr1 &= ScratchpadL3Mask64;

for (unsigned i = 0; i < RegistersCount; ++i)
nreg.r[i] ^= load64(scratchpad + spAddr0 + 8 * i);

Expand All @@ -85,6 +84,7 @@ namespace randomx {

mem.mx ^= nreg.r[config.readReg2] ^ nreg.r[config.readReg3];
mem.mx &= CacheLineAlignMask;

datasetPrefetch(datasetOffset + mem.mx);
datasetRead(datasetOffset + mem.ma, nreg.r);
std::swap(mem.mx, mem.ma);
Expand Down
Loading