Merge branch 'dev'

This commit is contained in:
XMRig 2020-02-15 21:23:59 +07:00
commit 9fe9e8989d
No known key found for this signature in database
GPG key ID: 446A53638BE94409
58 changed files with 10425 additions and 2437 deletions

View file

@ -1,3 +1,11 @@
# v5.6.0
- [#1536](https://github.com/xmrig/xmrig/pull/1536) Added workaround for new AMD GPU drivers.
- [#1546](https://github.com/xmrig/xmrig/pull/1546) Fixed generic OpenCL code for AMD Navi GPUs.
- [#1551](https://github.com/xmrig/xmrig/pull/1551) Added RandomX JIT for AMD Navi GPUs.
- Added health information for AMD GPUs (clocks/power/fan/temperature) via ADL (Windows) and sysfs (Linux).
- Fixed possible nicehash nonce overflow in some conditions.
- Fixed wrong OpenCL platform on macOS, option `platform` now ignored on this OS.
# v5.5.3 # v5.5.3
- [#1529](https://github.com/xmrig/xmrig/pull/1529) Fixed crash on Bulldozer CPUs. - [#1529](https://github.com/xmrig/xmrig/pull/1529) Fixed crash on Bulldozer CPUs.

View file

@ -19,6 +19,7 @@ option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
option(WITH_OPENCL "Enable OpenCL backend" ON) option(WITH_OPENCL "Enable OpenCL backend" ON)
option(WITH_CUDA "Enable CUDA backend" ON) option(WITH_CUDA "Enable CUDA backend" ON)
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON) option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON) option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF) option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
@ -53,7 +54,6 @@ set(HEADERS
src/net/JobResult.h src/net/JobResult.h
src/net/JobResults.h src/net/JobResults.h
src/net/Network.h src/net/Network.h
src/net/NetworkState.h
src/net/strategies/DonateStrategy.h src/net/strategies/DonateStrategy.h
src/Summary.h src/Summary.h
src/version.h src/version.h
@ -103,7 +103,6 @@ set(SOURCES
src/core/Miner.cpp src/core/Miner.cpp
src/net/JobResults.cpp src/net/JobResults.cpp
src/net/Network.cpp src/net/Network.cpp
src/net/NetworkState.cpp
src/net/strategies/DonateStrategy.cpp src/net/strategies/DonateStrategy.cpp
src/Summary.cpp src/Summary.cpp
src/xmrig.cpp src/xmrig.cpp

2342
src/3rdparty/adl/adl_defines.h vendored Normal file

File diff suppressed because it is too large Load diff

44
src/3rdparty/adl/adl_sdk.h vendored Normal file
View file

@ -0,0 +1,44 @@
//
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
//
// MIT LICENSE:
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
/// \file adl_sdk.h
/// \brief Contains the definition of the Memory Allocation Callback.\n <b>Included in ADL SDK</b>
///
/// \n\n
/// This file contains the definition of the Memory Allocation Callback.\n
/// It also includes definitions of the respective structures and constants.\n
/// <b> This is the only header file to be included in a C/C++ project using ADL </b>
#ifndef ADL_SDK_H_
#define ADL_SDK_H_
#include "adl_structures.h"
#if defined (LINUX)
#define __stdcall
#endif /* (LINUX) */
/// Memory Allocation Call back
typedef void* ( __stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );
#endif /* ADL_SDK_H_ */

3440
src/3rdparty/adl/adl_structures.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -64,13 +64,17 @@ public:
} }
inline void nextRound(uint32_t rounds, uint32_t roundSize) inline bool nextRound(uint32_t rounds, uint32_t roundSize)
{ {
bool ok = true;
m_rounds[index()]++; m_rounds[index()]++;
if ((m_rounds[index()] % rounds) == 0) { if ((m_rounds[index()] % rounds) == 0) {
for (size_t i = 0; i < N; ++i) { for (size_t i = 0; i < N; ++i) {
*nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash()); *nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash(), &ok);
if (!ok) {
break;
}
} }
} }
else { else {
@ -78,6 +82,8 @@ public:
*nonce(i) += roundSize; *nonce(i) += roundSize;
} }
} }
return ok;
} }
@ -114,16 +120,19 @@ inline uint32_t *xmrig::WorkerJob<1>::nonce(size_t)
template<> template<>
inline void xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize) inline bool xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
{ {
bool ok = true;
m_rounds[index()]++; m_rounds[index()]++;
if ((m_rounds[index()] % rounds) == 0) { if ((m_rounds[index()] % rounds) == 0) {
*nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash()); *nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash(), &ok);
} }
else { else {
*nonce() += roundSize; *nonce() += roundSize;
} }
return ok;
} }

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -56,6 +56,7 @@ public:
virtual void execCommand(char command) = 0; virtual void execCommand(char command) = 0;
virtual void prepare(const Job &nextJob) = 0; virtual void prepare(const Job &nextJob) = 0;
virtual void printHashrate(bool details) = 0; virtual void printHashrate(bool details) = 0;
virtual void printHealth() = 0;
virtual void setJob(const Job &job) = 0; virtual void setJob(const Job &job) = 0;
virtual void start(IWorker *worker, bool ready) = 0; virtual void start(IWorker *worker, bool ready) = 0;
virtual void stop() = 0; virtual void stop() = 0;

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -319,6 +319,11 @@ void xmrig::CpuBackend::printHashrate(bool details)
} }
void xmrig::CpuBackend::printHealth()
{
}
void xmrig::CpuBackend::setJob(const Job &job) void xmrig::CpuBackend::setJob(const Job &job)
{ {
if (!isEnabled()) { if (!isEnabled()) {

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -59,6 +59,7 @@ protected:
const String &type() const override; const String &type() const override;
void prepare(const Job &nextJob) override; void prepare(const Job &nextJob) override;
void printHashrate(bool details) override; void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override; void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override; void start(IWorker *worker, bool ready) override;
void stop() override; void stop() override;

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -48,6 +48,20 @@ namespace xmrig {
static constexpr uint32_t kReserveCount = 32768; static constexpr uint32_t kReserveCount = 32768;
template<size_t N>
inline bool nextRound(WorkerJob<N> &job)
{
if (!job.nextRound(kReserveCount, 1)) {
JobResults::done(job.currentJob());
return false;
}
return true;
}
} // namespace xmrig } // namespace xmrig
@ -221,14 +235,20 @@ void xmrig::CpuWorker<N>::start()
first = false; first = false;
randomx_calculate_hash_first(m_vm->get(), tempHash, m_job.blob(), job.size()); randomx_calculate_hash_first(m_vm->get(), tempHash, m_job.blob(), job.size());
} }
m_job.nextRound(kReserveCount, 1);
if (!nextRound(m_job)) {
break;
}
randomx_calculate_hash_next(m_vm->get(), tempHash, m_job.blob(), job.size(), m_hash); randomx_calculate_hash_next(m_vm->get(), tempHash, m_job.blob(), job.size(), m_hash);
} }
else else
# endif # endif
{ {
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height()); fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
m_job.nextRound(kReserveCount, 1); if (!nextRound(m_job)) {
break;
};
} }
for (size_t i = 0; i < N; ++i) { for (size_t i = 0; i < N; ++i) {

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -254,7 +254,8 @@ public:
} }
} }
LOG_INFO(CYAN_BOLD("#%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s", LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
tag,
device.index(), device.index(),
device.topology().toString().data(), device.topology().toString().data(),
health.power, health.power,
@ -338,13 +339,8 @@ const xmrig::String &xmrig::CudaBackend::type() const
} }
void xmrig::CudaBackend::execCommand(char command) void xmrig::CudaBackend::execCommand(char)
{ {
# ifdef XMRIG_FEATURE_NVML
if (command == 'e' || command == 'E') {
d_ptr->printHealth();
}
# endif
} }
@ -387,6 +383,14 @@ void xmrig::CudaBackend::printHashrate(bool details)
} }
void xmrig::CudaBackend::printHealth()
{
# ifdef XMRIG_FEATURE_NVML
d_ptr->printHealth();
# endif
}
void xmrig::CudaBackend::setJob(const Job &job) void xmrig::CudaBackend::setJob(const Job &job)
{ {
const auto &cuda = d_ptr->controller->config()->cuda(); const auto &cuda = d_ptr->controller->config()->cuda();
@ -455,15 +459,6 @@ void xmrig::CudaBackend::stop()
void xmrig::CudaBackend::tick(uint64_t ticks) void xmrig::CudaBackend::tick(uint64_t ticks)
{ {
d_ptr->workers.tick(ticks); d_ptr->workers.tick(ticks);
# ifdef XMRIG_FEATURE_NVML
if (isEnabled()) {
auto seconds = d_ptr->controller->config()->healthPrintTime();
if (seconds && ticks && (ticks % (seconds * 2)) == 0) {
d_ptr->printHealth();
}
}
# endif
} }

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -59,6 +59,7 @@ protected:
void execCommand(char command) override; void execCommand(char command) override;
void prepare(const Job &nextJob) override; void prepare(const Job &nextJob) override;
void printHashrate(bool details) override; void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override; void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override; void start(IWorker *worker, bool ready) override;
void stop() override; void stop() override;

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -139,7 +139,9 @@ void xmrig::CudaWorker::start()
} }
const size_t batch_size = intensity(); const size_t batch_size = intensity();
m_job.nextRound(roundSize(batch_size), batch_size); if (!m_job.nextRound(roundSize(batch_size), batch_size)) {
JobResults::done(m_job.currentJob());
}
storeStats(); storeStats();
std::this_thread::yield(); std::this_thread::yield();

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -27,11 +27,11 @@
#include <string> #include <string>
#include "backend/opencl/OclBackend.h"
#include "backend/common/Hashrate.h" #include "backend/common/Hashrate.h"
#include "backend/common/interfaces/IWorker.h" #include "backend/common/interfaces/IWorker.h"
#include "backend/common/Tags.h" #include "backend/common/Tags.h"
#include "backend/common/Workers.h" #include "backend/common/Workers.h"
#include "backend/opencl/OclBackend.h"
#include "backend/opencl/OclConfig.h" #include "backend/opencl/OclConfig.h"
#include "backend/opencl/OclLaunchData.h" #include "backend/opencl/OclLaunchData.h"
#include "backend/opencl/OclWorker.h" #include "backend/opencl/OclWorker.h"
@ -52,6 +52,13 @@
#endif #endif
#ifdef XMRIG_FEATURE_ADL
#include "backend/opencl/wrappers/AdlLib.h"
namespace xmrig { static const char *kAdlLabel = "ADL"; }
#endif
namespace xmrig { namespace xmrig {
@ -59,14 +66,15 @@ extern template class Threads<OclThreads>;
constexpr const size_t oneMiB = 1024U * 1024U; constexpr const size_t oneMiB = 1024U * 1024U;
static const char *kLabel = "OPENCL";
static const char *tag = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl "); static const char *tag = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl ");
static const String kType = "opencl"; static const String kType = "opencl";
static std::mutex mutex; static std::mutex mutex;
static void printDisabled(const char *reason) static void printDisabled(const char *label, const char *reason)
{ {
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", "OPENCL", reason); Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", label, reason);
} }
@ -129,11 +137,11 @@ public:
void init(const OclConfig &cl) void init(const OclConfig &cl)
{ {
if (!cl.isEnabled()) { if (!cl.isEnabled()) {
return printDisabled(""); return printDisabled(kLabel, "");
} }
if (!OclLib::init(cl.loader())) { if (!OclLib::init(cl.loader())) {
return printDisabled(RED_S " (failed to load OpenCL runtime)"); return printDisabled(kLabel, RED_S " (failed to load OpenCL runtime)");
} }
if (platform.isValid()) { if (platform.isValid()) {
@ -142,14 +150,30 @@ public:
platform = cl.platform(); platform = cl.platform();
if (!platform.isValid()) { if (!platform.isValid()) {
return printDisabled(RED_S " (selected OpenCL platform NOT found)"); return printDisabled(kLabel, RED_S " (selected OpenCL platform NOT found)");
} }
devices = platform.devices(); devices = platform.devices();
if (devices.empty()) { if (devices.empty()) {
return printDisabled(RED_S " (no devices)"); return printDisabled(kLabel, RED_S " (no devices)");
} }
# ifdef XMRIG_FEATURE_ADL
if (cl.isAdlEnabled()) {
if (AdlLib::init()) {
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "press " MAGENTA_BG(WHITE_BOLD_S "e") " for health report",
kAdlLabel
);
}
else {
printDisabled(kAdlLabel, RED_S " (failed to load ADL)");
}
}
else {
printDisabled(kAdlLabel, "");
}
# endif
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("#%zu ") WHITE_BOLD("%s") "/" WHITE_BOLD("%s"), "OPENCL", platform.index(), platform.name().data(), platform.version().data()); Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("#%zu ") WHITE_BOLD("%s") "/" WHITE_BOLD("%s"), "OPENCL", platform.index(), platform.name().data(), platform.version().data());
for (const OclDevice &device : devices) { for (const OclDevice &device : devices) {
@ -204,6 +228,32 @@ public:
} }
# ifdef XMRIG_FEATURE_ADL
void printHealth()
{
if (!AdlLib::isReady()) {
return;
}
for (const auto &device : devices) {
const auto health = AdlLib::health(device);
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CYAN_BOLD(" %4u") CYAN("RPM") WHITE_BOLD(" %u/%u") "MHz",
tag,
device.index(),
device.topology().toString().data(),
health.power,
health.temperature < 60 ? 32 : (health.temperature > 85 ? 31 : 33),
health.temperature,
health.rpm,
health.clock,
health.memClock
);
}
}
# endif
Algorithm algo; Algorithm algo;
Controller *controller; Controller *controller;
OclContext context; OclContext context;
@ -237,6 +287,10 @@ xmrig::OclBackend::~OclBackend()
delete d_ptr; delete d_ptr;
OclLib::close(); OclLib::close();
# ifdef XMRIG_FEATURE_ADL
AdlLib::close();
# endif
} }
@ -270,6 +324,11 @@ const xmrig::String &xmrig::OclBackend::type() const
} }
void xmrig::OclBackend::execCommand(char)
{
}
void xmrig::OclBackend::prepare(const Job &) void xmrig::OclBackend::prepare(const Job &)
{ {
} }
@ -309,6 +368,14 @@ void xmrig::OclBackend::printHashrate(bool details)
} }
void xmrig::OclBackend::printHealth()
{
# ifdef XMRIG_FEATURE_ADL
d_ptr->printHealth();
# endif
}
void xmrig::OclBackend::setJob(const Job &job) void xmrig::OclBackend::setJob(const Job &job)
{ {
const auto &cl = d_ptr->controller->config()->cl(); const auto &cl = d_ptr->controller->config()->cl();

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -51,15 +51,15 @@ public:
~OclBackend() override; ~OclBackend() override;
protected: protected:
inline void execCommand(char) override {}
bool isEnabled() const override; bool isEnabled() const override;
bool isEnabled(const Algorithm &algorithm) const override; bool isEnabled(const Algorithm &algorithm) const override;
const Hashrate *hashrate() const override; const Hashrate *hashrate() const override;
const String &profileName() const override; const String &profileName() const override;
const String &type() const override; const String &type() const override;
void execCommand(char command) override;
void prepare(const Job &nextJob) override; void prepare(const Job &nextJob) override;
void printHashrate(bool details) override; void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override; void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override; void start(IWorker *worker, bool ready) override;
void stop() override; void stop() override;

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -35,14 +35,21 @@
namespace xmrig { namespace xmrig {
static const char *kAMD = "AMD";
static const char *kCache = "cache"; static const char *kCache = "cache";
static const char *kDevicesHint = "devices-hint"; static const char *kDevicesHint = "devices-hint";
static const char *kEnabled = "enabled"; static const char *kEnabled = "enabled";
static const char *kINTEL = "INTEL";
static const char *kLoader = "loader"; static const char *kLoader = "loader";
#ifndef XMRIG_OS_APPLE
static const char *kAMD = "AMD";
static const char *kINTEL = "INTEL";
static const char *kNVIDIA = "NVIDIA"; static const char *kNVIDIA = "NVIDIA";
static const char *kPlatform = "platform"; static const char *kPlatform = "platform";
#endif
#ifdef XMRIG_FEATURE_ADL
static const char *kAdl = "adl";
#endif
extern template class Threads<OclThreads>; extern template class Threads<OclThreads>;
@ -51,10 +58,11 @@ extern template class Threads<OclThreads>;
} }
xmrig::OclConfig::OclConfig() : #ifndef XMRIG_OS_APPLE
m_platformVendor(kAMD) xmrig::OclConfig::OclConfig() : m_platformVendor(kAMD) {}
{ #else
} xmrig::OclConfig::OclConfig() = default;
#endif
xmrig::OclPlatform xmrig::OclConfig::platform() const xmrig::OclPlatform xmrig::OclConfig::platform() const
@ -64,6 +72,7 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
return {}; return {};
} }
# ifndef XMRIG_OS_APPLE
if (!m_platformVendor.isEmpty()) { if (!m_platformVendor.isEmpty()) {
String search; String search;
String vendor = m_platformVendor; String vendor = m_platformVendor;
@ -93,6 +102,9 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
} }
return {}; return {};
# else
return platforms[0];
# endif
} }
@ -106,7 +118,14 @@ rapidjson::Value xmrig::OclConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kEnabled), m_enabled, allocator); obj.AddMember(StringRef(kEnabled), m_enabled, allocator);
obj.AddMember(StringRef(kCache), m_cache, allocator); obj.AddMember(StringRef(kCache), m_cache, allocator);
obj.AddMember(StringRef(kLoader), m_loader.toJSON(), allocator); obj.AddMember(StringRef(kLoader), m_loader.toJSON(), allocator);
# ifndef XMRIG_OS_APPLE
obj.AddMember(StringRef(kPlatform), m_platformVendor.isEmpty() ? Value(m_platformIndex) : m_platformVendor.toJSON(), allocator); obj.AddMember(StringRef(kPlatform), m_platformVendor.isEmpty() ? Value(m_platformIndex) : m_platformVendor.toJSON(), allocator);
# endif
# ifdef XMRIG_FEATURE_ADL
obj.AddMember(StringRef(kAdl), m_adl, allocator);
# endif
m_threads.toJSON(obj, doc); m_threads.toJSON(obj, doc);
@ -152,9 +171,16 @@ void xmrig::OclConfig::read(const rapidjson::Value &value)
m_cache = Json::getBool(value, kCache, m_cache); m_cache = Json::getBool(value, kCache, m_cache);
m_loader = Json::getString(value, kLoader); m_loader = Json::getString(value, kLoader);
# ifndef XMRIG_OS_APPLE
setPlatform(Json::getValue(value, kPlatform)); setPlatform(Json::getValue(value, kPlatform));
# endif
setDevicesHint(Json::getString(value, kDevicesHint)); setDevicesHint(Json::getString(value, kDevicesHint));
# ifdef XMRIG_FEATURE_ADL
m_adl = Json::getBool(value, kAdl, m_adl);
# endif
m_threads.read(value); m_threads.read(value);
generate(); generate();
@ -214,6 +240,7 @@ void xmrig::OclConfig::setDevicesHint(const char *devicesHint)
} }
#ifndef XMRIG_OS_APPLE
void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform) void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
{ {
if (platform.IsString()) { if (platform.IsString()) {
@ -224,3 +251,4 @@ void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
m_platformIndex = platform.GetUint(); m_platformIndex = platform.GetUint();
} }
} }
#endif

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -51,19 +51,31 @@ public:
inline const String &loader() const { return m_loader; } inline const String &loader() const { return m_loader; }
inline const Threads<OclThreads> &threads() const { return m_threads; } inline const Threads<OclThreads> &threads() const { return m_threads; }
# ifdef XMRIG_FEATURE_ADL
inline bool isAdlEnabled() const { return m_adl; }
# endif
private: private:
void generate(); void generate();
void setDevicesHint(const char *devicesHint); void setDevicesHint(const char *devicesHint);
void setPlatform(const rapidjson::Value &platform);
bool m_cache = true; bool m_cache = true;
bool m_enabled = false; bool m_enabled = false;
bool m_shouldSave = false; bool m_shouldSave = false;
std::vector<uint32_t> m_devicesHint; std::vector<uint32_t> m_devicesHint;
String m_loader; String m_loader;
String m_platformVendor;
Threads<OclThreads> m_threads; Threads<OclThreads> m_threads;
# ifndef XMRIG_OS_APPLE
void setPlatform(const rapidjson::Value &platform);
String m_platformVendor;
uint32_t m_platformIndex = 0; uint32_t m_platformIndex = 0;
# endif
# ifdef XMRIG_FEATURE_ADL
bool m_adl = true;
# endif
}; };

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -25,7 +25,6 @@
#include "backend/opencl/OclWorker.h" #include "backend/opencl/OclWorker.h"
#include "backend/common/Tags.h" #include "backend/common/Tags.h"
#include "backend/opencl/runners/OclCnRunner.h" #include "backend/opencl/runners/OclCnRunner.h"
#include "backend/opencl/runners/tools/OclSharedData.h" #include "backend/opencl/runners/tools/OclSharedData.h"
@ -187,7 +186,9 @@ void xmrig::OclWorker::start()
JobResults::submit(m_job.currentJob(), results, results[0xFF]); JobResults::submit(m_job.currentJob(), results, results[0xFF]);
} }
m_job.nextRound(roundSize(m_intensity), m_intensity); if (!m_job.nextRound(roundSize(m_intensity), m_intensity)) {
JobResults::done(m_job.currentJob());
}
storeStats(t); storeStats(t);
std::this_thread::yield(); std::this_thread::yield();

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

File diff suppressed because it is too large Load diff

View file

@ -43,6 +43,62 @@ along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
#define RANDOMX_JUMP_BITS 8 #define RANDOMX_JUMP_BITS 8
#define RANDOMX_JUMP_OFFSET 8 #define RANDOMX_JUMP_OFFSET 8
#if GCN_VERSION >= 15
#define S_SETPC_B64_S12_13 0xbe80200cu
#define V_AND_B32_CALC_ADDRESS 0x3638000eu
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc348000u
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c3f70u
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd7600000u
#define S_MUL_HI_U32_IMUL_R 0x9a8f1010u
#define S_MUL_I32_IMUL 0x93000000u
#define S_MUL_HI_U32_IMUL_R_2 0x9a8fff10u
#define S_MUL_HI_U32_IMUL_M 0x9aa10e10u
#define S_MOV_B32_IMUL_RCP 0xbea003ffu
#define S_MUL_HI_U32_IMUL_RCP 0x9a8f2010u
#define S_XOR_B32_64 0x89000000u
#define S_MOV_B32_XOR_R 0xbebe03ffu
#define S_LSHR 0x90000000u
#define S_LSHL 0x8f000000u
#define S_OR 0x88000000u
#define S_AND 0x87000000u
#define S_BFE 0x94000000u
#define DS_SWIZZLE_B32_FSWAP_R 0xd8d48001u
#define V_ADD_F64 0xd564003cu
#define V_AND_B32 0x36000000u
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc308000u
#define V_XOR_B32 0x3a000000u
#define V_MUL_F64 0xd5650044u
#else
#define S_SETPC_B64_S12_13 0xbe801d0cu
#define V_AND_B32_CALC_ADDRESS 0x2638000eu
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc548000u
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c0f70u
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd2890000u
#define S_MUL_HI_U32_IMUL_R 0x960f1010u
#define S_MUL_I32_IMUL 0x92000000u
#define S_MUL_HI_U32_IMUL_R_2 0x960fff10u
#define S_MUL_HI_U32_IMUL_M 0x96210e10u
#define S_MOV_B32_IMUL_RCP 0xbea000ffu
#define S_MUL_HI_U32_IMUL_RCP 0x960f2010u
#define S_XOR_B32_64 0x88000000u
#define S_MOV_B32_XOR_R 0xbebe00ffu
#define S_LSHR 0x8f000000u
#define S_LSHL 0x8e000000u
#define S_OR 0x87000000u
#define S_AND 0x86000000u
#define S_BFE 0x93000000u
#define DS_SWIZZLE_B32_FSWAP_R 0xd87a8001u
#define V_ADD_F64 0xd280003cu
#define V_AND_B32 0x26000000u
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc508000u
#define V_XOR_B32 0x2a000000u
#define V_MUL_F64 0xd2810044u
#endif
__global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm32, uint mask_reg, uint batch_size) __global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm32, uint mask_reg, uint batch_size)
{ {
// s_add_i32 s14, s(16 + src * 2), imm32 // s_add_i32 s14, s(16 + src * 2), imm32
@ -50,7 +106,7 @@ __global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm3
*(p++) = imm32; *(p++) = imm32;
// v_and_b32 v28, s14, mask_reg // v_and_b32 v28, s14, mask_reg
*(p++) = 0x2638000eu | (mask_reg << 9); *(p++) = V_AND_B32_CALC_ADDRESS | (mask_reg << 9);
return p; return p;
} }
@ -70,7 +126,7 @@ __global uint* jit_scratchpad_load(__global uint* p, uint vgpr_index)
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
// global_load_dwordx2 v[vgpr_index:vgpr_index+1], v28, s[0:1] // global_load_dwordx2 v[vgpr_index:vgpr_index+1], v28, s[0:1]
*(p++) = 0xdc548000u; *(p++) = GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD;
*(p++) = 0x0000001cu | (vgpr_index << 24); *(p++) = 0x0000001cu | (vgpr_index << 24);
#else #else
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28 *(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
@ -87,14 +143,14 @@ __global uint* jit_scratchpad_load2(__global uint* p, uint vgpr_index, int vmcnt
{ {
// s_waitcnt vmcnt(N) // s_waitcnt vmcnt(N)
if (vmcnt >= 0) if (vmcnt >= 0)
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14); *(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
// v_readlane_b32 s14, vgpr_index, 0 // v_readlane_b32 s14, vgpr_index, 0
*(p++) = 0xd289000eu; *(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 14;
*(p++) = 0x00010100u | vgpr_index; *(p++) = 0x00010100u | vgpr_index;
// v_readlane_b32 s15, vgpr_index + 1, 0 // v_readlane_b32 s15, vgpr_index + 1, 0
*(p++) = 0xd289000fu; *(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 15;
*(p++) = 0x00010100u | (vgpr_index + 1); *(p++) = 0x00010100u | (vgpr_index + 1);
return p; return p;
@ -107,9 +163,12 @@ __global uint* jit_scratchpad_calc_address_fp(__global uint* p, uint src, uint i
*(p++) = imm32; *(p++) = imm32;
// v_and_b32 v28, s14, mask_reg // v_and_b32 v28, s14, mask_reg
*(p++) = 0x2638000eu | (mask_reg << 9); *(p++) = V_AND_B32 | 0x38000eu | (mask_reg << 9);
#if GCN_VERSION >= 14 #if GCN_VERSION >= 15
// v_add_nc_u32 v28, v28, v44
*(p++) = 0x4a38591cu;
#elif GCN_VERSION == 14
// v_add_u32 v28, v28, v44 // v_add_u32 v28, v28, v44
*(p++) = 0x6838591cu; *(p++) = 0x6838591cu;
#else #else
@ -126,7 +185,7 @@ __global uint* jit_scratchpad_load_fp(__global uint* p, uint vgpr_index)
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
// global_load_dword v(vgpr_index), v28, s[0:1] // global_load_dword v(vgpr_index), v28, s[0:1]
*(p++) = 0xdc508000u; *(p++) = GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP;
*(p++) = 0x0000001cu | (vgpr_index << 24); *(p++) = 0x0000001cu | (vgpr_index << 24);
#else #else
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28 *(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
@ -143,7 +202,7 @@ __global uint* jit_scratchpad_load2_fp(__global uint* p, uint vgpr_index, int vm
{ {
// s_waitcnt vmcnt(N) // s_waitcnt vmcnt(N)
if (vmcnt >= 0) if (vmcnt >= 0)
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14); *(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
// v_cvt_f64_i32 v[28:29], vgpr_index // v_cvt_f64_i32 v[28:29], vgpr_index
*(p++) = 0x7e380900u | vgpr_index; *(p++) = 0x7e380900u | vgpr_index;
@ -164,7 +223,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (shift > 0) // p = 3/4 if (shift > 0) // p = 3/4
{ {
// s_lshl_b64 s[14:15], s[(16 + src * 2):(17 + src * 2)], shift // s_lshl_b64 s[14:15], s[(16 + src * 2):(17 + src * 2)], shift
*(p++) = 0x8e8e8010u | (src << 1) | (shift << 8); *(p++) = S_LSHL | 0x8e8010u | (src << 1) | (shift << 8);
// s_add_u32 s(16 + dst * 2), s(16 + dst * 2), s14 // s_add_u32 s(16 + dst * 2), s(16 + dst * 2), s14
*(p++) = 0x80100e10u | (dst << 1) | (dst << 17); *(p++) = 0x80100e10u | (dst << 1) | (dst << 17);
@ -283,7 +342,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{ {
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
// s_mul_hi_u32 s15, s(16 + dst * 2), s(16 + src * 2) // s_mul_hi_u32 s15, s(16 + dst * 2), s(16 + src * 2)
*(p++) = 0x960f1010u | (dst << 1) | (src << 9); *(p++) = S_MUL_HI_U32_IMUL_R | (dst << 1) | (src << 9);
#else #else
// v_mov_b32 v28, s(16 + dst * 2) // v_mov_b32 v28, s(16 + dst * 2)
*(p++) = 0x7e380210u | (dst << 1); *(p++) = 0x7e380210u | (dst << 1);
@ -296,25 +355,25 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#endif #endif
// s_mul_i32 s14, s(16 + dst * 2), s(17 + src * 2) // s_mul_i32 s14, s(16 + dst * 2), s(17 + src * 2)
*(p++) = 0x920e1110u | (dst << 1) | (src << 9); *(p++) = S_MUL_I32_IMUL | 0x0e1110u | (dst << 1) | (src << 9);
// s_add_u32 s15, s15, s14 // s_add_u32 s15, s15, s14
*(p++) = 0x800f0e0fu; *(p++) = 0x800f0e0fu;
// s_mul_i32 s14, s(17 + dst * 2), s(16 + src * 2) // s_mul_i32 s14, s(17 + dst * 2), s(16 + src * 2)
*(p++) = 0x920e1011u | (dst << 1) | (src << 9); *(p++) = S_MUL_I32_IMUL | 0x0e1011u | (dst << 1) | (src << 9);
// s_add_u32 s(17 + dst * 2), s15, s14 // s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x80110e0fu | (dst << 17); *(p++) = 0x80110e0fu | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s(16 + src * 2) // s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s(16 + src * 2)
*(p++) = 0x92101010u | (dst << 1) | (dst << 17) | (src << 9); *(p++) = S_MUL_I32_IMUL | 0x101010u | (dst << 1) | (dst << 17) | (src << 9);
} }
else // p = 1/8 else // p = 1/8
{ {
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
// s_mul_hi_u32 s15, s(16 + dst * 2), imm32 // s_mul_hi_u32 s15, s(16 + dst * 2), imm32
*(p++) = 0x960fff10u | (dst << 1); *(p++) = S_MUL_HI_U32_IMUL_R_2 | (dst << 1);
*(p++) = inst.y; *(p++) = inst.y;
#else #else
// v_mov_b32 v28, imm32 // v_mov_b32 v28, imm32
@ -335,14 +394,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
} }
// s_mul_i32 s14, s(17 + dst * 2), imm32 // s_mul_i32 s14, s(17 + dst * 2), imm32
*(p++) = 0x920eff11u | (dst << 1); *(p++) = S_MUL_I32_IMUL | 0x0eff11u | (dst << 1);
*(p++) = inst.y; *(p++) = inst.y;
// s_add_u32 s(17 + dst * 2), s15, s14 // s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x80110e0fu | (dst << 17); *(p++) = 0x80110e0fu | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), imm32 // s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), imm32
*(p++) = 0x9210ff10u | (dst << 1) | (dst << 17); *(p++) = S_MUL_I32_IMUL | 0x10ff10u | (dst << 1) | (dst << 17);
*(p++) = inst.y; *(p++) = inst.y;
} }
@ -369,7 +428,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
// s_mul_hi_u32 s33, s(16 + dst * 2), s14 // s_mul_hi_u32 s33, s(16 + dst * 2), s14
*(p++) = 0x96210e10u | (dst << 1); *(p++) = S_MUL_HI_U32_IMUL_M | (dst << 1);
#else #else
// v_mov_b32 v28, s(16 + dst * 2) // v_mov_b32 v28, s(16 + dst * 2)
*(p++) = 0x7e380210u | (dst << 1); *(p++) = 0x7e380210u | (dst << 1);
@ -382,19 +441,19 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#endif #endif
// s_mul_i32 s32, s(16 + dst * 2), s15 // s_mul_i32 s32, s(16 + dst * 2), s15
*(p++) = 0x92200f10u | (dst << 1); *(p++) = S_MUL_I32_IMUL | 0x200f10u | (dst << 1);
// s_add_u32 s33, s33, s32 // s_add_u32 s33, s33, s32
*(p++) = 0x80212021u; *(p++) = 0x80212021u;
// s_mul_i32 s32, s(17 + dst * 2), s14 // s_mul_i32 s32, s(17 + dst * 2), s14
*(p++) = 0x92200e11u | (dst << 1); *(p++) = S_MUL_I32_IMUL | 0x200e11u | (dst << 1);
// s_add_u32 s(17 + dst * 2), s33, s32 // s_add_u32 s(17 + dst * 2), s33, s32
*(p++) = 0x80112021u | (dst << 17); *(p++) = 0x80112021u | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s14 // s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s14
*(p++) = 0x92100e10u | (dst << 1) | (dst << 17); *(p++) = S_MUL_I32_IMUL | 0x100e10u | (dst << 1) | (dst << 17);
} }
// (12*7/8 + 8*1/8 + 28) + 24 = 63.5 bytes on average // (12*7/8 + 8*1/8 + 28) + 24 = 63.5 bytes on average
@ -404,10 +463,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_IMULH_R) if (opcode < RANDOMX_FREQ_IMULH_R)
{ {
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2] *(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2] *(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59] *(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15] *(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
// 16 bytes // 16 bytes
return p; return p;
@ -430,9 +496,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{ {
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
#if GCN_VERSION >= 15
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2] *(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59] *(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15] *(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
} }
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average // (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
@ -442,10 +514,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_ISMULH_R) if (opcode < RANDOMX_FREQ_ISMULH_R)
{ {
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2] *(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2] *(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57] *(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15] *(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
// 16 bytes // 16 bytes
return p; return p;
@ -468,9 +547,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{ {
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
#if GCN_VERSION >= 15
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2] *(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57] *(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15] *(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
} }
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average // (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
@ -484,10 +569,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{ {
const uint2 rcp_value = as_uint2(imul_rcp_value(inst.y)); const uint2 rcp_value = as_uint2(imul_rcp_value(inst.y));
*(p++) = 0xbea000ffu; // s_mov_b32 s32, imm32 *(p++) = S_MOV_B32_IMUL_RCP; // s_mov_b32 s32, imm32
*(p++) = rcp_value.x; *(p++) = rcp_value.x;
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
*(p++) = 0x960f2010u | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32 *(p++) = S_MUL_HI_U32_IMUL_RCP | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32
#else #else
// v_mov_b32 v28, s32 // v_mov_b32 v28, s32
*(p++) = 0x7e380220u; *(p++) = 0x7e380220u;
@ -498,12 +583,12 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
*(p++) = 0xd289000fu; *(p++) = 0xd289000fu;
*(p++) = 0x0001011cu; *(p++) = 0x0001011cu;
#endif #endif
*(p++) = 0x920eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32 *(p++) = S_MUL_I32_IMUL | 0x0eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32
*(p++) = rcp_value.y; *(p++) = rcp_value.y;
*(p++) = 0x800f0e0fu; // s_add_u32 s15, s15, s14 *(p++) = 0x800f0e0fu; // s_add_u32 s15, s15, s14
*(p++) = 0x920e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32 *(p++) = S_MUL_I32_IMUL | 0x0e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32
*(p++) = 0x80110e0fu | (dst << 17); // s_add_u32 s(17 + dst * 2), s15, s14 *(p++) = 0x80110e0fu | (dst << 17); // s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x92102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32 *(p++) = S_MUL_I32_IMUL | 0x102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32
} }
// 36 bytes // 36 bytes
@ -526,23 +611,23 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (src != dst) // p = 7/8 if (src != dst) // p = 7/8
{ {
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2] // s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0x88901010u | (dst << 1) | (dst << 17) | (src << 9); *(p++) = S_XOR_B32_64 | 0x901010u | (dst << 1) | (dst << 17) | (src << 9);
} }
else // p = 1/8 else // p = 1/8
{ {
if (as_int(inst.y) < 0) // p = 1/2 if (as_int(inst.y) < 0) // p = 1/2
{ {
// s_mov_b32 s62, imm32 // s_mov_b32 s62, imm32
*(p++) = 0xbebe00ffu; *(p++) = S_MOV_B32_XOR_R;
*(p++) = inst.y; *(p++) = inst.y;
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[62:63] // s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[62:63]
*(p++) = 0x88903e10u | (dst << 1) | (dst << 17); *(p++) = S_XOR_B32_64 | 0x903e10u | (dst << 1) | (dst << 17);
} }
else else
{ {
// s_xor_b32 s(16 + dst * 2), s(16 + dst * 2), imm32 // s_xor_b32 s(16 + dst * 2), s(16 + dst * 2), imm32
*(p++) = 0x8810ff10u | (dst << 1) | (dst << 17); *(p++) = S_XOR_B32_64 | 0x10ff10u | (dst << 1) | (dst << 17);
*(p++) = inst.y; *(p++) = inst.y;
} }
} }
@ -569,7 +654,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[14:15] // s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[14:15]
*(p++) = 0x88900e10u | (dst << 1) | (dst << 17); *(p++) = S_XOR_B32_64 | 0x900e10u | (dst << 1) | (dst << 17);
} }
// (12*7/8 + 8*1/8 + 28) + 4 = 43.5 bytes on average // (12*7/8 + 8*1/8 + 28) + 4 = 43.5 bytes on average
@ -584,24 +669,24 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_IROR_R) if (opcode < RANDOMX_FREQ_IROR_R)
{ {
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2) // s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
*(p++) = 0x8fa01010u | (dst << 1) | (src << 9); *(p++) = S_LSHR | 0xa01010u | (dst << 1) | (src << 9);
// s_sub_u32 s15, 64, s(16 + src * 2) // s_sub_u32 s15, 64, s(16 + src * 2)
*(p++) = 0x808f10c0u | (src << 9); *(p++) = 0x808f10c0u | (src << 9);
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15 // s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
*(p++) = 0x8ea20f10u | (dst << 1); *(p++) = S_LSHL | 0xa20f10u | (dst << 1);
} }
else else
{ {
// s_lshl_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2) // s_lshl_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
*(p++) = 0x8ea01010u | (dst << 1) | (src << 9); *(p++) = S_LSHL | 0xa01010u | (dst << 1) | (src << 9);
// s_sub_u32 s15, 64, s(16 + src * 2) // s_sub_u32 s15, 64, s(16 + src * 2)
*(p++) = 0x808f10c0u | (src << 9); *(p++) = 0x808f10c0u | (src << 9);
// s_lshr_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15 // s_lshr_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
*(p++) = 0x8fa20f10u | (dst << 1); *(p++) = S_LSHR | 0xa20f10u | (dst << 1);
} }
} }
else // p = 1/8 else // p = 1/8
@ -609,14 +694,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint shift = ((opcode < RANDOMX_FREQ_IROR_R) ? inst.y : -inst.y) & 63; const uint shift = ((opcode < RANDOMX_FREQ_IROR_R) ? inst.y : -inst.y) & 63;
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], shift // s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], shift
*(p++) = 0x8fa08010u | (dst << 1) | (shift << 8); *(p++) = S_LSHR | 0xa08010u | (dst << 1) | (shift << 8);
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], 64 - shift // s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], 64 - shift
*(p++) = 0x8ea28010u | (dst << 1) | ((64 - shift) << 8); *(p++) = S_LSHL | 0xa28010u | (dst << 1) | ((64 - shift) << 8);
} }
// s_or_b64 s[16 + dst * 2:17 + dst * 2], s[32:33], s[34:35] // s_or_b64 s[16 + dst * 2:17 + dst * 2], s[32:33], s[34:35]
*(p++) = 0x87902220u | (dst << 17); *(p++) = S_OR | 0x902220u | (dst << 17);
// 12*7/8 + 8/8 + 4 = 15.5 bytes on average // 12*7/8 + 8/8 + 4 = 15.5 bytes on average
return p; return p;
@ -627,9 +712,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{ {
if (src != dst) if (src != dst)
{ {
#if GCN_VERSION >= 15
*(p++) = 0xbea00410u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbe900410u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbe900420u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
#else
*(p++) = 0xbea00110u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2] *(p++) = 0xbea00110u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbe900110u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2] *(p++) = 0xbe900110u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbe900120u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33] *(p++) = 0xbe900120u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
#endif
} }
// 12*7/8 = 10.5 bytes on average // 12*7/8 = 10.5 bytes on average
@ -640,11 +731,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSWAP_R) if (opcode < RANDOMX_FREQ_FSWAP_R)
{ {
// ds_swizzle_b32 v(60 + dst * 2), v(60 + dst * 2) offset:0x8001 // ds_swizzle_b32 v(60 + dst * 2), v(60 + dst * 2) offset:0x8001
*(p++) = 0xd87a8001u; *(p++) = DS_SWIZZLE_B32_FSWAP_R;
*(p++) = 0x3c00003cu + (dst << 1) + (dst << 25); *(p++) = 0x3c00003cu + (dst << 1) + (dst << 25);
// ds_swizzle_b32 v(61 + dst * 2), v(61 + dst * 2) offset:0x8001 // ds_swizzle_b32 v(61 + dst * 2), v(61 + dst * 2) offset:0x8001
*(p++) = 0xd87a8001u; *(p++) = DS_SWIZZLE_B32_FSWAP_R;
*(p++) = 0x3d00003du + (dst << 1) + (dst << 25); *(p++) = 0x3d00003du + (dst << 1) + (dst << 25);
// s_waitcnt lgkmcnt(0) // s_waitcnt lgkmcnt(0)
@ -658,7 +749,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FADD_R) if (opcode < RANDOMX_FREQ_FADD_R)
{ {
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[52 + src * 2:53 + src * 2] // v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[52 + src * 2:53 + src * 2]
*(p++) = 0xd280003cu + ((dst & 3) << 1); *(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x0002693cu + ((dst & 3) << 1) + ((src & 3) << 10); *(p++) = 0x0002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes // 8 bytes
@ -679,7 +770,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[28:29] // v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[28:29]
*(p++) = 0xd280003cu + ((dst & 3) << 1); *(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x0002393cu + ((dst & 3) << 1); *(p++) = 0x0002393cu + ((dst & 3) << 1);
} }
@ -691,7 +782,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSUB_R) if (opcode < RANDOMX_FREQ_FSUB_R)
{ {
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[52 + src * 2:53 + src * 2] // v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[52 + src * 2:53 + src * 2]
*(p++) = 0xd280003cu + ((dst & 3) << 1); *(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x4002693cu + ((dst & 3) << 1) + ((src & 3) << 10); *(p++) = 0x4002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes // 8 bytes
@ -712,7 +803,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[28:29] // v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[28:29]
*(p++) = 0xd280003cu + ((dst & 3) << 1); *(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x4002393cu + ((dst & 3) << 1); *(p++) = 0x4002393cu + ((dst & 3) << 1);
} }
@ -724,7 +815,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSCAL_R) if (opcode < RANDOMX_FREQ_FSCAL_R)
{ {
// v_xor_b32 v(61 + dst * 2), v(61 + dst * 2), v51 // v_xor_b32 v(61 + dst * 2), v(61 + dst * 2), v51
*(p++) = 0x2a7a673du + ((dst & 3) << 1) + ((dst & 3) << 18); *(p++) = (V_XOR_B32 | 0x7a673du) + ((dst & 3) << 1) + ((dst & 3) << 18);
// 4 bytes // 4 bytes
return p; return p;
@ -734,7 +825,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FMUL_R) if (opcode < RANDOMX_FREQ_FMUL_R)
{ {
// v_mul_f64 v[68 + dst * 2:69 + dst * 2], v[68 + dst * 2:69 + dst * 2], v[52 + src * 2:53 + src * 2] // v_mul_f64 v[68 + dst * 2:69 + dst * 2], v[68 + dst * 2:69 + dst * 2], v[52 + src * 2:53 + src * 2]
*(p++) = 0xd2810044u + ((dst & 3) << 1); *(p++) = V_MUL_F64 + ((dst & 3) << 1);
*(p++) = 0x00026944u + ((dst & 3) << 1) + ((src & 3) << 10); *(p++) = 0x00026944u + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes // 8 bytes
@ -755,7 +846,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0); p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// s_swappc_b64 s[60:61], s[48 + dst * 2:49 + dst * 2] // s_swappc_b64 s[60:61], s[48 + dst * 2:49 + dst * 2]
#if GCN_VERSION >= 15
*(p++) = 0xbebc2130u + ((dst & 3) << 1);
#else
*(p++) = 0xbebc1e30u + ((dst & 3) << 1); *(p++) = 0xbebc1e30u + ((dst & 3) << 1);
#endif
} }
// 32 + 4 = 36 bytes // 32 + 4 = 36 bytes
@ -766,7 +861,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSQRT_R) if (opcode < RANDOMX_FREQ_FSQRT_R)
{ {
// s_swappc_b64 s[60:61], s[40 + dst * 2:41 + dst * 2] // s_swappc_b64 s[60:61], s[40 + dst * 2:41 + dst * 2]
#if GCN_VERSION >= 15
*(p++) = 0xbebc2128u + ((dst & 3) << 1);
#else
*(p++) = 0xbebc1e28u + ((dst & 3) << 1); *(p++) = 0xbebc1e28u + ((dst & 3) << 1);
#endif
// 4 bytes // 4 bytes
return p; return p;
@ -789,7 +888,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint conditionMaskReg = 70 + (mod >> 4); const uint conditionMaskReg = 70 + (mod >> 4);
// s_and_b32 s14, s(16 + dst * 2), conditionMaskReg // s_and_b32 s14, s(16 + dst * 2), conditionMaskReg
*(p++) = 0x860e0010u | (dst << 1) | (conditionMaskReg << 8); *(p++) = S_AND | 0x0e0010u | (dst << 1) | (conditionMaskReg << 8);
// s_cbranch_scc0 target // s_cbranch_scc0 target
const int delta = ((last_branch_target - p) - 1); const int delta = ((last_branch_target - p) - 1);
@ -805,26 +904,30 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint shift = inst.y & 63; const uint shift = inst.y & 63;
if (shift == 63) if (shift == 63)
{ {
*(p++) = 0x8e0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1 *(p++) = S_LSHL | 0x0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1
*(p++) = 0x8f0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31 *(p++) = S_LSHR | 0x0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31
*(p++) = 0x870e0f0eu; // s_or_b32 s14, s14, s15 *(p++) = S_OR | 0x0e0f0eu; // s_or_b32 s14, s14, s15
*(p++) = 0x860e830eu; // s_and_b32 s14, s14, 3 *(p++) = S_AND | 0x0e830eu; // s_and_b32 s14, s14, 3
} }
else else
{ {
// s_bfe_u64 s[14:15], s[16:17], (shift,width=2) // s_bfe_u64 s[14:15], s[16:17], (shift,width=2)
*(p++) = 0x938eff10u | (src << 1); *(p++) = S_BFE | 0x8eff10u | (src << 1);
*(p++) = shift | (2 << 16); *(p++) = shift | (2 << 16);
} }
// s_brev_b32 s14, s14 // s_brev_b32 s14, s14
*(p++) = 0xbe8e080eu;
// s_lshr_b32 s66, s14, 30 // s_lshr_b32 s66, s14, 30
*(p++) = 0x8f429e0eu;
// s_setreg_b32 hwreg(mode, 2, 2), s66 // s_setreg_b32 hwreg(mode, 2, 2), s66
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0b0eu;
*(p++) = 0x90429e0eu;
*(p++) = 0xb9c20881u;
#else
*(p++) = 0xbe8e080eu;
*(p++) = 0x8f429e0eu;
*(p++) = 0xb9420881u; *(p++) = 0xb9420881u;
#endif
// 20 bytes // 20 bytes
return p; return p;
@ -843,6 +946,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
// v28 = offset // v28 = offset
#if GCN_VERSION >= 14 #if GCN_VERSION >= 14
#if GCN_VERSION >= 15
// s_waitcnt vmcnt(0)
*(p++) = 0xbf8c3f70u;
#endif
// global_store_dwordx2 v28, v[vgpr_id:vgpr_id + 1], s[0:1] // global_store_dwordx2 v28, v[vgpr_id:vgpr_id + 1], s[0:1]
*(p++) = 0xdc748000u; *(p++) = 0xdc748000u;
*(p++) = 0x0000001cu | (vgpr_id << 8); *(p++) = 0x0000001cu | (vgpr_id << 8);
@ -903,7 +1010,7 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
int prefetch_data_count; int prefetch_data_count;
#pragma unroll 1 #pragma unroll 1
for (int pass = 0; pass < 2; ++pass) for (volatile int pass = 0; pass < 2; ++pass)
{ {
#if RANDOMX_PROGRAM_SIZE > 256 #if RANDOMX_PROGRAM_SIZE > 256
int registerLastChanged[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; int registerLastChanged[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
@ -1419,14 +1526,14 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
{ {
// Code size limit exceeded!!! // Code size limit exceeded!!!
// Jump back to randomx_run kernel // Jump back to randomx_run kernel
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13] *(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
return p; return p;
} }
} while (!done); } while (!done);
} }
// Jump back to randomx_run kernel // Jump back to randomx_run kernel
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13] *(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
return p; return p;
} }

View file

@ -0,0 +1,742 @@
/*
Copyright (c) 2019-2020 SChernykh
This file is part of RandomX OpenCL.
RandomX OpenCL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RandomX OpenCL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
*/
.rocm
.gpu GFX1010
.arch_minor 1
.arch_stepping 0
.eflags 53
.llvm10binfmt
.metadatav3
.md_version 1, 0
.globaldata
.fill 64, 1, 0
.kernel randomx_run
.config
.dims x
.sgprsnum 96
.vgprsnum 128
.shared_vgprs 0
.dx10clamp
.ieeemode
.floatmode 0xf0
.priority 0
.exceptions 0
.userdatanum 6
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc1-gfx6-gfx10-table
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc2-gfx6-gfx10-table
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc3-gfx10-table
.pgmrsrc1 0x40af0105
.pgmrsrc2 0x0000008c
.pgmrsrc3 0x00000000
.group_segment_fixed_size 256
.private_segment_fixed_size 0
.kernel_code_entry_offset 0x10c0
.use_private_segment_buffer
.use_kernarg_segment_ptr
.use_wave32
.config
.md_symname "randomx_run.kd"
.md_language "OpenCL C", 1, 2
.reqd_work_group_size 32, 1, 1
.md_kernarg_segment_size 104
.md_kernarg_segment_align 8
.md_group_segment_fixed_size 256
.md_private_segment_fixed_size 0
.md_wavefront_size 32
.md_sgprsnum 96
.md_vgprsnum 128
.spilledsgprs 0
.spilledvgprs 0
.max_flat_work_group_size 32
.arg dataset, "uchar*", 8, 0, globalbuf, u8, global, default const
.arg scratchpad, "uchar*", 8, 8, globalbuf, u8, global, default
.arg registers, "ulong*", 8, 16, globalbuf, u64, global, default
.arg rounding_modes, "uint*", 8, 24, globalbuf, u32, global, default
.arg programs, "uint*", 8, 32, globalbuf, u32, global, default
.arg batch_size, "uint", 4, 40, value, u32
.arg rx_parameters, "uint", 4, 44, value, u32
.arg , "", 8, 48, gox, i64
.arg , "", 8, 56, goy, i64
.arg , "", 8, 64, goz, i64
.arg , "", 8, 72, none, i8
.arg , "", 8, 80, none, i8
.arg , "", 8, 88, none, i8
.arg , "", 8, 96, multigridsyncarg, i8
.text
randomx_run:
# clear all caches
s_dcache_wb
s_waitcnt vmcnt(0) & lgkmcnt(0)
s_waitcnt_vscnt null, 0x0
s_icache_inv
s_branch begin
# pgmrsrc2 = 0x0000008c, bits 1:5 = 6, so first 6 SGPRs (s0-s7) contain user data
# s6 contains group id
# v0 contains local id
begin:
# s[0:1] - pointer to registers
# s[2:3] - pointer to rounding modes
s_load_dwordx4 s[0:3], s[4:5], 0x10
# s[8:9] - group_id*group_size
s_mov_b32 s9, 0
s_lshl_b32 s8, s6, 5
# v0 - local id (sub)
# v39 - R[sub]
v_lshlrev_b32 v39, 3, v0
s_mov_b32 s12, s7
# vcc_lo = "if (sub < 8)"
v_cmp_gt_u32 vcc_lo, 8, v0
s_waitcnt lgkmcnt(0)
# load rounding mode
s_lshl_b32 s16, s6, 2
s_add_u32 s64, s2, s16
s_addc_u32 s65, s3, 0
v_mov_b32 v1, 0
global_load_dword v1, v1, s[64:65]
s_waitcnt vmcnt(0)
v_readlane_b32 s66, v1, 0
s_setreg_b32 hwreg(mode, 2, 2), s66
s_mov_b32 s67, 0
# ((__local ulong*) R)[sub] = ((__global ulong*) registers)[sub];
s_lshl_b64 s[2:3], s[8:9], 3
s_mov_b32 s32, s12
s_add_u32 s0, s0, s2
s_addc_u32 s1, s1, s3
v_add_co_u32 v1, s0, s0, v39
v_add_co_ci_u32 v2, s0, s1, 0, s0
global_load_dwordx2 v[4:5], v[1:2], off
s_waitcnt vmcnt(0)
ds_write_b64 v39, v[4:5]
s_waitcnt vmcnt(0) & lgkmcnt(0)
s_waitcnt_vscnt null, 0x0
# "if (sub >= 8) return"
s_and_saveexec_b32 s0, vcc_lo
s_cbranch_execz program_end
# s[8:9] - pointer to dataset
# s[10:11] - pointer to scratchpads
# s[0:1] - pointer to programs
s_load_dwordx4 s[8:11], s[4:5], 0x0
s_load_dwordx2 s[0:1], s[4:5], 0x20
# rx_parameters
s_load_dword s20, s[4:5], 0x2c
v_mov_b32 v5, 0
v_mov_b32 v10, 0
s_waitcnt_vscnt null, 0x0
ds_read_b64 v[8:9], v39
v_cmp_gt_u32 vcc_lo, 4, v0
v_lshlrev_b32 v0, 3, v0
ds_read2_b64 v[25:28], v5 offset0:16 offset1:17
ds_read_b32 v11, v5 offset:152
ds_read_b64 v[35:36], v5 offset:168
ds_read2_b64 v[20:23], v5 offset0:18 offset1:20
v_cndmask_b32 v4, 0xffffff, -1, vcc_lo
v_add_nc_u32 v5, v39, v0
s_waitcnt lgkmcnt(0)
v_mov_b32 v13, s11
v_mov_b32 v7, s1
v_mov_b32 v6, s0
# Scratchpad L1 size
s_bfe_u32 s21, s20, 0x050000
s_lshl_b32 s21, 1, s21
# Scratchpad L2 size
s_bfe_u32 s22, s20, 0x050005
s_lshl_b32 s22, 1, s22
# Scratchpad L3 size
s_bfe_u32 s0, s20, 0x05000A
s_lshl_b32 s23, 1, s0
# program iterations
s_bfe_u32 s24, s20, 0x04000F
s_lshl_b32 s24, 1, s24
v_mov_b32 v12, s10
v_mad_u64_u32 v[6:7], s2, 10048, s6, v[6:7]
# s[4:5] - pointer to current program
v_readlane_b32 s4, v6, 0
v_readlane_b32 s5, v7, 0
s_lshl_b32 s2, 1, s0
v_add_co_u32 v14, s0, s8, v11
v_cndmask_b32 v34, v36, 0, vcc_lo
v_cndmask_b32 v24, v23, 0, vcc_lo
v_cndmask_b32 v3, v22, 0, vcc_lo
s_add_i32 s3, s2, 64
v_add_co_ci_u32 v29, s0, s9, v10, s0
v_cndmask_b32 v35, v35, 0, vcc_lo
v_add_co_u32 v22, vcc_lo, v14, v0
# v[12:13] - pointer to current scratchpad
v_mad_u64_u32 v[12:13], s2, s3, s6, v[12:13]
v_mov_b32 v10, v26
v_mov_b32 v11, v25
v_lshlrev_b32 v36, 3, v27
v_lshlrev_b32 v37, 3, v28
v_lshlrev_b32 v20, 3, v20
v_lshlrev_b32 v21, 3, v21
v_add_co_ci_u32 v23, vcc_lo, 0, v29, vcc_lo
# rename registers
# v6 - R[sub]
v_mov_b32 v6, v39
# loop counter
s_sub_u32 s2, s24, 1
# used in IXOR_R instruction
s_mov_b32 s63, -1
# used in CBRANCH instruction
s_mov_b32 s70, (0xFF << 8)
s_mov_b32 s71, (0xFF << 9)
s_mov_b32 s72, (0xFF << 10)
s_mov_b32 s73, (0xFF << 11)
s_mov_b32 s74, (0xFF << 12)
s_mov_b32 s75, (0xFF << 13)
s_mov_b32 s76, (0xFF << 14)
s_mov_b32 s77, (0xFF << 15)
s_mov_b32 s78, (0xFF << 16)
s_mov_b32 s79, (0xFF << 17)
s_mov_b32 s80, (0xFF << 18)
s_mov_b32 s81, (0xFF << 19)
s_mov_b32 s82, (0xFF << 20)
s_mov_b32 s83, (0xFF << 21)
s_mov_b32 s84, (0xFF << 22)
s_mov_b32 s85, (0xFF << 23)
# ScratchpadL3Mask64
s_sub_u32 s86, s23, 64
# Scratchpad masks for scratchpads
v_sub_nc_u32 v38, s21, 8
v_sub_nc_u32 v39, s22, 8
v_sub_nc_u32 v50, s23, 8
# mask for FSCAL_R
v_mov_b32 v51, 0x80F00000
# load scratchpad base address
v_readlane_b32 s0, v12, 0
v_readlane_b32 s1, v13, 0
# v41, v44 = 0
v_mov_b32 v41, 0
v_mov_b32 v44, 0
# v41 = 0 on lane 0, set it to 8 on lane 1
# v44 = 0 on lane 0, set it to 4 on lane 1
s_mov_b64 exec, 2
v_mov_b32 v41, 8
v_mov_b32 v44, 4
# load group A registers
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
s_mov_b64 exec, 3
ds_read2_b64 v[52:55], v41 offset0:24 offset1:26
ds_read2_b64 v[56:59], v41 offset0:28 offset1:30
# xmantissaMask
v_mov_b32 v77, (1 << 24) - 1
# xexponentMask
ds_read_b64 v[78:79], v41 offset:160
# Restore execution mask
s_mov_b64 exec, 255
# sign mask (used in FSQRT_R)
v_mov_b32 v82, 0x80000000
# used in FSQRT_R to check for "positive normal value" (v_cmpx_class_f64)
s_mov_b32 s68, 256
s_mov_b32 s69, 0
# High 32 bits of "1.0" constant (used in FDIV_M)
v_mov_b32 v83, (1023 << 20)
# Used to multiply FP64 values by 0.5
v_mov_b32 v84, (1 << 20)
s_getpc_b64 s[14:15]
cur_addr:
# get addresses of FSQRT_R subroutines
s_add_u32 s40, s14, fsqrt_r_sub0 - cur_addr
s_addc_u32 s41, s15, 0
s_add_u32 s42, s14, fsqrt_r_sub1 - cur_addr
s_addc_u32 s43, s15, 0
s_add_u32 s44, s14, fsqrt_r_sub2 - cur_addr
s_addc_u32 s45, s15, 0
s_add_u32 s46, s14, fsqrt_r_sub3 - cur_addr
s_addc_u32 s47, s15, 0
# get addresses of FDIV_M subroutines
s_add_u32 s48, s14, fdiv_m_sub0 - cur_addr
s_addc_u32 s49, s15, 0
s_add_u32 s50, s14, fdiv_m_sub1 - cur_addr
s_addc_u32 s51, s15, 0
s_add_u32 s52, s14, fdiv_m_sub2 - cur_addr
s_addc_u32 s53, s15, 0
s_add_u32 s54, s14, fdiv_m_sub3 - cur_addr
s_addc_u32 s55, s15, 0
# get address for ISMULH_R subroutine
s_add_u32 s56, s14, ismulh_r_sub - cur_addr
s_addc_u32 s57, s15, 0
# get address for IMULH_R subroutine
s_add_u32 s58, s14, imulh_r_sub - cur_addr
s_addc_u32 s59, s15, 0
/*
used: v0-v6, v8-v37
not used: v7
*/
main_loop:
s_waitcnt_vscnt null, 0x0
# v[27:28] = R[readReg0]
# v[29:30] = R[readReg1]
ds_read_b64 v[27:28], v37
ds_read_b64 v[29:30], v36
s_waitcnt lgkmcnt(0)
# R[readReg0] ^ R[readReg0] (high 32 bits)
v_xor_b32 v28, v28, v30
# spAddr1
v_xor_b32 v25, v28, v25
v_and_b32 v25, s86, v25
v_add_nc_u32 v25, v25, v0
v_add_co_u32 v16, vcc_lo, s0, v25
# R[readReg0] ^ R[readReg0] (low 32 bits)
v_xor_b32 v25, v27, v29
v_mov_b32 v29, v11
v_add_co_ci_u32 v17, vcc_lo, 0, s1, vcc_lo
v_xor_b32 v25, v25, v26
# load from spAddr1
global_load_dwordx2 v[27:28], v[16:17], off
# spAddr0
v_and_b32 v25, s86, v25
v_add_nc_u32 v25, v25, v0
v_add_co_u32 v31, vcc_lo, s0, v25
v_add_co_ci_u32 v32, vcc_lo, 0, s1, vcc_lo
v_add_co_u32 v29, vcc_lo, v22, v29
# load from spAddr0
global_load_dwordx2 v[25:26], v[31:32], off
v_add_co_ci_u32 v30, vcc_lo, 0, v23, vcc_lo
v_mov_b32 v33, v11
s_and_b32 vcc_lo, exec_lo, vcc_lo
s_waitcnt vmcnt(1)
v_cvt_f64_i32 v[14:15], v28
v_cvt_f64_i32 v[12:13], v27
v_or_b32 v14, v14, v35
s_waitcnt vmcnt(0)
# R[sub] ^= *p0;
v_xor_b32 v8, v25, v8
v_xor_b32 v9, v26, v9
v_and_b32 v26, v4, v15
v_and_b32 v19, v4, v13
v_or_b32 v15, v26, v34
v_or_b32 v18, v12, v3
v_mov_b32 v26, 0
v_or_b32 v19, v19, v24
v_mov_b32 v25, v26
ds_write2_b64 v5, v[18:19], v[14:15] offset0:8 offset1:9
# load from dataset
global_load_dwordx2 v[18:19], v[29:30], off
# load group F,E registers
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
s_mov_b64 exec, 3
s_waitcnt lgkmcnt(0)
ds_read2_b64 v[60:63], v41 offset0:8 offset1:10
ds_read2_b64 v[64:67], v41 offset0:12 offset1:14
ds_read2_b64 v[68:71], v41 offset0:16 offset1:18
ds_read2_b64 v[72:75], v41 offset0:20 offset1:22
# load VM integer registers
v_readlane_b32 s16, v8, 0
v_readlane_b32 s17, v9, 0
v_readlane_b32 s18, v8, 1
v_readlane_b32 s19, v9, 1
v_readlane_b32 s20, v8, 2
v_readlane_b32 s21, v9, 2
v_readlane_b32 s22, v8, 3
v_readlane_b32 s23, v9, 3
v_readlane_b32 s24, v8, 4
v_readlane_b32 s25, v9, 4
v_readlane_b32 s26, v8, 5
v_readlane_b32 s27, v9, 5
v_readlane_b32 s28, v8, 6
v_readlane_b32 s29, v9, 6
v_readlane_b32 s30, v8, 7
v_readlane_b32 s31, v9, 7
s_waitcnt lgkmcnt(0)
# Use only first 2 lanes for the program
s_mov_b64 exec, 3
# call JIT code
s_swappc_b64 s[12:13], s[4:5]
# Write out group F,E registers
# Write low 8 bytes from lane 0 and high 8 bytes from lane 1
ds_write2_b64 v41, v[60:61], v[62:63] offset0:8 offset1:10
ds_write2_b64 v41, v[64:65], v[66:67] offset0:12 offset1:14
ds_write2_b64 v41, v[68:69], v[70:71] offset0:16 offset1:18
ds_write2_b64 v41, v[72:73], v[74:75] offset0:20 offset1:22
# store VM integer registers
v_writelane_b32 v8, s16, 0
v_writelane_b32 v9, s17, 0
v_writelane_b32 v8, s18, 1
v_writelane_b32 v9, s19, 1
v_writelane_b32 v8, s20, 2
v_writelane_b32 v9, s21, 2
v_writelane_b32 v8, s22, 3
v_writelane_b32 v9, s23, 3
v_writelane_b32 v8, s24, 4
v_writelane_b32 v9, s25, 4
v_writelane_b32 v8, s26, 5
v_writelane_b32 v9, s27, 5
v_writelane_b32 v8, s28, 6
v_writelane_b32 v9, s29, 6
v_writelane_b32 v8, s30, 7
v_writelane_b32 v9, s31, 7
# Turn back on 8 execution lanes
s_mov_b64 exec, 255
# Write out VM integer registers
ds_write_b64 v6, v[8:9]
s_waitcnt lgkmcnt(0)
# R[readReg2], R[readReg3]
ds_read_b32 v11, v21
ds_read_b32 v27, v20
s_waitcnt lgkmcnt(0)
# mx ^= R[readReg2] ^ R[readReg3];
v_xor_b32 v11, v11, v27
v_xor_b32 v10, v10, v11
# v[27:28] = R[sub]
# v[29:30] = F[sub]
ds_read2_b64 v[27:30], v6 offset1:8
# mx &= CacheLineAlignMask;
v_and_b32 v11, 0x7fffffc0, v10
v_mov_b32 v10, v33
s_waitcnt lgkmcnt(0)
# const ulong next_r = R[sub] ^ data;
s_waitcnt lgkmcnt(0)
v_xor_b32 v8, v27, v18
v_xor_b32 v9, v28, v19
# *p1 = next_r;
global_store_dwordx2 v[16:17], v[8:9], off
# v[27:28] = E[sub]
ds_read_b64 v[27:28], v6 offset:128
# R[sub] = next_r;
ds_write_b64 v6, v[8:9]
s_waitcnt lgkmcnt(1)
# *p0 = as_ulong(F[sub]) ^ as_ulong(E[sub]);
v_xor_b32 v29, v27, v29
v_xor_b32 v30, v28, v30
global_store_dwordx2 v[31:32], v[29:30], off
s_sub_u32 s2, s2, 1
s_cbranch_scc0 main_loop
main_loop_end:
global_store_dwordx2 v[1:2], v[8:9], off
global_store_dwordx2 v[1:2], v[29:30], off inst_offset:64
global_store_dwordx2 v[1:2], v[27:28], off inst_offset:128
# store rounding mode
v_mov_b32 v0, 0
v_mov_b32 v1, s66
global_store_dword v0, v1, s[64:65]
program_end:
s_endpgm
fsqrt_r_sub0:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[68:69]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[68:69]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[68:69]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[68:69]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[68:69], s[68:69]
v_mov_b32 v68, v42
v_mov_b32 v69, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub1:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[70:71]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[70:71]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[70:71]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[70:71]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[70:71], s[68:69]
v_mov_b32 v70, v42
v_mov_b32 v71, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub2:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[72:73]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[72:73]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[72:73]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[72:73]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[72:73], s[68:69]
v_mov_b32 v72, v42
v_mov_b32 v73, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub3:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[74:75]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[74:75]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[74:75]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[74:75]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[74:75], s[68:69]
v_mov_b32 v74, v42
v_mov_b32 v75, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fdiv_m_sub0:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[68:69], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[68:69]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[68:69]
v_cmpx_eq_f64 v[68:69], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v68, v80
v_mov_b32 v69, v81
s_setpc_b64 s[60:61]
fdiv_m_sub1:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[70:71], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[70:71]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[70:71]
v_cmpx_eq_f64 v[70:71], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v70, v80
v_mov_b32 v71, v81
s_setpc_b64 s[60:61]
fdiv_m_sub2:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[72:73], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[72:73]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[72:73]
v_cmpx_eq_f64 v[72:73], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v72, v80
v_mov_b32 v73, v81
s_setpc_b64 s[60:61]
fdiv_m_sub3:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[74:75], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[74:75]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[74:75]
v_cmpx_eq_f64 v[74:75], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v74, v80
v_mov_b32 v75, v81
s_setpc_b64 s[60:61]
ismulh_r_sub:
s_mov_b64 exec, 1
v_mov_b32 v45, s14
v_mul_hi_u32 v40, s38, v45
v_mov_b32 v47, s15
v_mad_u64_u32 v[42:43], s32, s38, v47, v[40:41]
v_mov_b32 v40, v42
v_mad_u64_u32 v[45:46], s32, s39, v45, v[40:41]
v_mad_u64_u32 v[42:43], s32, s39, v47, v[43:44]
v_add_co_u32 v42, vcc_lo, v42, v46
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
v_readlane_b32 s32, v42, 0
v_readlane_b32 s33, v43, 0
s_cmp_lt_i32 s15, 0
s_cselect_b64 s[34:35], s[38:39], 0
s_sub_u32 s32, s32, s34
s_subb_u32 s33, s33, s35
s_cmp_lt_i32 s39, 0
s_cselect_b64 s[34:35], s[14:15], 0
s_sub_u32 s14, s32, s34
s_subb_u32 s15, s33, s35
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
imulh_r_sub:
s_mov_b64 exec, 1
v_mov_b32 v45, s38
v_mul_hi_u32 v40, s14, v45
v_mov_b32 v47, s39
v_mad_u64_u32 v[42:43], s32, s14, v47, v[40:41]
v_mov_b32 v40, v42
v_mad_u64_u32 v[45:46], s32, s15, v45, v[40:41]
v_mad_u64_u32 v[42:43], s32, s15, v47, v[43:44]
v_add_co_u32 v42, vcc_lo, v42, v46
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
v_readlane_b32 s14, v42, 0
v_readlane_b32 s15, v43, 0
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]

View file

@ -0,0 +1,303 @@
/*
This file was auto-generated from randomx_run_gfx1010.asm:
clrxasm randomx_run_gfx1010.asm -o randomx_run_gfx1010.bin
bin2h -c randomx_run_gfx1010_bin < randomx_run_gfx1010.bin > randomx_run_gfx1010.h
clrxasm can be downloaded here: https://github.com/CLRX/CLRX-mirror/releases
bin2h can be downloaded here: http://www.deadnode.org/sw/bin2h/
*/
static unsigned char randomx_run_gfx1010_bin[]={
0x7f,0x45,0x4c,0x46,0x02,0x01,0x01,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xe0,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x40
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x40,0x00,0x38,0x00,0x08,0x00,0x40,0x00,0x0c,0x00,0x0a,0x00,0x06
,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x02
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0xe5,0x74,0x64,0x04,0x00,0x00,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xe5,0x74,0x64,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
,0x00,0x00,0x00,0x20,0x06,0x00,0x00,0x20,0x00,0x00,0x00,0x41,0x4d,0x44,0x47,0x50,0x55,0x00,0x00,0x82,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x6b,0x65,0x72,0x6e
,0x65,0x6c,0x73,0x91,0xde,0x00,0x10,0xa5,0x2e,0x61,0x72,0x67,0x73,0x9e,0x88,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67
,0x6c,0x6f,0x62,0x61,0x6c,0xa9,0x2e,0x69,0x73,0x5f,0x63,0x6f,0x6e,0x73,0x74,0xc3,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa7,0x64,0x61,0x74,0x61,0x73,0x65,0x74,0xa7,0x2e
,0x6f,0x66,0x66,0x73,0x65,0x74,0x00,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75
,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c
,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x73,0x63,0x72,0x61,0x74,0x63,0x68,0x70,0x61,0x64,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x08,0xa5,0x2e,0x73,0x69,0x7a,0x65
,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61
,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa9,0x72,0x65,0x67,0x69,0x73,0x74
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x10,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75
,0x6c,0x6f,0x6e,0x67,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab
,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x36,0x34,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xae,0x72,0x6f,0x75,0x6e,0x64,0x69,0x6e,0x67,0x5f,0x6d,0x6f,0x64,0x65,0x73,0xa7,0x2e,0x6f,0x66,0x66
,0x73,0x65,0x74,0x18,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61
,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79
,0x70,0x65,0xa3,0x75,0x33,0x32,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e
,0x61,0x6d,0x65,0xa8,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79
,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c
,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x62
,0x61,0x74,0x63,0x68,0x5f,0x73,0x69,0x7a,0x65,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f
,0x6e,0x61,0x6d,0x65,0xa4,0x75,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e
,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xad,0x72,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x2c,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa4,0x75
,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f
,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x30,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65
,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x78,0xab,0x2e,0x76,0x61
,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x38,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x79
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x40,0xa5,0x2e,0x73,0x69,0x7a,0x65
,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73
,0x65,0x74,0x5f,0x7a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x48,0xa5,0x2e
,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x50,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70
,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x58,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e
,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f
,0x66,0x66,0x73,0x65,0x74,0x60,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb9,0x68,0x69,0x64,0x64,0x65,0x6e
,0x5f,0x6d,0x75,0x6c,0x74,0x69,0x67,0x72,0x69,0x64,0x5f,0x73,0x79,0x6e,0x63,0x5f,0x61,0x72,0x67,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2
,0x69,0x38,0xb9,0x2e,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0xcd,0x01,0x00,0xb6
,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x08,0xb5,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67
,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x68,0xa9,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0xa8,0x4f,0x70,0x65,0x6e,0x43,0x4c,0x20
,0x43,0xb1,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x02,0xb8,0x2e,0x6d,0x61,0x78,0x5f,0x66,0x6c,0x61,0x74
,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x20,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xab,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72
,0x75,0x6e,0xbb,0x2e,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0x00,0xb4
,0x2e,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x93,0x20,0x01,0x01,0xab,0x2e,0x73,0x67,0x70,0x72,0x5f,0x63
,0x6f,0x75,0x6e,0x74,0x60,0xb1,0x2e,0x73,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xa7,0x2e,0x73,0x79,0x6d,0x62,0x6f,0x6c
,0xae,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0xab,0x2e,0x76,0x67,0x70,0x72,0x5f,0x63,0x6f,0x75,0x6e,0x74,0xcc,0x80,0xb1,0x2e,0x76
,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xaf,0x2e,0x77,0x61,0x76,0x65,0x66,0x72,0x6f,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65
,0x20,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f
,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcf,0x03,0xaf,0x40,0x8c,0x00,0x00,0x00,0x09,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x84,0xf4,0x00,0x00,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x00,0x00,0x93,0xbf,0x00,0x00,0x82,0xbf,0x02,0x00,0x08,0xf4,0x10,0x00,0x00,0xfa,0x80
,0x03,0x89,0xbe,0x06,0x85,0x08,0x8f,0x83,0x00,0x4e,0x34,0x07,0x03,0x8c,0xbe,0x88,0x00,0x88,0x7d,0x7f,0xc0,0x8c,0xbf,0x06,0x82,0x10,0x8f,0x02,0x10,0x40,0x80,0x03
,0x80,0x41,0x82,0x80,0x02,0x02,0x7e,0x00,0x80,0x30,0xdc,0x01,0x00,0x40,0x01,0x70,0x3f,0x8c,0xbf,0x42,0x00,0x60,0xd7,0x01,0x01,0x01,0x00,0x81,0x08,0xc2,0xb9,0x80
,0x03,0xc3,0xbe,0x08,0x83,0x82,0x8f,0x0c,0x03,0xa0,0xbe,0x00,0x02,0x00,0x80,0x01,0x03,0x01,0x82,0x01,0x00,0x0f,0xd7,0x00,0x4e,0x02,0x00,0x02,0x00,0x28,0xd5,0x01
,0x00,0x01,0x00,0x00,0x80,0x34,0xdc,0x01,0x00,0x7d,0x04,0x70,0x3f,0x8c,0xbf,0x00,0x00,0x34,0xd9,0x27,0x04,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x6a
,0x3c,0x80,0xbe,0x65,0x01,0x88,0xbf,0x02,0x02,0x08,0xf4,0x00,0x00,0x00,0xfa,0x02,0x00,0x04,0xf4,0x20,0x00,0x00,0xfa,0x02,0x05,0x00,0xf4,0x2c,0x00,0x00,0xfa,0x80
,0x02,0x0a,0x7e,0x80,0x02,0x14,0x7e,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x27,0x00,0x00,0x08,0x84,0x00,0x88,0x7d,0x83,0x00,0x00,0x34,0x10,0x11,0xdc,0xd9,0x05
,0x00,0x00,0x19,0x98,0x00,0xd8,0xd8,0x05,0x00,0x00,0x0b,0xa8,0x00,0xd8,0xd9,0x05,0x00,0x00,0x23,0x12,0x14,0xdc,0xd9,0x05,0x00,0x00,0x14,0x04,0x00,0x01,0xd5,0xff
,0x82,0xa9,0x01,0xff,0xff,0xff,0x00,0x27,0x01,0x0a,0x4a,0x7f,0xc0,0x8c,0xbf,0x0b,0x02,0x1a,0x7e,0x01,0x02,0x0e,0x7e,0x00,0x02,0x0c,0x7e,0x14,0xff,0x95,0x93,0x00
,0x00,0x05,0x00,0x81,0x15,0x15,0x8f,0x14,0xff,0x96,0x93,0x05,0x00,0x05,0x00,0x81,0x16,0x16,0x8f,0x14,0xff,0x80,0x93,0x0a,0x00,0x05,0x00,0x81,0x00,0x17,0x8f,0x14
,0xff,0x98,0x93,0x0f,0x00,0x04,0x00,0x81,0x18,0x18,0x8f,0x0a,0x02,0x18,0x7e,0x06,0x02,0x76,0xd5,0xff,0x0c,0x18,0x04,0x40,0x27,0x00,0x00,0x04,0x00,0x60,0xd7,0x06
,0x01,0x01,0x00,0x05,0x00,0x60,0xd7,0x07,0x01,0x01,0x00,0x81,0x00,0x02,0x8f,0x0e,0x00,0x0f,0xd7,0x08,0x16,0x02,0x00,0x22,0x00,0x01,0xd5,0x24,0x01,0xa9,0x01,0x18
,0x00,0x01,0xd5,0x17,0x01,0xa9,0x01,0x03,0x00,0x01,0xd5,0x16,0x01,0xa9,0x01,0x02,0xc0,0x03,0x81,0x1d,0x00,0x28,0xd5,0x09,0x14,0x02,0x00,0x23,0x00,0x01,0xd5,0x23
,0x01,0xa9,0x01,0x16,0x6a,0x0f,0xd7,0x0e,0x01,0x02,0x00,0x0c,0x02,0x76,0xd5,0x03,0x0c,0x30,0x04,0x1a,0x03,0x14,0x7e,0x19,0x03,0x16,0x7e,0x83,0x36,0x48,0x34,0x83
,0x38,0x4a,0x34,0x83,0x28,0x28,0x34,0x83,0x2a,0x2a,0x34,0x80,0x3a,0x2e,0x50,0x27,0x03,0x0c,0x7e,0x18,0x81,0x82,0x80,0xc1,0x03,0xbf,0xbe,0xff,0x03,0xc6,0xbe,0x00
,0xff,0x00,0x00,0xff,0x03,0xc7,0xbe,0x00,0xfe,0x01,0x00,0xff,0x03,0xc8,0xbe,0x00,0xfc,0x03,0x00,0xff,0x03,0xc9,0xbe,0x00,0xf8,0x07,0x00,0xff,0x03,0xca,0xbe,0x00
,0xf0,0x0f,0x00,0xff,0x03,0xcb,0xbe,0x00,0xe0,0x1f,0x00,0xff,0x03,0xcc,0xbe,0x00,0xc0,0x3f,0x00,0xff,0x03,0xcd,0xbe,0x00,0x80,0x7f,0x00,0xff,0x03,0xce,0xbe,0x00
,0x00,0xff,0x00,0xff,0x03,0xcf,0xbe,0x00,0x00,0xfe,0x01,0xff,0x03,0xd0,0xbe,0x00,0x00,0xfc,0x03,0xff,0x03,0xd1,0xbe,0x00,0x00,0xf8,0x07,0xff,0x03,0xd2,0xbe,0x00
,0x00,0xf0,0x0f,0xff,0x03,0xd3,0xbe,0x00,0x00,0xe0,0x1f,0xff,0x03,0xd4,0xbe,0x00,0x00,0xc0,0x3f,0xff,0x03,0xd5,0xbe,0x00,0x00,0x80,0x7f,0x17,0xc0,0xd6,0x80,0x26
,0x00,0x26,0xd5,0x15,0x10,0x01,0x00,0x27,0x00,0x26,0xd5,0x16,0x10,0x01,0x00,0x32,0x00,0x26,0xd5,0x17,0x10,0x01,0x00,0xff,0x02,0x66,0x7e,0x00,0x00,0xf0,0x80,0x00
,0x00,0x60,0xd7,0x0c,0x01,0x01,0x00,0x01,0x00,0x60,0xd7,0x0d,0x01,0x01,0x00,0x80,0x02,0x52,0x7e,0x80,0x02,0x58,0x7e,0x82,0x04,0xfe,0xbe,0x88,0x02,0x52,0x7e,0x84
,0x02,0x58,0x7e,0x83,0x04,0xfe,0xbe,0x18,0x1a,0xdc,0xd9,0x29,0x00,0x00,0x34,0x1c,0x1e,0xdc,0xd9,0x29,0x00,0x00,0x38,0xff,0x02,0x9a,0x7e,0xff,0xff,0xff,0x00,0xa0
,0x00,0xd8,0xd9,0x29,0x00,0x00,0x4e,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0xff,0x02,0xa4,0x7e,0x00,0x00,0x00,0x80,0xff,0x03,0xc4,0xbe,0x00,0x01,0x00,0x00,0x80
,0x03,0xc5,0xbe,0xff,0x02,0xa6,0x7e,0x00,0x00,0xf0,0x3f,0xff,0x02,0xa8,0x7e,0x00,0x00,0x10,0x00,0x00,0x1f,0x8e,0xbe,0x0e,0xff,0x28,0x80,0x48,0x03,0x00,0x00,0x0f
,0x80,0x29,0x82,0x0e,0xff,0x2a,0x80,0xac,0x03,0x00,0x00,0x0f,0x80,0x2b,0x82,0x0e,0xff,0x2c,0x80,0x10,0x04,0x00,0x00,0x0f,0x80,0x2d,0x82,0x0e,0xff,0x2e,0x80,0x74
,0x04,0x00,0x00,0x0f,0x80,0x2f,0x82,0x0e,0xff,0x30,0x80,0xd8,0x04,0x00,0x00,0x0f,0x80,0x31,0x82,0x0e,0xff,0x32,0x80,0x3c,0x05,0x00,0x00,0x0f,0x80,0x33,0x82,0x0e
,0xff,0x34,0x80,0xa0,0x05,0x00,0x00,0x0f,0x80,0x35,0x82,0x0e,0xff,0x36,0x80,0x04,0x06,0x00,0x00,0x0f,0x80,0x37,0x82,0x0e,0xff,0x38,0x80,0x68,0x06,0x00,0x00,0x0f
,0x80,0x39,0x82,0x0e,0xff,0x3a,0x80,0xdc,0x06,0x00,0x00,0x0f,0x80,0x3b,0x82,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x25,0x00,0x00,0x1b,0x00,0x00,0xd8,0xd9,0x24
,0x00,0x00,0x1d,0x7f,0xc0,0x8c,0xbf,0x1c,0x3d,0x38,0x3a,0x1c,0x33,0x32,0x3a,0x56,0x32,0x32,0x36,0x19,0x01,0x32,0x4a,0x10,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x1b
,0x3b,0x32,0x3a,0x0b,0x03,0x3a,0x7e,0x11,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x19,0x35,0x32,0x3a,0x00,0x80,0x34,0xdc,0x10,0x00,0x7d,0x1b,0x56,0x32,0x32,0x36,0x19
,0x01,0x32,0x4a,0x1f,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x20,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x1d,0x6a,0x0f,0xd7,0x16,0x3b,0x02,0x00,0x00,0x80,0x34,0xdc,0x1f
,0x00,0x7d,0x19,0x80,0x2e,0x3c,0x50,0x0b,0x03,0x42,0x7e,0x7e,0x6a,0x6a,0x87,0x71,0x3f,0x8c,0xbf,0x1c,0x09,0x1c,0x7e,0x1b,0x09,0x18,0x7e,0x0e,0x47,0x1c,0x38,0x70
,0x3f,0x8c,0xbf,0x19,0x11,0x10,0x3a,0x1a,0x13,0x12,0x3a,0x04,0x1f,0x34,0x36,0x04,0x1b,0x26,0x36,0x1a,0x45,0x1e,0x38,0x0c,0x07,0x24,0x38,0x80,0x02,0x34,0x7e,0x13
,0x31,0x26,0x38,0x1a,0x03,0x32,0x7e,0x08,0x09,0x38,0xd9,0x05,0x12,0x0e,0x00,0x00,0x80,0x34,0xdc,0x1d,0x00,0x7d,0x12,0x83,0x04,0xfe,0xbe,0x7f,0xc0,0x8c,0xbf,0x08
,0x0a,0xdc,0xd9,0x29,0x00,0x00,0x3c,0x0c,0x0e,0xdc,0xd9,0x29,0x00,0x00,0x40,0x10,0x12,0xdc,0xd9,0x29,0x00,0x00,0x44,0x14,0x16,0xdc,0xd9,0x29,0x00,0x00,0x48,0x10
,0x00,0x60,0xd7,0x08,0x01,0x01,0x00,0x11,0x00,0x60,0xd7,0x09,0x01,0x01,0x00,0x12,0x00,0x60,0xd7,0x08,0x03,0x01,0x00,0x13,0x00,0x60,0xd7,0x09,0x03,0x01,0x00,0x14
,0x00,0x60,0xd7,0x08,0x05,0x01,0x00,0x15,0x00,0x60,0xd7,0x09,0x05,0x01,0x00,0x16,0x00,0x60,0xd7,0x08,0x07,0x01,0x00,0x17,0x00,0x60,0xd7,0x09,0x07,0x01,0x00,0x18
,0x00,0x60,0xd7,0x08,0x09,0x01,0x00,0x19,0x00,0x60,0xd7,0x09,0x09,0x01,0x00,0x1a,0x00,0x60,0xd7,0x08,0x0b,0x01,0x00,0x1b,0x00,0x60,0xd7,0x09,0x0b,0x01,0x00,0x1c
,0x00,0x60,0xd7,0x08,0x0d,0x01,0x00,0x1d,0x00,0x60,0xd7,0x09,0x0d,0x01,0x00,0x1e,0x00,0x60,0xd7,0x08,0x0f,0x01,0x00,0x1f,0x00,0x60,0xd7,0x09,0x0f,0x01,0x00,0x7f
,0xc0,0x8c,0xbf,0x83,0x04,0xfe,0xbe,0x04,0x21,0x8c,0xbe,0x08,0x0a,0x38,0xd9,0x29,0x3c,0x3e,0x00,0x0c,0x0e,0x38,0xd9,0x29,0x40,0x42,0x00,0x10,0x12,0x38,0xd9,0x29
,0x44,0x46,0x00,0x14,0x16,0x38,0xd9,0x29,0x48,0x4a,0x00,0x08,0x00,0x61,0xd7,0x10,0x00,0x01,0x00,0x09,0x00,0x61,0xd7,0x11,0x00,0x01,0x00,0x08,0x00,0x61,0xd7,0x12
,0x02,0x01,0x00,0x09,0x00,0x61,0xd7,0x13,0x02,0x01,0x00,0x08,0x00,0x61,0xd7,0x14,0x04,0x01,0x00,0x09,0x00,0x61,0xd7,0x15,0x04,0x01,0x00,0x08,0x00,0x61,0xd7,0x16
,0x06,0x01,0x00,0x09,0x00,0x61,0xd7,0x17,0x06,0x01,0x00,0x08,0x00,0x61,0xd7,0x18,0x08,0x01,0x00,0x09,0x00,0x61,0xd7,0x19,0x08,0x01,0x00,0x08,0x00,0x61,0xd7,0x1a
,0x0a,0x01,0x00,0x09,0x00,0x61,0xd7,0x1b,0x0a,0x01,0x00,0x08,0x00,0x61,0xd7,0x1c,0x0c,0x01,0x00,0x09,0x00,0x61,0xd7,0x1d,0x0c,0x01,0x00,0x08,0x00,0x61,0xd7,0x1e
,0x0e,0x01,0x00,0x09,0x00,0x61,0xd7,0x1f,0x0e,0x01,0x00,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc0,0x8c,0xbf,0x00
,0x00,0xd8,0xd8,0x15,0x00,0x00,0x0b,0x00,0x00,0xd8,0xd8,0x14,0x00,0x00,0x1b,0x7f,0xc0,0x8c,0xbf,0x0b,0x37,0x16,0x3a,0x0a,0x17,0x14,0x3a,0x00,0x08,0xdc,0xd9,0x06
,0x00,0x00,0x1b,0xff,0x14,0x16,0x36,0xc0,0xff,0xff,0x7f,0x21,0x03,0x14,0x7e,0x7f,0xc0,0x8c,0xbf,0x7f,0xc0,0x8c,0xbf,0x1b,0x25,0x10,0x3a,0x1c,0x27,0x12,0x3a,0x00
,0x80,0x74,0xdc,0x10,0x08,0x7d,0x00,0x80,0x00,0xd8,0xd9,0x06,0x00,0x00,0x1b,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc1,0x8c,0xbf,0x1b,0x3b,0x3a,0x3a,0x1c
,0x3d,0x3c,0x3a,0x00,0x80,0x74,0xdc,0x1f,0x1d,0x7d,0x00,0x02,0x81,0x82,0x80,0x57,0xff,0x84,0xbf,0x00,0x80,0x74,0xdc,0x01,0x08,0x7d,0x00,0x40,0x80,0x74,0xdc,0x01
,0x1d,0x7d,0x00,0x80,0x80,0x74,0xdc,0x01,0x1b,0x7d,0x00,0x80,0x02,0x00,0x7e,0x42,0x02,0x02,0x7e,0x00,0x80,0x70,0xdc,0x00,0x01,0x40,0x00,0x00,0x00,0x81,0xbf,0x81
,0x08,0xc3,0xb9,0x44,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x89,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e
,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x12,0x25,0x81
,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x44,0x89,0x00,0x00,0x2a,0x03,0x88,0x7e,0x2b,0x03,0x8a,0x7e,0x83,0x04,0xfe,0xbe,0x3c
,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x46,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x8d,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31
,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a
,0x55,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x46,0x89,0x00,0x00,0x2a,0x03,0x8c,0x7e,0x2b,0x03,0x8e,0x7e,0x83
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x48,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x91,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c
,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e
,0x00,0x4c,0xd5,0x2a,0x55,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x48,0x89,0x00,0x00,0x2a,0x03,0x90,0x7e,0x2b
,0x03,0x92,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x4a,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x95,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d
,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30
,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x4a,0x89,0x00,0x00,0x2a
,0x03,0x94,0x7e,0x2b,0x03,0x96,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c
,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x44,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c
,0xa1,0x12,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x12,0x05,0x44,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53
,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x88,0x7e,0x51,0x03,0x8a,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81
,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x46,0x61,0x02,0x00,0x2a
,0x00,0x4c,0xd5,0x1c,0xa1,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x1a,0x05,0x46,0x39,0x64,0x7c,0x80
,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x8c,0x7e,0x51,0x03,0x8e,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d
,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x48
,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x22,0x05,0x48
,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x90,0x7e,0x51,0x03,0x92,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d
,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50
,0x00,0x65,0xd5,0x4a,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a
,0x39,0x2a,0x05,0x4a,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x94,0x7e,0x51,0x03,0x96,0x7e,0x3c,0x20,0x80,0xbe,0x81
,0x04,0xfe,0xbe,0x0e,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x26,0x5a,0x02,0x00,0x0f,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x26,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d
,0x20,0x76,0xd5,0x27,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x27,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x20,0x00,0x60,0xd7,0x2a
,0x01,0x01,0x00,0x21,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x0f,0x80,0x04,0xbf,0x26,0x80,0xa2,0x85,0x20,0x22,0xa0,0x80,0x21,0x23,0xa1,0x82,0x27,0x80,0x04,0xbf,0x0e
,0x80,0xa2,0x85,0x20,0x22,0x8e,0x80,0x21,0x23,0x8f,0x82,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x04,0xfe,0xbe,0x26,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x0e
,0x5a,0x02,0x00,0x27,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x0e,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d,0x20,0x76,0xd5,0x0f,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x0f
,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x0e,0x00,0x60,0xd7,0x2a,0x01,0x01,0x00,0x0f,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x83
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43
,0x4c,0x52,0x58,0x20,0x52,0x4f,0x43,0x6d,0x42,0x69,0x6e,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x30,0x2e,0x31,0x2e,0x39,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x07,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x2e,0x6e,0x6f,0x74,0x65,0x00,0x2e,0x64,0x79,0x6e,0x73,0x79,0x6d,0x00,0x2e,0x68,0x61,0x73,0x68,0x00,0x2e,0x64,0x79,0x6e,0x73,0x74,0x72,0x00,0x2e,0x72,0x6f,0x64
,0x61,0x74,0x61,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x00,0x2e,0x63,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x00,0x2e,0x73,0x79,0x6d
,0x74,0x61,0x62,0x00,0x2e,0x73,0x68,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x00,0x5f,0x44,0x59,0x4e,0x41,0x4d,0x49,0x43,0x00
,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34
,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x48
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f
,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x18
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x1c
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x40
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28
,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x1b
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d
,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x57
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4f
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x25
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
const int randomx_run_gfx1010_bin_size=9312;

View file

@ -316,7 +316,7 @@ __kernel void init_vm(__global const void* entropy_data, __global void* vm_state
uint64_t registerLatencyFP = 0; uint64_t registerLatencyFP = 0;
uint64_t registerReadCycleFP = 0; uint64_t registerReadCycleFP = 0;
uint32_t ScratchpadHighLatency = 0; uint32_t ScratchpadHighLatency = 0;
uint32_t ScratchpadLatency = 0; volatile uint32_t ScratchpadLatency = 0;
int32_t first_available_slot = 0; int32_t first_available_slot = 0;
int32_t first_allowed_slot_cfround = 0; int32_t first_allowed_slot_cfround = 0;
@ -1425,8 +1425,7 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
} }
const uint64_t mantissa_size = 52; const uint64_t mantissa_size = 52;
const uint64_t mantissa_mask = (1UL << mantissa_size) - 1; const uint64_t mantissa_mask = (1UL << 52) - 1;
const uint64_t mantissa_high_bit = 1UL << mantissa_size;
const uint64_t exponent_size = 11; const uint64_t exponent_size = 11;
const uint64_t exponent_mask = (1 << exponent_size) - 1; const uint64_t exponent_mask = (1 << exponent_size) - 1;
@ -1441,9 +1440,13 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
return as_double(inf); return as_double(inf);
} }
const uint64_t mantissa_a = (as_ulong(a) & mantissa_mask) | mantissa_high_bit; uint64_t mantissa_a = (as_ulong(a) & mantissa_mask);
const uint64_t mantissa_b = (as_ulong(b) & mantissa_mask) | mantissa_high_bit; uint64_t mantissa_b = (as_ulong(b) & mantissa_mask);
const uint64_t mantissa_c = (as_ulong(c) & mantissa_mask) | mantissa_high_bit; uint64_t mantissa_c = (as_ulong(c) & mantissa_mask);
((uint2*)&mantissa_a)->y |= 1U << 20;
((uint2*)&mantissa_b)->y |= 1U << 20;
((uint2*)&mantissa_c)->y |= 1U << 20;
const uint32_t sign_a = as_uint2(a).y >> 31; const uint32_t sign_a = as_uint2(a).y >> 31;
const uint32_t sign_b = as_uint2(b).y >> 31; const uint32_t sign_b = as_uint2(b).y >> 31;
@ -1585,7 +1588,7 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
if (rounding_mode + sign_fma_result == 2) if (rounding_mode + sign_fma_result == 2)
{ {
fma_result[1] += round_up; fma_result[1] += round_up;
if (fma_result[1] == mantissa_high_bit) if (fma_result[1] == (1UL << mantissa_size))
{ {
fma_result[1] = 0; fma_result[1] = 0;
++exponent_fma_result; ++exponent_fma_result;

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -49,6 +49,7 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
const size_t mem = device.globalMemSize(); const size_t mem = device.globalMemSize();
auto config = RxAlgo::base(algorithm); auto config = RxAlgo::base(algorithm);
bool gcnAsm = false; bool gcnAsm = false;
bool isNavi = false;
switch (device.type()) { switch (device.type()) {
case OclDevice::Baffin: case OclDevice::Baffin:
@ -59,6 +60,13 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
gcnAsm = true; gcnAsm = true;
break; break;
case OclDevice::Navi_10:
case OclDevice::Navi_12:
case OclDevice::Navi_14:
gcnAsm = true;
isNavi = true;
break;
default: default:
break; break;
} }
@ -75,8 +83,9 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
uint32_t intensity = static_cast<uint32_t>((mem - (datasetHost ? 0 : dataset_mem)) / per_thread_mem / 2); uint32_t intensity = static_cast<uint32_t>((mem - (datasetHost ? 0 : dataset_mem)) / per_thread_mem / 2);
// Too high intensity makes hashrate worse // Too high intensity makes hashrate worse
if (intensity > device.computeUnits() * 16) { const uint32_t intensityCoeff = isNavi ? 64 : 16;
intensity = device.computeUnits() * 16; if (intensity > device.computeUnits() * intensityCoeff) {
intensity = device.computeUnits() * intensityCoeff;
} }
intensity -= intensity % 64; intensity -= intensity % 64;

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -30,12 +30,10 @@
#include "crypto/rx/RxAlgo.h" #include "crypto/rx/RxAlgo.h"
void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads) void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size)
{ {
const size_t gthreads = threads * 64; const size_t gthreads = threads * workgroup_size;
static const size_t lthreads = 64; enqueueNDRange(queue, 1, nullptr, &gthreads, &workgroup_size);
enqueueNDRange(queue, 1, nullptr, &gthreads, &lthreads);
} }

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ class RxRunKernel : public OclKernel
public: public:
inline RxRunKernel(cl_program program) : OclKernel(program, "randomx_run") {} inline RxRunKernel(cl_program program) : OclKernel(program, "randomx_run") {}
void enqueue(cl_command_queue queue, size_t threads); void enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size);
void setArgs(cl_mem dataset, cl_mem scratchpads, cl_mem registers, cl_mem rounding, cl_mem programs, uint32_t batch_size, const Algorithm &algorithm); void setArgs(cl_mem dataset, cl_mem scratchpads, cl_mem registers, cl_mem rounding, cl_mem programs, uint32_t batch_size, const Algorithm &algorithm);
}; };

View file

@ -31,7 +31,7 @@ if (WITH_OPENCL)
src/backend/opencl/wrappers/OclLib.h src/backend/opencl/wrappers/OclLib.h
src/backend/opencl/wrappers/OclPlatform.h src/backend/opencl/wrappers/OclPlatform.h
src/backend/opencl/wrappers/OclVendor.h src/backend/opencl/wrappers/OclVendor.h
) )
set(SOURCES_BACKEND_OPENCL set(SOURCES_BACKEND_OPENCL
src/backend/opencl/cl/OclSource.cpp src/backend/opencl/cl/OclSource.cpp
@ -59,75 +59,93 @@ if (WITH_OPENCL)
src/backend/opencl/wrappers/OclKernel.cpp src/backend/opencl/wrappers/OclKernel.cpp
src/backend/opencl/wrappers/OclLib.cpp src/backend/opencl/wrappers/OclLib.cpp
src/backend/opencl/wrappers/OclPlatform.cpp src/backend/opencl/wrappers/OclPlatform.cpp
) )
if (WIN32) if (WIN32)
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp) list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp)
else() else()
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp) list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp)
endif() endif()
if (WITH_RANDOMX) if (WITH_RANDOMX)
list(APPEND HEADERS_BACKEND_OPENCL list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h
src/backend/opencl/kernels/rx/ExecuteVmKernel.h src/backend/opencl/kernels/rx/ExecuteVmKernel.h
src/backend/opencl/kernels/rx/FillAesKernel.h src/backend/opencl/kernels/rx/FillAesKernel.h
src/backend/opencl/kernels/rx/FindSharesKernel.h src/backend/opencl/kernels/rx/FindSharesKernel.h
src/backend/opencl/kernels/rx/HashAesKernel.cpp src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.h src/backend/opencl/kernels/rx/InitVmKernel.h
src/backend/opencl/kernels/rx/RxJitKernel.h src/backend/opencl/kernels/rx/RxJitKernel.h
src/backend/opencl/kernels/rx/RxRunKernel.h src/backend/opencl/kernels/rx/RxRunKernel.h
src/backend/opencl/runners/OclRxBaseRunner.h src/backend/opencl/runners/OclRxBaseRunner.h
src/backend/opencl/runners/OclRxJitRunner.h src/backend/opencl/runners/OclRxJitRunner.h
src/backend/opencl/runners/OclRxVmRunner.h src/backend/opencl/runners/OclRxVmRunner.h
) )
list(APPEND SOURCES_BACKEND_OPENCL list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_rx_generator.cpp src/backend/opencl/generators/ocl_generic_rx_generator.cpp
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp
src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp
src/backend/opencl/kernels/rx/FillAesKernel.cpp src/backend/opencl/kernels/rx/FillAesKernel.cpp
src/backend/opencl/kernels/rx/FindSharesKernel.cpp src/backend/opencl/kernels/rx/FindSharesKernel.cpp
src/backend/opencl/kernels/rx/HashAesKernel.cpp src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.cpp src/backend/opencl/kernels/rx/InitVmKernel.cpp
src/backend/opencl/kernels/rx/RxJitKernel.cpp src/backend/opencl/kernels/rx/RxJitKernel.cpp
src/backend/opencl/kernels/rx/RxRunKernel.cpp src/backend/opencl/kernels/rx/RxRunKernel.cpp
src/backend/opencl/runners/OclRxBaseRunner.cpp src/backend/opencl/runners/OclRxBaseRunner.cpp
src/backend/opencl/runners/OclRxJitRunner.cpp src/backend/opencl/runners/OclRxJitRunner.cpp
src/backend/opencl/runners/OclRxVmRunner.cpp src/backend/opencl/runners/OclRxVmRunner.cpp
) )
endif() endif()
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8) if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND HEADERS_BACKEND_OPENCL list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/Cn00RyoKernel.h src/backend/opencl/kernels/Cn00RyoKernel.h
src/backend/opencl/kernels/Cn1RyoKernel.h src/backend/opencl/kernels/Cn1RyoKernel.h
src/backend/opencl/kernels/Cn2RyoKernel.h src/backend/opencl/kernels/Cn2RyoKernel.h
src/backend/opencl/runners/OclRyoRunner.h src/backend/opencl/runners/OclRyoRunner.h
) )
list(APPEND SOURCES_BACKEND_OPENCL list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp
src/backend/opencl/kernels/Cn00RyoKernel.cpp src/backend/opencl/kernels/Cn00RyoKernel.cpp
src/backend/opencl/kernels/Cn1RyoKernel.cpp src/backend/opencl/kernels/Cn1RyoKernel.cpp
src/backend/opencl/kernels/Cn2RyoKernel.cpp src/backend/opencl/kernels/Cn2RyoKernel.cpp
src/backend/opencl/runners/OclRyoRunner.cpp src/backend/opencl/runners/OclRyoRunner.cpp
) )
endif() endif()
if (WITH_STRICT_CACHE) if (WITH_STRICT_CACHE)
add_definitions(/DXMRIG_STRICT_OPENCL_CACHE) add_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
else() else()
remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE) remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
endif() endif()
if (WITH_INTERLEAVE_DEBUG_LOG) if (WITH_INTERLEAVE_DEBUG_LOG)
add_definitions(/DXMRIG_INTERLEAVE_DEBUG) add_definitions(/DXMRIG_INTERLEAVE_DEBUG)
endif() endif()
if (WITH_ADL AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX))
add_definitions(/DXMRIG_FEATURE_ADL)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/wrappers/AdlHealth.h
src/backend/opencl/wrappers/AdlLib.h
)
if (XMRIG_OS_WIN)
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib.cpp)
else()
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib_linux.cpp)
endif()
else()
remove_definitions(/DXMRIG_FEATURE_ADL)
endif()
else() else()
remove_definitions(/DXMRIG_FEATURE_OPENCL) remove_definitions(/DXMRIG_FEATURE_OPENCL)
remove_definitions(/DXMRIG_FEATURE_ADL)
set(HEADERS_BACKEND_OPENCL "") set(HEADERS_BACKEND_OPENCL "")
set(SOURCES_BACKEND_OPENCL "") set(SOURCES_BACKEND_OPENCL "")

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,7 +23,6 @@
*/ */
#include "backend/opencl/runners/OclRxBaseRunner.h" #include "backend/opencl/runners/OclRxBaseRunner.h"
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h" #include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
#include "backend/opencl/kernels/rx/Blake2bInitialHashKernel.h" #include "backend/opencl/kernels/rx/Blake2bInitialHashKernel.h"
#include "backend/opencl/kernels/rx/FillAesKernel.h" #include "backend/opencl/kernels/rx/FillAesKernel.h"
@ -56,6 +55,10 @@ xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data)
m_gcn_version = 14; m_gcn_version = 14;
} }
if (data.device.type() == OclDevice::Navi_10 || data.device.type() == OclDevice::Navi_12 || data.device.type() == OclDevice::Navi_14) {
m_gcn_version = 15;
}
m_options += " -DALGO=" + std::to_string(RxAlgo::id(m_algorithm)); m_options += " -DALGO=" + std::to_string(RxAlgo::id(m_algorithm));
m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize); m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize);
m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version); m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version);

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,9 +23,9 @@
*/ */
#include "backend/opencl/runners/OclRxJitRunner.h" #include "backend/opencl/runners/OclRxJitRunner.h"
#include "backend/opencl/cl/rx/randomx_run_gfx803.h" #include "backend/opencl/cl/rx/randomx_run_gfx803.h"
#include "backend/opencl/cl/rx/randomx_run_gfx900.h" #include "backend/opencl/cl/rx/randomx_run_gfx900.h"
#include "backend/opencl/cl/rx/randomx_run_gfx1010.h"
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h" #include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
#include "backend/opencl/kernels/rx/HashAesKernel.h" #include "backend/opencl/kernels/rx/HashAesKernel.h"
#include "backend/opencl/kernels/rx/RxJitKernel.h" #include "backend/opencl/kernels/rx/RxJitKernel.h"
@ -84,7 +84,7 @@ void xmrig::OclRxJitRunner::execute(uint32_t iteration)
OclLib::finish(m_queue); OclLib::finish(m_queue);
m_randomx_run->enqueue(m_queue, m_intensity); m_randomx_run->enqueue(m_queue, m_intensity, (m_gcn_version == 15) ? 32 : 64);
} }
@ -120,8 +120,23 @@ bool xmrig::OclRxJitRunner::loadAsmProgram()
elf_header_flags = *reinterpret_cast<uint32_t*>((binary_data.data() + elf_header_flags_offset)); elf_header_flags = *reinterpret_cast<uint32_t*>((binary_data.data() + elf_header_flags_offset));
} }
const size_t len = (m_gcn_version == 14) ? randomx_run_gfx900_bin_size : randomx_run_gfx803_bin_size; size_t len;
unsigned char *binary = (m_gcn_version == 14) ? randomx_run_gfx900_bin : randomx_run_gfx803_bin; unsigned char *binary;
switch (m_gcn_version) {
case 14:
len = randomx_run_gfx900_bin_size;
binary = randomx_run_gfx900_bin;
break;
case 15:
len = randomx_run_gfx1010_bin_size;
binary = randomx_run_gfx1010_bin;
break;
default:
len = randomx_run_gfx803_bin_size;
binary = randomx_run_gfx803_bin;
break;
}
// Set correct internal device ID in the pre-compiled binary // Set correct internal device ID in the pre-compiled binary
if (elf_header_flags) { if (elf_header_flags) {

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -0,0 +1,38 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_ADLHEALTH_H
#define XMRIG_ADLHEALTH_H
#include <cstdint>
#include <vector>
struct AdlHealth
{
uint32_t clock = 0;
uint32_t memClock = 0;
uint32_t power = 0;
uint32_t rpm = 0;
uint32_t temperature = 0;
};
#endif /* XMRIG_ADLHEALTH_H */

View file

@ -0,0 +1,265 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdexcept>
#include <uv.h>
#include "backend/opencl/wrappers/AdlLib.h"
#include "3rdparty/adl/adl_sdk.h"
#include "3rdparty/adl/adl_structures.h"
#include "backend/opencl/wrappers/OclDevice.h"
namespace xmrig {
static std::vector<AdapterInfo> adapters;
static uv_lib_t adlLib;
static const char *kSymbolNotFound = "symbol not found";
static const char *kADL_Main_Control_Create = "ADL_Main_Control_Create";
static const char *kADL_Main_Control_Destroy = "ADL_Main_Control_Destroy";
static const char *kADL_Adapter_NumberOfAdapters_Get = "ADL_Adapter_NumberOfAdapters_Get";
static const char *kADL_Adapter_AdapterInfo_Get = "ADL_Adapter_AdapterInfo_Get";
static const char *kADL2_Overdrive_Caps = "ADL2_Overdrive_Caps";
static const char *kADL2_OverdriveN_FanControl_Get = "ADL2_OverdriveN_FanControl_Get";
static const char *kADL2_New_QueryPMLogData_Get = "ADL2_New_QueryPMLogData_Get";
static const char *kADL2_OverdriveN_Temperature_Get = "ADL2_OverdriveN_Temperature_Get";
static const char *kADL2_OverdriveN_PerformanceStatus_Get = "ADL2_OverdriveN_PerformanceStatus_Get";
static const char *kADL2_Overdrive6_CurrentPower_Get = "ADL2_Overdrive6_CurrentPower_Get";
using ADL_MAIN_CONTROL_CREATE = int (*)(ADL_MAIN_MALLOC_CALLBACK, int);
using ADL_MAIN_CONTROL_DESTROY = int (*)();
using ADL_ADAPTER_NUMBEROFADAPTERS_GET = int (*)(int *);
using ADL_ADAPTER_ADAPTERINFO_GET = int (*)(LPAdapterInfo, int);
using ADL2_OVERDRIVE_CAPS = int (*)(ADL_CONTEXT_HANDLE, int, int *, int *, int *);
using ADL2_OVERDRIVEN_FANCONTROL_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNFanControl *);
using ADL2_NEW_QUERYPMLOGDATA_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLPMLogDataOutput *);
using ADL2_OVERDRIVEN_TEMPERATURE_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
using ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNPerformanceStatus *);
using ADL2_OVERDRIVE6_CURRENTPOWER_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create = nullptr;
ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy = nullptr;
ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get = nullptr;
ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get = nullptr;
ADL2_OVERDRIVE_CAPS ADL2_Overdrive_Caps = nullptr;
ADL2_OVERDRIVEN_FANCONTROL_GET ADL2_OverdriveN_FanControl_Get = nullptr;
ADL2_NEW_QUERYPMLOGDATA_GET ADL2_New_QueryPMLogData_Get = nullptr;
ADL2_OVERDRIVEN_TEMPERATURE_GET ADL2_OverdriveN_Temperature_Get = nullptr;
ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET ADL2_OverdriveN_PerformanceStatus_Get = nullptr;
ADL2_OVERDRIVE6_CURRENTPOWER_GET ADL2_Overdrive6_CurrentPower_Get = nullptr;
#define DLSYM(x) if (uv_dlsym(&adlLib, k##x, reinterpret_cast<void**>(&(x))) == -1) { throw std::runtime_error(kSymbolNotFound); }
bool AdlLib::m_initialized = false;
bool AdlLib::m_ready = false;
static void * __stdcall ADL_Main_Memory_Alloc(int iSize)
{
return malloc(iSize);
}
static inline bool matchTopology(const PciTopology &topology, const AdapterInfo &adapter)
{
return adapter.iBusNumber > -1 && topology.bus() == adapter.iBusNumber && topology.device() == adapter.iDeviceNumber && topology.function() == adapter.iFunctionNumber;
}
static void getFan_v7(const AdapterInfo &adapter, AdlHealth &health)
{
ADLODNFanControl data;
memset(&data, 0, sizeof(ADLODNFanControl));
if (ADL2_OverdriveN_FanControl_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
health.rpm = data.iCurrentFanSpeed;
}
}
static void getTemp_v7(const AdapterInfo &adapter, AdlHealth &health)
{
int temp = 0;
if (ADL2_OverdriveN_Temperature_Get(nullptr, adapter.iAdapterIndex, 1, &temp) == ADL_OK) {
health.temperature = temp / 1000;
}
}
static void getClocks_v7(const AdapterInfo &adapter, AdlHealth &health)
{
ADLODNPerformanceStatus data;
memset(&data, 0, sizeof(ADLODNPerformanceStatus));
if (ADL2_OverdriveN_PerformanceStatus_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
health.clock = data.iCoreClock / 100;
health.memClock = data.iMemoryClock / 100;
}
}
static void getPower_v7(const AdapterInfo &adapter, AdlHealth &health)
{
int power = 0;
if (ADL2_Overdrive6_CurrentPower_Get && ADL2_Overdrive6_CurrentPower_Get(nullptr, adapter.iAdapterIndex, 0, &power) == ADL_OK) {
health.power = static_cast<uint32_t>(power / 256.0);
}
}
static void getSensorsData_v8(const AdapterInfo &adapter, AdlHealth &health)
{
if (!ADL2_New_QueryPMLogData_Get) {
return;
}
ADLPMLogDataOutput data;
memset(&data, 0, sizeof(ADLPMLogDataOutput));
if (ADL2_New_QueryPMLogData_Get(nullptr, adapter.iAdapterIndex, &data) != ADL_OK) {
return;
}
auto sensorValue = [&data](ADLSensorType type) { return data.sensors[type].supported ? data.sensors[type].value : 0; };
health.clock = sensorValue(PMLOG_CLK_GFXCLK);
health.memClock = sensorValue(PMLOG_CLK_MEMCLK);
health.power = sensorValue(PMLOG_ASIC_POWER);
health.rpm = sensorValue(PMLOG_FAN_RPM);
health.temperature = sensorValue(PMLOG_TEMPERATURE_HOTSPOT);
}
} // namespace xmrig
bool xmrig::AdlLib::init()
{
if (!m_initialized) {
m_ready = dlopen() && load();
m_initialized = true;
}
return m_ready;
}
const char *xmrig::AdlLib::lastError() noexcept
{
return uv_dlerror(&adlLib);
}
void xmrig::AdlLib::close()
{
if (m_ready) {
ADL_Main_Control_Destroy();
}
uv_dlclose(&adlLib);
}
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
{
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
return {};
}
int supported, enabled, version;
AdlHealth health;
for (const auto &adapter : adapters) {
if (matchTopology(device.topology(), adapter)) {
if (ADL2_Overdrive_Caps(nullptr, adapter.iAdapterIndex, &supported, &enabled, &version) != ADL_OK) {
continue;
}
if (version == 7) {
getFan_v7(adapter, health);
getTemp_v7(adapter, health);
getClocks_v7(adapter, health);
getPower_v7(adapter, health);
}
else if (version == 8) {
getSensorsData_v8(adapter, health);
}
break;
}
}
return health;
}
bool xmrig::AdlLib::dlopen()
{
return uv_dlopen("atiadlxx.dll", &adlLib) == 0;
}
bool xmrig::AdlLib::load()
{
try {
DLSYM(ADL_Main_Control_Create);
DLSYM(ADL_Main_Control_Destroy);
DLSYM(ADL_Adapter_NumberOfAdapters_Get);
DLSYM(ADL_Adapter_AdapterInfo_Get);
DLSYM(ADL2_Overdrive_Caps);
DLSYM(ADL2_OverdriveN_FanControl_Get);
DLSYM(ADL2_OverdriveN_Temperature_Get);
DLSYM(ADL2_OverdriveN_PerformanceStatus_Get);
} catch (std::exception &ex) {
return false;
}
try {
DLSYM(ADL2_Overdrive6_CurrentPower_Get);
DLSYM(ADL2_New_QueryPMLogData_Get);
} catch (std::exception &ex) {}
if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK) {
return false;
}
int count = 0;
if (ADL_Adapter_NumberOfAdapters_Get(&count) != ADL_OK) {
return false;
}
if (count == 0) {
return false;
}
adapters.resize(count);
const size_t size = sizeof(adapters[0]) * adapters.size();
memset(adapters.data(), 0, size);
return ADL_Adapter_AdapterInfo_Get(adapters.data(), size) == ADL_OK;
}

View file

@ -0,0 +1,57 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_ADLLIB_H
#define XMRIG_ADLLIB_H
#include "backend/opencl/wrappers/AdlHealth.h"
namespace xmrig {
class OclDevice;
class AdlLib
{
public:
static bool init();
static const char *lastError() noexcept;
static void close();
static AdlHealth health(const OclDevice &device);
static inline bool isInitialized() noexcept { return m_initialized; }
static inline bool isReady() noexcept { return m_ready; }
private:
static bool dlopen();
static bool load();
static bool m_initialized;
static bool m_ready;
};
} // namespace xmrig
#endif /* XMRIG_ADLLIB_H */

View file

@ -0,0 +1,138 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "backend/opencl/wrappers/AdlLib.h"
#include "backend/opencl/wrappers/OclDevice.h"
#include <fstream>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
namespace xmrig {
bool AdlLib::m_initialized = false;
bool AdlLib::m_ready = false;
static const std::string kPrefix = "/sys/bus/pci/drivers/amdgpu/";
static inline bool sysfs_is_file(const char *path)
{
struct stat sb;
return stat(path, &sb) == 0 && ((sb.st_mode & S_IFMT) == S_IFREG);
}
static inline std::string sysfs_prefix(const PciTopology &topology)
{
std::string path = kPrefix + "0000:" + topology.toString().data() + "/hwmon/hwmon";
if (sysfs_is_file((path + "2/name").c_str())) {
return path + "2/";
}
if (sysfs_is_file((path + "3/name").c_str())) {
return path + "3/";
}
return {};
}
uint32_t sysfs_read(const std::string &path)
{
std::ifstream file(path);
if (!file.is_open()) {
return 0;
}
uint32_t value = 0;
file >> value;
return value;
}
} // namespace xmrig
bool xmrig::AdlLib::init()
{
if (!m_initialized) {
m_ready = dlopen() && load();
m_initialized = true;
}
return m_ready;
}
const char *xmrig::AdlLib::lastError() noexcept
{
return nullptr;
}
void xmrig::AdlLib::close()
{
}
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
{
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
return {};
}
const auto prefix = sysfs_prefix(device.topology());
if (prefix.empty()) {
return {};
}
AdlHealth health;
health.clock = sysfs_read(prefix + "freq1_input") / 1000000;
health.memClock = sysfs_read(prefix + "freq2_input") / 1000000;
health.power = sysfs_read(prefix + "power1_average") / 1000000;
health.rpm = sysfs_read(prefix + "fan1_input");
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
return health;
}
bool xmrig::AdlLib::dlopen()
{
struct stat sb;
if (stat(kPrefix.c_str(), &sb) == -1) {
return false;
}
return (sb.st_mode & S_IFMT) == S_IFDIR;
}
bool xmrig::AdlLib::load()
{
return true;
}

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,7 +24,6 @@
#include "backend/opencl/wrappers/OclDevice.h" #include "backend/opencl/wrappers/OclDevice.h"
#include "backend/opencl/OclGenerator.h" #include "backend/opencl/OclGenerator.h"
#include "backend/opencl/OclThreads.h" #include "backend/opencl/OclThreads.h"
#include "backend/opencl/wrappers/OclLib.h" #include "backend/opencl/wrappers/OclLib.h"
@ -33,6 +32,10 @@
#include "crypto/common/Algorithm.h" #include "crypto/common/Algorithm.h"
#include "rapidjson/document.h" #include "rapidjson/document.h"
#ifdef XMRIG_FEATURE_ADL
# include "backend/opencl/wrappers/AdlLib.h"
#endif
#include <algorithm> #include <algorithm>
@ -107,6 +110,14 @@ static OclDevice::Type getType(const String &name)
return OclDevice::Navi_10; return OclDevice::Navi_10;
} }
if (name == "gfx1011") {
return OclDevice::Navi_12;
}
if (name == "gfx1012") {
return OclDevice::Navi_14;
}
if (name == "gfx804") { if (name == "gfx804") {
return OclDevice::Lexa; return OclDevice::Lexa;
} }
@ -200,5 +211,20 @@ void xmrig::OclDevice::toJSON(rapidjson::Value &out, rapidjson::Document &doc) c
out.AddMember("bus_id", topology().toString().toJSON(doc), allocator); out.AddMember("bus_id", topology().toString().toJSON(doc), allocator);
out.AddMember("cu", computeUnits(), allocator); out.AddMember("cu", computeUnits(), allocator);
out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator); out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator);
# ifdef XMRIG_FEATURE_ADL
if (AdlLib::isReady()) {
auto data = AdlLib::health(*this);
Value health(kObjectType);
health.AddMember("temperature", data.temperature, allocator);
health.AddMember("power", data.power, allocator);
health.AddMember("clock", data.clock, allocator);
health.AddMember("mem_clock", data.memClock, allocator);
health.AddMember("rpm", data.rpm, allocator);
out.AddMember("health", health, allocator);
}
# endif
} }
#endif #endif

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -56,7 +56,9 @@ public:
Vega_10, Vega_10,
Vega_20, Vega_20,
Raven, Raven,
Navi_10 Navi_10,
Navi_12,
Navi_14
}; };
OclDevice() = delete; OclDevice() = delete;

View file

@ -37,10 +37,12 @@ set(HEADERS_BASE
src/base/net/stratum/BaseClient.h src/base/net/stratum/BaseClient.h
src/base/net/stratum/Client.h src/base/net/stratum/Client.h
src/base/net/stratum/Job.h src/base/net/stratum/Job.h
src/base/net/stratum/NetworkState.h
src/base/net/stratum/Pool.h src/base/net/stratum/Pool.h
src/base/net/stratum/Pools.h src/base/net/stratum/Pools.h
src/base/net/stratum/strategies/FailoverStrategy.h src/base/net/stratum/strategies/FailoverStrategy.h
src/base/net/stratum/strategies/SinglePoolStrategy.h src/base/net/stratum/strategies/SinglePoolStrategy.h
src/base/net/stratum/strategies/StrategyProxy.h
src/base/net/stratum/SubmitResult.h src/base/net/stratum/SubmitResult.h
src/base/net/stratum/Url.h src/base/net/stratum/Url.h
src/base/net/tools/RecvBuf.h src/base/net/tools/RecvBuf.h
@ -77,6 +79,7 @@ set(SOURCES_BASE
src/base/net/stratum/BaseClient.cpp src/base/net/stratum/BaseClient.cpp
src/base/net/stratum/Client.cpp src/base/net/stratum/Client.cpp
src/base/net/stratum/Job.cpp src/base/net/stratum/Job.cpp
src/base/net/stratum/NetworkState.cpp
src/base/net/stratum/Pool.cpp src/base/net/stratum/Pool.cpp
src/base/net/stratum/Pools.cpp src/base/net/stratum/Pools.cpp
src/base/net/stratum/strategies/FailoverStrategy.cpp src/base/net/stratum/strategies/FailoverStrategy.cpp

View file

@ -5,9 +5,9 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2019 jtgrassie <https://github.com/jtgrassie> * Copyright 2019 jtgrassie <https://github.com/jtgrassie>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -181,11 +181,17 @@ int64_t xmrig::Client::send(const rapidjson::Value &obj)
int64_t xmrig::Client::submit(const JobResult &result) int64_t xmrig::Client::submit(const JobResult &result)
{ {
# ifndef XMRIG_PROXY_PROJECT # ifndef XMRIG_PROXY_PROJECT
if (result.clientId != m_rpcId) { if (result.clientId != m_rpcId || m_state != ConnectedState) {
return -1; return -1;
} }
# endif # endif
if (result.diff == 0) {
close();
return -1;
}
using namespace rapidjson; using namespace rapidjson;
# ifdef XMRIG_PROXY_PROJECT # ifdef XMRIG_PROXY_PROJECT

View file

@ -0,0 +1,208 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "base/net/stratum/NetworkState.h"
#include "base/kernel/interfaces/IClient.h"
#include "base/kernel/interfaces/IStrategy.h"
#include "base/net/stratum/Job.h"
#include "base/net/stratum/Pool.h"
#include "base/net/stratum/SubmitResult.h"
#include "base/tools/Chrono.h"
#include "rapidjson/document.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <uv.h>
xmrig::NetworkState::NetworkState(IStrategyListener *listener) : StrategyProxy(listener)
{
}
#ifdef XMRIG_FEATURE_API
rapidjson::Value xmrig::NetworkState::getConnection(rapidjson::Document &doc, int version) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
Value connection(kObjectType);
connection.AddMember("pool", StringRef(m_pool), allocator);
connection.AddMember("ip", m_ip.toJSON(), allocator);
connection.AddMember("uptime", connectionTime(), allocator);
connection.AddMember("ping", latency(), allocator);
connection.AddMember("failures", m_failures, allocator);
connection.AddMember("tls", m_tls.toJSON(), allocator);
connection.AddMember("tls-fingerprint", m_fingerprint.toJSON(), allocator);
connection.AddMember("algo", m_algorithm.toJSON(), allocator);
connection.AddMember("diff", m_diff, allocator);
connection.AddMember("accepted", m_accepted, allocator);
connection.AddMember("rejected", m_rejected, allocator);
connection.AddMember("avg_time", avgTime(), allocator);
connection.AddMember("hashes_total", m_hashes, allocator);
if (version == 1) {
connection.AddMember("error_log", Value(kArrayType), allocator);
}
return connection;
}
rapidjson::Value xmrig::NetworkState::getResults(rapidjson::Document &doc, int version) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
Value results(kObjectType);
results.AddMember("diff_current", m_diff, allocator);
results.AddMember("shares_good", m_accepted, allocator);
results.AddMember("shares_total", m_accepted + m_rejected, allocator);
results.AddMember("avg_time", avgTime(), allocator);
results.AddMember("hashes_total", m_hashes, allocator);
Value best(kArrayType);
for (uint64_t i : topDiff) {
best.PushBack(i, allocator);
}
results.AddMember("best", best, allocator);
if (version == 1) {
results.AddMember("error_log", Value(kArrayType), allocator);
}
return results;
}
#endif
void xmrig::NetworkState::onActive(IStrategy *strategy, IClient *client)
{
snprintf(m_pool, sizeof(m_pool) - 1, "%s:%d", client->pool().host().data(), client->pool().port());
m_ip = client->ip();
m_tls = client->tlsVersion();
m_fingerprint = client->tlsFingerprint();
m_active = true;
m_connectionTime = Chrono::steadyMSecs();
StrategyProxy::onActive(strategy, client);
}
void xmrig::NetworkState::onJob(IStrategy *strategy, IClient *client, const Job &job)
{
m_algorithm = job.algorithm();
m_diff = job.diff();
StrategyProxy::onJob(strategy, client, job);
}
void xmrig::NetworkState::onPause(IStrategy *strategy)
{
if (!strategy->isActive()) {
stop();
}
StrategyProxy::onPause(strategy);
}
void xmrig::NetworkState::onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error)
{
add(result, error);
StrategyProxy::onResultAccepted(strategy, client, result, error);
}
uint32_t xmrig::NetworkState::avgTime() const
{
if (m_latency.empty()) {
return 0;
}
return connectionTime() / (uint32_t)m_latency.size();
}
uint32_t xmrig::NetworkState::latency() const
{
const size_t calls = m_latency.size();
if (calls == 0) {
return 0;
}
auto v = m_latency;
std::nth_element(v.begin(), v.begin() + calls / 2, v.end());
return v[calls / 2];
}
uint64_t xmrig::NetworkState::connectionTime() const
{
return m_active ? ((Chrono::steadyMSecs() - m_connectionTime) / 1000) : 0;
}
void xmrig::NetworkState::add(const SubmitResult &result, const char *error)
{
if (error) {
m_rejected++;
return;
}
m_accepted++;
m_hashes += result.diff;
const size_t ln = topDiff.size() - 1;
if (result.actualDiff > topDiff[ln]) {
topDiff[ln] = result.actualDiff;
std::sort(topDiff.rbegin(), topDiff.rend());
}
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : static_cast<uint16_t>(result.elapsed));
}
void xmrig::NetworkState::stop()
{
m_active = false;
m_diff = 0;
m_ip = nullptr;
m_tls = nullptr;
m_fingerprint = nullptr;
m_failures++;
m_latency.clear();
}

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,51 +26,59 @@
#define XMRIG_NETWORKSTATE_H #define XMRIG_NETWORKSTATE_H
#include "base/net/stratum/strategies/StrategyProxy.h"
#include "base/tools/String.h"
#include "crypto/common/Algorithm.h"
#include <array> #include <array>
#include <vector> #include <vector>
#include "base/tools/String.h"
namespace xmrig { namespace xmrig {
class IClient; class NetworkState : public StrategyProxy
class SubmitResult;
class NetworkState
{ {
public: public:
NetworkState(); NetworkState(IStrategyListener *listener);
inline const String &fingerprint() const { return m_fingerprint; } inline const Algorithm &algorithm() const { return m_algorithm; }
inline const String &ip() const { return m_ip; } inline uint64_t accepted() const { return m_accepted; }
inline const String &tls() const { return m_tls; } inline uint64_t rejected() const { return m_rejected; }
# ifdef XMRIG_FEATURE_API
rapidjson::Value getConnection(rapidjson::Document &doc, int version) const;
rapidjson::Value getResults(rapidjson::Document &doc, int version) const;
# endif
protected:
void onActive(IStrategy *strategy, IClient *client) override;
void onJob(IStrategy *strategy, IClient *client, const Job &job) override;
void onPause(IStrategy *strategy) override;
void onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error) override;
private:
uint32_t avgTime() const; uint32_t avgTime() const;
uint32_t latency() const; uint32_t latency() const;
uint64_t connectionTime() const; uint64_t connectionTime() const;
void add(const SubmitResult &result, const char *error); void add(const SubmitResult &result, const char *error);
void onActive(IClient *client);
void stop(); void stop();
char pool[256]; Algorithm m_algorithm;
bool m_active = false;
char m_pool[256]{};
std::array<uint64_t, 10> topDiff { { } }; std::array<uint64_t, 10> topDiff { { } };
uint64_t accepted;
uint64_t diff;
uint64_t failures;
uint64_t rejected;
uint64_t total;
private:
bool m_active;
std::vector<uint16_t> m_latency; std::vector<uint16_t> m_latency;
String m_fingerprint; String m_fingerprint;
String m_ip; String m_ip;
String m_tls; String m_tls;
uint64_t m_connectionTime; uint64_t m_accepted = 0;
uint64_t m_connectionTime = 0;
uint64_t m_diff = 0;
uint64_t m_failures = 0;
uint64_t m_hashes = 0;
uint64_t m_rejected = 0;
}; };

View file

@ -0,0 +1,79 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_STRATEGYPROXY_H
#define XMRIG_STRATEGYPROXY_H
#include "base/kernel/interfaces/IStrategyListener.h"
namespace xmrig {
class StrategyProxy : public IStrategyListener
{
public:
inline StrategyProxy(IStrategyListener *listener) : m_listener(listener) {}
protected:
inline void onActive(IStrategy *strategy, IClient *client) override
{
m_listener->onActive(strategy, client);
}
inline void onJob(IStrategy *strategy, IClient *client, const Job &job) override
{
m_listener->onJob(strategy, client, job);
}
inline void onLogin(IStrategy *strategy, IClient *client, rapidjson::Document &doc, rapidjson::Value &params) override
{
m_listener->onLogin(strategy, client, doc, params);
}
inline void onPause(IStrategy *strategy) override
{
m_listener->onPause(strategy);
}
inline void onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error) override
{
m_listener->onResultAccepted(strategy, client, result, error);
}
inline void onVerifyAlgorithm(IStrategy *strategy, const IClient *client, const Algorithm &algorithm, bool *ok) override
{
m_listener->onVerifyAlgorithm(strategy, client, algorithm, ok);
}
private:
IStrategyListener *m_listener;
};
} /* namespace xmrig */
#endif /* XMRIG_STRATEGYPROXY_H */

View file

@ -39,6 +39,7 @@
"cache": true, "cache": true,
"loader": null, "loader": null,
"platform": "AMD", "platform": "AMD",
"adl": true,
"cn/0": false, "cn/0": false,
"cn-lite/0": false "cn-lite/0": false
}, },

View file

@ -353,6 +353,13 @@ void xmrig::Miner::execCommand(char command)
setEnabled(true); setEnabled(true);
break; break;
case 'e':
case 'E':
for (auto backend : d_ptr->backends) {
backend->printHealth();
}
break;
default: default:
break; break;
} }
@ -489,11 +496,16 @@ void xmrig::Miner::onConfigChanged(Config *config, Config *previousConfig)
void xmrig::Miner::onTimer(const Timer *) void xmrig::Miner::onTimer(const Timer *)
{ {
double maxHashrate = 0.0; double maxHashrate = 0.0;
const auto healthPrintTime = d_ptr->controller->config()->healthPrintTime();
for (IBackend *backend : d_ptr->backends) { for (IBackend *backend : d_ptr->backends) {
backend->tick(d_ptr->ticks); backend->tick(d_ptr->ticks);
if (healthPrintTime && d_ptr->ticks && (d_ptr->ticks % (healthPrintTime * 2)) == 0 && backend->isEnabled()) {
backend->printHealth();
}
if (backend->hashrate()) { if (backend->hashrate()) {
maxHashrate += backend->hashrate()->calc(Hashrate::ShortInterval); maxHashrate += backend->hashrate()->calc(Hashrate::ShortInterval);
} }
@ -501,8 +513,8 @@ void xmrig::Miner::onTimer(const Timer *)
d_ptr->maxHashrate[d_ptr->algorithm] = std::max(d_ptr->maxHashrate[d_ptr->algorithm], maxHashrate); d_ptr->maxHashrate[d_ptr->algorithm] = std::max(d_ptr->maxHashrate[d_ptr->algorithm], maxHashrate);
auto seconds = d_ptr->controller->config()->printTime(); const auto printTime = d_ptr->controller->config()->printTime();
if (seconds && (d_ptr->ticks % (seconds * 2)) == 0) { if (printTime && d_ptr->ticks && (d_ptr->ticks % (printTime * 2)) == 0) {
printHashrate(false); printHashrate(false);
} }

View file

@ -70,7 +70,7 @@ static const char *kCuda = "cuda";
#endif #endif
#if defined(XMRIG_FEATURE_NVML) #if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
static const char *kHealthPrintTime = "health-print-time"; static const char *kHealthPrintTime = "health-print-time";
#endif #endif
@ -92,7 +92,7 @@ public:
CudaConfig cuda; CudaConfig cuda;
# endif # endif
# if defined(XMRIG_FEATURE_NVML) # if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
uint32_t healthPrintTime = 60; uint32_t healthPrintTime = 60;
# endif # endif
}; };
@ -142,7 +142,7 @@ const xmrig::RxConfig &xmrig::Config::rx() const
#endif #endif
#if defined(XMRIG_FEATURE_NVML) #if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
uint32_t xmrig::Config::healthPrintTime() const uint32_t xmrig::Config::healthPrintTime() const
{ {
return d_ptr->healthPrintTime; return d_ptr->healthPrintTime;
@ -194,7 +194,7 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
d_ptr->cuda.read(reader.getValue(kCuda)); d_ptr->cuda.read(reader.getValue(kCuda));
# endif # endif
# ifdef XMRIG_FEATURE_NVML # if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
d_ptr->healthPrintTime = reader.getUint(kHealthPrintTime, d_ptr->healthPrintTime); d_ptr->healthPrintTime = reader.getUint(kHealthPrintTime, d_ptr->healthPrintTime);
# endif # endif
@ -239,7 +239,7 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
doc.AddMember(StringRef(kLogFile), m_logFile.toJSON(), allocator); doc.AddMember(StringRef(kLogFile), m_logFile.toJSON(), allocator);
doc.AddMember(StringRef(Pools::kPools), m_pools.toJSON(doc), allocator); doc.AddMember(StringRef(Pools::kPools), m_pools.toJSON(doc), allocator);
doc.AddMember(StringRef(kPrintTime), printTime(), allocator); doc.AddMember(StringRef(kPrintTime), printTime(), allocator);
# if defined(XMRIG_FEATURE_NVML) # if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
doc.AddMember(StringRef(kHealthPrintTime), healthPrintTime(), allocator); doc.AddMember(StringRef(kHealthPrintTime), healthPrintTime(), allocator);
# endif # endif
doc.AddMember(StringRef(Pools::kRetries), m_pools.retries(), allocator); doc.AddMember(StringRef(Pools::kRetries), m_pools.retries(), allocator);

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -67,8 +67,10 @@ public:
const RxConfig &rx() const; const RxConfig &rx() const;
# endif # endif
# if defined(XMRIG_FEATURE_NVML) # if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
uint32_t healthPrintTime() const; uint32_t healthPrintTime() const;
# else
uint32_t healthPrintTime() const { return 0; }
# endif # endif
bool isShouldSave() const; bool isShouldSave() const;

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,12 +23,12 @@
*/ */
#include <mutex>
#include "crypto/common/Nonce.h" #include "crypto/common/Nonce.h"
#include <mutex>
namespace xmrig { namespace xmrig {
@ -54,13 +54,23 @@ xmrig::Nonce::Nonce()
} }
uint32_t xmrig::Nonce::next(uint8_t index, uint32_t nonce, uint32_t reserveCount, bool nicehash) uint32_t xmrig::Nonce::next(uint8_t index, uint32_t nonce, uint32_t reserveCount, bool nicehash, bool *ok)
{ {
uint32_t next; uint32_t next;
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
if (nicehash) { if (nicehash) {
if ((m_nonces[index] + reserveCount) > 0x1000000) {
if (ok) {
*ok = false;
}
pause(true);
return 0;
}
next = (nonce & 0xFF000000) | m_nonces[index]; next = (nonce & 0xFF000000) | m_nonces[index];
} }
else { else {

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -52,7 +52,7 @@ public:
static inline void stop(Backend backend) { m_sequence[backend] = 0; } static inline void stop(Backend backend) { m_sequence[backend] = 0; }
static inline void touch(Backend backend) { m_sequence[backend]++; } static inline void touch(Backend backend) { m_sequence[backend]++; }
static uint32_t next(uint8_t index, uint32_t nonce, uint32_t reserveCount, bool nicehash); static uint32_t next(uint8_t index, uint32_t nonce, uint32_t reserveCount, bool nicehash, bool *ok = nullptr);
static void reset(uint8_t index); static void reset(uint8_t index);
static void stop(); static void stop();
static void touch(); static void touch();

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -55,6 +55,17 @@ public:
memcpy(m_result, result, sizeof(m_result)); memcpy(m_result, result, sizeof(m_result));
} }
inline JobResult(const Job &job) :
algorithm(job.algorithm()),
clientId(job.clientId()),
jobId(job.id()),
backend(job.backend()),
nonce(0),
diff(0),
index(job.index())
{
}
inline const uint8_t *result() const { return m_result; } inline const uint8_t *result() const { return m_result; }
inline uint64_t actualDiff() const { return Job::toDiff(reinterpret_cast<const uint64_t*>(m_result)[3]); } inline uint64_t actualDiff() const { return Job::toDiff(reinterpret_cast<const uint64_t*>(m_result)[3]); }
inline uint8_t *result() { return m_result; } inline uint8_t *result() { return m_result; }

View file

@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,7 +24,6 @@
#include "net/JobResults.h" #include "net/JobResults.h"
#include "base/io/log/Log.h" #include "base/io/log/Log.h"
#include "base/tools/Handle.h" #include "base/tools/Handle.h"
#include "base/tools/Object.h" #include "base/tools/Object.h"
@ -272,6 +271,11 @@ static JobResultsPrivate *handler = nullptr;
} // namespace xmrig } // namespace xmrig
void xmrig::JobResults::done(const Job &job)
{
submit(JobResult(job));
}
void xmrig::JobResults::setListener(IJobResultListener *listener, bool hwAES) void xmrig::JobResults::setListener(IJobResultListener *listener, bool hwAES)
{ {

View file

@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -42,6 +42,7 @@ class JobResult;
class JobResults class JobResults
{ {
public: public:
static void done(const Job &job);
static void setListener(IJobResultListener *listener, bool hwAES); static void setListener(IJobResultListener *listener, bool hwAES);
static void stop(); static void stop();
static void submit(const Job &job, uint32_t nonce, const uint8_t *result); static void submit(const Job &job, uint32_t nonce, const uint8_t *result);

View file

@ -5,9 +5,9 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2019 Howard Chu <https://github.com/hyc> * Copyright 2019 Howard Chu <https://github.com/hyc>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -27,16 +27,11 @@
#pragma warning(disable:4244) #pragma warning(disable:4244)
#endif #endif
#include <algorithm> #include "net/Network.h"
#include <cinttypes>
#include <ctime>
#include <iterator>
#include <memory>
#include "backend/common/Tags.h" #include "backend/common/Tags.h"
#include "base/io/log/Log.h" #include "base/io/log/Log.h"
#include "base/net/stratum/Client.h" #include "base/net/stratum/Client.h"
#include "base/net/stratum/NetworkState.h"
#include "base/net/stratum/SubmitResult.h" #include "base/net/stratum/SubmitResult.h"
#include "base/tools/Chrono.h" #include "base/tools/Chrono.h"
#include "base/tools/Timer.h" #include "base/tools/Timer.h"
@ -45,7 +40,6 @@
#include "core/Miner.h" #include "core/Miner.h"
#include "net/JobResult.h" #include "net/JobResult.h"
#include "net/JobResults.h" #include "net/JobResults.h"
#include "net/Network.h"
#include "net/strategies/DonateStrategy.h" #include "net/strategies/DonateStrategy.h"
#include "rapidjson/document.h" #include "rapidjson/document.h"
@ -56,6 +50,13 @@
#endif #endif
#include <algorithm>
#include <cinttypes>
#include <ctime>
#include <iterator>
#include <memory>
namespace xmrig { namespace xmrig {
@ -73,9 +74,7 @@ const char *xmrig::net_tag()
xmrig::Network::Network(Controller *controller) : xmrig::Network::Network(Controller *controller) :
m_controller(controller), m_controller(controller)
m_donate(nullptr),
m_timer(nullptr)
{ {
JobResults::setListener(this, controller->config()->cpu().isHwAES()); JobResults::setListener(this, controller->config()->cpu().isHwAES());
controller->addListener(this); controller->addListener(this);
@ -84,8 +83,10 @@ xmrig::Network::Network(Controller *controller) :
controller->api()->addListener(this); controller->api()->addListener(this);
# endif # endif
m_state = new NetworkState(this);
const Pools &pools = controller->config()->pools(); const Pools &pools = controller->config()->pools();
m_strategy = pools.createStrategy(this); m_strategy = pools.createStrategy(m_state);
if (pools.donateLevel() > 0) { if (pools.donateLevel() > 0) {
m_donate = new DonateStrategy(controller, this); m_donate = new DonateStrategy(controller, this);
@ -102,6 +103,7 @@ xmrig::Network::~Network()
delete m_timer; delete m_timer;
delete m_donate; delete m_donate;
delete m_strategy; delete m_strategy;
delete m_state;
} }
@ -118,8 +120,6 @@ void xmrig::Network::onActive(IStrategy *strategy, IClient *client)
return; return;
} }
m_state.onActive(client);
const char *tlsVersion = client->tlsVersion(); const char *tlsVersion = client->tlsVersion();
LOG_INFO("%s " WHITE_BOLD("use %s ") CYAN_BOLD("%s:%d ") GREEN_BOLD("%s") " " BLACK_BOLD("%s"), LOG_INFO("%s " WHITE_BOLD("use %s ") CYAN_BOLD("%s:%d ") GREEN_BOLD("%s") " " BLACK_BOLD("%s"),
tag, client->mode(), client->pool().host().data(), client->pool().port(), tlsVersion ? tlsVersion : "", client->ip().data()); tag, client->mode(), client->pool().host().data(), client->pool().port(), tlsVersion ? tlsVersion : "", client->ip().data());
@ -201,7 +201,6 @@ void xmrig::Network::onPause(IStrategy *strategy)
if (!m_strategy->isActive()) { if (!m_strategy->isActive()) {
LOG_ERR("%s " RED("no active pools, stop mining"), tag); LOG_ERR("%s " RED("no active pools, stop mining"), tag);
m_state.stop();
return m_controller->miner()->pause(); return m_controller->miner()->pause();
} }
@ -210,15 +209,13 @@ void xmrig::Network::onPause(IStrategy *strategy)
void xmrig::Network::onResultAccepted(IStrategy *, IClient *, const SubmitResult &result, const char *error) void xmrig::Network::onResultAccepted(IStrategy *, IClient *, const SubmitResult &result, const char *error)
{ {
m_state.add(result, error);
if (error) { if (error) {
LOG_INFO("%s " RED_BOLD("rejected") " (%" PRId64 "/%" PRId64 ") diff " WHITE_BOLD("%" PRIu64) " " RED("\"%s\"") " " BLACK_BOLD("(%" PRIu64 " ms)"), LOG_INFO("%s " RED_BOLD("rejected") " (%" PRId64 "/%" PRId64 ") diff " WHITE_BOLD("%" PRIu64) " " RED("\"%s\"") " " BLACK_BOLD("(%" PRIu64 " ms)"),
backend_tag(result.backend), m_state.accepted, m_state.rejected, result.diff, error, result.elapsed); backend_tag(result.backend), m_state->accepted(), m_state->rejected(), result.diff, error, result.elapsed);
} }
else { else {
LOG_INFO("%s " GREEN_BOLD("accepted") " (%" PRId64 "/%" PRId64 ") diff " WHITE_BOLD("%" PRIu64) " " BLACK_BOLD("(%" PRIu64 " ms)"), LOG_INFO("%s " GREEN_BOLD("accepted") " (%" PRId64 "/%" PRId64 ") diff " WHITE_BOLD("%" PRIu64) " " BLACK_BOLD("(%" PRIu64 " ms)"),
backend_tag(result.backend), m_state.accepted, m_state.rejected, result.diff, result.elapsed); backend_tag(result.backend), m_state->accepted(), m_state->rejected(), result.diff, result.elapsed);
} }
} }
@ -261,7 +258,6 @@ void xmrig::Network::setJob(IClient *client, const Job &job, bool donate)
m_donate->setAlgo(job.algorithm()); m_donate->setAlgo(job.algorithm());
} }
m_state.diff = job.diff();
m_controller->miner()->setJob(job, donate); m_controller->miner()->setJob(job, donate);
} }
@ -284,22 +280,8 @@ void xmrig::Network::getConnection(rapidjson::Value &reply, rapidjson::Document
using namespace rapidjson; using namespace rapidjson;
auto &allocator = doc.GetAllocator(); auto &allocator = doc.GetAllocator();
reply.AddMember("algo", StringRef(m_strategy->client()->job().algorithm().shortName()), allocator); reply.AddMember("algo", m_state->algorithm().toJSON(), allocator);
reply.AddMember("connection", m_state->getConnection(doc, version), allocator);
Value connection(kObjectType);
connection.AddMember("pool", StringRef(m_state.pool), allocator);
connection.AddMember("ip", m_state.ip().toJSON(), allocator);
connection.AddMember("uptime", m_state.connectionTime(), allocator);
connection.AddMember("ping", m_state.latency(), allocator);
connection.AddMember("failures", m_state.failures, allocator);
connection.AddMember("tls", m_state.tls().toJSON(), allocator);
connection.AddMember("tls-fingerprint", m_state.fingerprint().toJSON(), allocator);
if (version == 1) {
connection.AddMember("error_log", Value(kArrayType), allocator);
}
reply.AddMember("connection", connection, allocator);
} }
@ -308,25 +290,6 @@ void xmrig::Network::getResults(rapidjson::Value &reply, rapidjson::Document &do
using namespace rapidjson; using namespace rapidjson;
auto &allocator = doc.GetAllocator(); auto &allocator = doc.GetAllocator();
Value results(kObjectType); reply.AddMember("results", m_state->getResults(doc, version), allocator);
results.AddMember("diff_current", m_state.diff, allocator);
results.AddMember("shares_good", m_state.accepted, allocator);
results.AddMember("shares_total", m_state.accepted + m_state.rejected, allocator);
results.AddMember("avg_time", m_state.avgTime(), allocator);
results.AddMember("hashes_total", m_state.total, allocator);
Value best(kArrayType);
for (uint64_t i : m_state.topDiff) {
best.PushBack(i, allocator);
}
results.AddMember("best", best, allocator);
if (version == 1) {
results.AddMember("error_log", Value(kArrayType), allocator);
}
reply.AddMember("results", results, allocator);
} }
#endif #endif

View file

@ -5,9 +5,9 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2019 Howard Chu <https://github.com/hyc> * Copyright 2019 Howard Chu <https://github.com/hyc>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -27,24 +27,24 @@
#define XMRIG_NETWORK_H #define XMRIG_NETWORK_H
#include <vector>
#include "base/api/interfaces/IApiListener.h" #include "base/api/interfaces/IApiListener.h"
#include "base/kernel/interfaces/IBaseListener.h" #include "base/kernel/interfaces/IBaseListener.h"
#include "base/kernel/interfaces/IStrategyListener.h" #include "base/kernel/interfaces/IStrategyListener.h"
#include "base/kernel/interfaces/ITimerListener.h" #include "base/kernel/interfaces/ITimerListener.h"
#include "base/tools/Object.h" #include "base/tools/Object.h"
#include "interfaces/IJobResultListener.h" #include "interfaces/IJobResultListener.h"
#include "net/NetworkState.h"
#include "rapidjson/fwd.h" #include "rapidjson/fwd.h"
#include <vector>
namespace xmrig { namespace xmrig {
class Controller; class Controller;
class IStrategy; class IStrategy;
class NetworkState;
class Network : public IJobResultListener, public IStrategyListener, public IBaseListener, public ITimerListener, public IApiListener class Network : public IJobResultListener, public IStrategyListener, public IBaseListener, public ITimerListener, public IApiListener
@ -87,10 +87,10 @@ private:
# endif # endif
Controller *m_controller; Controller *m_controller;
IStrategy *m_donate; IStrategy *m_donate = nullptr;
IStrategy *m_strategy; IStrategy *m_strategy = nullptr;
NetworkState m_state; NetworkState *m_state = nullptr;
Timer *m_timer; Timer *m_timer = nullptr;
}; };

View file

@ -1,123 +0,0 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <uv.h>
#include "base/kernel/interfaces/IClient.h"
#include "base/net/stratum/Pool.h"
#include "base/net/stratum/SubmitResult.h"
#include "base/tools/Chrono.h"
#include "net/NetworkState.h"
xmrig::NetworkState::NetworkState() :
pool(),
accepted(0),
diff(0),
failures(0),
rejected(0),
total(0),
m_active(false)
{
}
uint32_t xmrig::NetworkState::avgTime() const
{
if (m_latency.empty()) {
return 0;
}
return connectionTime() / (uint32_t)m_latency.size();
}
uint32_t xmrig::NetworkState::latency() const
{
const size_t calls = m_latency.size();
if (calls == 0) {
return 0;
}
auto v = m_latency;
std::nth_element(v.begin(), v.begin() + calls / 2, v.end());
return v[calls / 2];
}
uint64_t xmrig::NetworkState::connectionTime() const
{
return m_active ? ((Chrono::steadyMSecs() - m_connectionTime) / 1000) : 0;
}
void xmrig::NetworkState::add(const SubmitResult &result, const char *error)
{
if (error) {
rejected++;
return;
}
accepted++;
total += result.diff;
const size_t ln = topDiff.size() - 1;
if (result.actualDiff > topDiff[ln]) {
topDiff[ln] = result.actualDiff;
std::sort(topDiff.rbegin(), topDiff.rend());
}
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : static_cast<uint16_t>(result.elapsed));
}
void xmrig::NetworkState::onActive(IClient *client)
{
snprintf(pool, sizeof(pool) - 1, "%s:%d", client->pool().host().data(), client->pool().port());
m_ip = client->ip();
m_tls = client->tlsVersion();
m_fingerprint = client->tlsFingerprint();
m_active = true;
m_connectionTime = Chrono::steadyMSecs();
}
void xmrig::NetworkState::stop()
{
m_active = false;
diff = 0;
m_ip = nullptr;
m_tls = nullptr;
m_fingerprint = nullptr;
failures++;
m_latency.clear();
}

View file

@ -28,15 +28,15 @@
#define APP_ID "xmrig" #define APP_ID "xmrig"
#define APP_NAME "XMRig" #define APP_NAME "XMRig"
#define APP_DESC "XMRig miner" #define APP_DESC "XMRig miner"
#define APP_VERSION "5.5.3" #define APP_VERSION "5.6.0-dev"
#define APP_DOMAIN "xmrig.com" #define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com" #define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com"
#define APP_KIND "miner" #define APP_KIND "miner"
#define APP_VER_MAJOR 5 #define APP_VER_MAJOR 5
#define APP_VER_MINOR 5 #define APP_VER_MINOR 6
#define APP_VER_PATCH 3 #define APP_VER_PATCH 0
#ifdef _MSC_VER #ifdef _MSC_VER
# if (_MSC_VER >= 1920) # if (_MSC_VER >= 1920)