Skip to content
Snippets Groups Projects
Commit 53652d35 authored by psychocrypt's avatar psychocrypt
Browse files

CPU: fix logical error

Fix wrong warning about unknown ASM type
parent b0ccccf3
No related branches found
No related tags found
No related merge requests found
......@@ -586,35 +586,36 @@ minethd::cn_hash_fun minethd::func_multi_selector(bool bHaveAes, bool bNoPrefetc
auto selected_function = func_table[ algv << 2 | digit.to_ulong() ];
// check for asm optimized version for cryptonight_v8
if(N <= 2 && algo == cryptonight_monero_v8 && bHaveAes)
{
std::string selected_asm = asm_version_str;
if(selected_asm == "auto")
selected_asm = cpu::getAsmName(N);
if(selected_asm != "off")
{
if(selected_asm == "intel_avx")
{
// Intel Ivy Bridge (Xeon v2, Core i7/i5/i3 3xxx, Pentium G2xxx, Celeron G1xxx)
if(N == 1)
selected_function = Cryptonight_hash_asm<1u, 0u>::template hash<cryptonight_monero_v8>;
else if(N == 2)
selected_function = Cryptonight_hash_asm<2u, 0u>::template hash<cryptonight_monero_v8>;
}
// supports only 1 thread per hash
if(N == 1 && selected_asm == "amd_avx")
{
// AMD Ryzen (1xxx and 2xxx series)
selected_function = Cryptonight_hash_asm<1u, 1u>::template hash<cryptonight_monero_v8>;
}
if(asm_version_str == "auto" && (selected_asm != "intel_avx" || selected_asm != "amd_avx"))
printer::inst()->print_msg(L3, "Switch to assembler version for '%s' cpu's", selected_asm.c_str());
else if(selected_asm != "intel_avx" || selected_asm != "amd_avx") // unknown asm type
printer::inst()->print_msg(L1, "Assembler '%s' unknown, fallback to non asm version of cryptonight_v8", selected_asm.c_str());
}
}
// check for asm optimized version for cryptonight_v8
if(N <= 2 && algo == cryptonight_monero_v8 && bHaveAes)
{
std::string selected_asm = asm_version_str;
if(selected_asm == "auto")
selected_asm = cpu::getAsmName(N);
if(selected_asm != "off")
{
if(selected_asm == "intel_avx")
{
// Intel Ivy Bridge (Xeon v2, Core i7/i5/i3 3xxx, Pentium G2xxx, Celeron G1xxx)
if(N == 1)
selected_function = Cryptonight_hash_asm<1u, 0u>::template hash<cryptonight_monero_v8>;
else if(N == 2)
selected_function = Cryptonight_hash_asm<2u, 0u>::template hash<cryptonight_monero_v8>;
}
// supports only 1 thread per hash
if(N == 1 && selected_asm == "amd_avx")
{
// AMD Ryzen (1xxx and 2xxx series)
selected_function = Cryptonight_hash_asm<1u, 1u>::template hash<cryptonight_monero_v8>;
}
if(asm_version_str == "auto" && (selected_asm != "intel_avx" || selected_asm != "amd_avx"))
printer::inst()->print_msg(L3, "Switch to assembler version for '%s' cpu's", selected_asm.c_str());
else if(selected_asm != "intel_avx" && selected_asm != "amd_avx") // unknown asm type
printer::inst()->print_msg(L1, "Assembler '%s' unknown, fallback to non asm version of cryptonight_v8", selected_asm.c_str());
}
}
return selected_function;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment