Initial ASM wrapper.

This commit is contained in:
XMRig 2018-09-24 09:51:21 +03:00
parent f163aad38c
commit ba65a34a01
7 changed files with 58 additions and 29 deletions

View file

@ -65,7 +65,8 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a
{
assert(variant >= VARIANT_0 && variant < VARIANT_MAX);
static const cn_hash_fun func_table[VARIANT_MAX * 10 * 3] = {
constexpr const size_t count = VARIANT_MAX * 10 * 3;
static const cn_hash_fun func_table[count + 2] = {
cryptonight_single_hash<CRYPTONIGHT, false, VARIANT_0>,
cryptonight_double_hash<CRYPTONIGHT, false, VARIANT_0>,
cryptonight_single_hash<CRYPTONIGHT, true, VARIANT_0>,
@ -242,6 +243,8 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
# endif
cryptonight_single_hash_asm<CRYPTONIGHT, VARIANT_2, ASM_INTEL>,
cryptonight_single_hash_asm<CRYPTONIGHT, VARIANT_2, ASM_RYZEN>
};
const size_t index = VARIANT_MAX * 10 * algorithm + 10 * variant + av - 1;

View file

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WORKER_H__
#define __WORKER_H__
#ifndef XMRIG_WORKER_H
#define XMRIG_WORKER_H
#include <atomic>
@ -33,7 +33,6 @@
#include "Mem.h"
struct cryptonight_ctx;
class Handle;
@ -67,4 +66,4 @@ protected:
};
#endif /* __WORKER_H__ */
#endif /* XMRIG_WORKER_H */