mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 12:09:22 +00:00
RandomX: align args
tempHash/output must be 16-byte aligned for randomx_calculate_hash{,_first,_next}
This commit is contained in:
parent
bfd5a81937
commit
a705ab775b
4 changed files with 5 additions and 5 deletions
|
@ -215,7 +215,7 @@ void xmrig::CpuWorker<N>::start()
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
bool first = true;
|
bool first = true;
|
||||||
uint64_t tempHash[8] = {};
|
alignas(16) uint64_t tempHash[8] = {};
|
||||||
|
|
||||||
// RandomX is faster, we don't need to store stats so often
|
// RandomX is faster, we don't need to store stats so often
|
||||||
if (m_job.currentJob().algorithm().family() == Algorithm::RANDOM_X) {
|
if (m_job.currentJob().algorithm().family() == Algorithm::RANDOM_X) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ private:
|
||||||
const int m_astrobwtMaxSize;
|
const int m_astrobwtMaxSize;
|
||||||
const Miner *m_miner;
|
const Miner *m_miner;
|
||||||
cryptonight_ctx *m_ctx[N];
|
cryptonight_ctx *m_ctx[N];
|
||||||
uint8_t m_hash[N * 32]{ 0 };
|
alignas(16) uint8_t m_hash[N * 32]{ 0 };
|
||||||
VirtualMemory *m_memory = nullptr;
|
VirtualMemory *m_memory = nullptr;
|
||||||
WorkerJob<N> m_job;
|
WorkerJob<N> m_job;
|
||||||
|
|
||||||
|
|
|
@ -387,8 +387,8 @@ void SelectSoftAESImpl(size_t threadsCount)
|
||||||
for (size_t t = 0; t < threadsCount; ++t) {
|
for (size_t t = 0; t < threadsCount; ++t) {
|
||||||
threads.emplace_back([&, t]() {
|
threads.emplace_back([&, t]() {
|
||||||
std::vector<uint8_t> scratchpad(10 * 1024);
|
std::vector<uint8_t> scratchpad(10 * 1024);
|
||||||
uint8_t hash[64] = {};
|
alignas(16) uint8_t hash[64] = {};
|
||||||
uint8_t state[64] = {};
|
alignas(16) uint8_t state[64] = {};
|
||||||
do {
|
do {
|
||||||
(*impl[i])(scratchpad.data(), scratchpad.size(), hash, state);
|
(*impl[i])(scratchpad.data(), scratchpad.size(), hash, state);
|
||||||
++count[t];
|
++count[t];
|
||||||
|
|
|
@ -114,7 +114,7 @@ static void getResults(JobBundle &bundle, std::vector<JobResult> &results, uint3
|
||||||
{
|
{
|
||||||
const auto &algorithm = bundle.job.algorithm();
|
const auto &algorithm = bundle.job.algorithm();
|
||||||
auto memory = new VirtualMemory(algorithm.l3(), false, false, false);
|
auto memory = new VirtualMemory(algorithm.l3(), false, false, false);
|
||||||
uint8_t hash[32]{ 0 };
|
alignas(16) uint8_t hash[32]{ 0 };
|
||||||
|
|
||||||
if (algorithm.family() == Algorithm::RANDOM_X) {
|
if (algorithm.family() == Algorithm::RANDOM_X) {
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
|
Loading…
Reference in a new issue